SlideShare a Scribd company logo
1 of 62
Download to read offline
김은영 @unnnyong
포스트 시대를


대비합시다.
let us: Go! 2020 Summer
김은영 @unnnyong
- 2018.04 ~ 2020.03 일본에서 minne iOS 개발

- try! Swift Tokyo 2020 Organizer
@try! Swift Tokyo 2019
🐣 소개
🗂 목차
1. Apple Pay ?


2. 일본에서 Apple Pay 활용


3. Apple Pay 도입


4. Apple Pay 구현


5. Apple Pay 개발시의 주의점
1. Apple Pay ?
1.Apple Pay ?
iOS 의 Wallet App에 결제 카드를 등록하면


iPhone,iPad,Mac,Apple Watch 에서


결제수단으로 사용할 수 있는 Apple의 결제 서비스입니다.
1.Apple Pay ?
Apple Pay 사용
1.Apple Pay ?
1.Wallet App 에서 카드 등록
출처 https://www.apple.com/apple-pay/#
fi
lm-card
- 카드를 등록할 때 로그인된 Apple Account에 카드가 등록됩
니다.


- 카드를 등록한 계정이 로그인 되어있는 iPhone,iPad,Mac
에서 사용 가능합니다.


- Apple Watch에서 사용하기 위해서는 별도의 설정이 필요합
니다.
1.Apple Pay ?
2. Wallet App에 등록된 카드로 결제
출처 https://support.apple.com/en-us/HT201239
- 결제에는 Apple 계정 비밀번호(또는 Touch ID,Face ID)가 필요
출처 https://minne.com/apple-pay
1.Apple Pay ?
2.일본에서 Apple Pay 활용
2.일본에서 Apple Pay 활용
- 오프라인 점포에서 NFC를 이용한 Apple Pay 결제
- Apple Pay로 Suica(한국의 티머니 동일한 서비스) 사용
- Safari에서 결제 수단으로 사용
- iOS(iPadOS) App의 결제 수단으로 사용
2.일본에서 Apple Pay 활용
오프라인 점포에서 NFC를 이용한 Apple Pay 결제
출처 https://www.apple.com/jp/apple-pay/
- 오프라인 점포에 구비된 NFC 단말기에


iPhone(Apple Watch)를 가져다 대면 Apple Pay로 결제가 가능.
2.일본에서 Apple Pay 활용
Apple Pay로


Suica(한국의 티머니 동일한 서비스) 사용
출처 https://www.apple.com/jp/apple-pay/
- 실물 교통 카드를 iPhone에 가져다 대는 것만으로 iPhone에 Suica 등
록 가능.


- 신규 Suica를 iPhone에서 발급받는 것도 가능.


- Suica 충전을 Suica App으로 가능.(Apple Pay 대신 일반 신용/체크
카드 사용 가능)


- 한국의 티머니와 동일하게 지하철/버스 탑승을 iPhone(Apple Watch)
를 갖다 대는 것만으로 사용 가능.


- Suica로 결제가 가능한 편의점 등의 오프라인 상점에서도 사용 가능.
2.일본에서 Apple Pay 활용
Safari에서 결제 수단으로 사용
출처 https://www.apple.com/jp/apple-pay/
2.일본에서 Apple Pay 활용
iOS(iPadOS) App의 결제 수단으로 사용
출처 https://www.apple.com/jp/apple-pay/
👉 오늘의 메인 주제 👈
3.Apple Pay 도입
iOS(iPadOS) App의


결제 수단으로 사용할 때
3.Apple Pay 도입
- 배송이 필요한 상품을 판매하는 iOS App.
출처 https://www.apple.com/jp/apple-pay/
- 판매된 상품은 배송 방법,배송지,


고객 요청 사항의 입력이 필요.
구매정보,구매 번호,처리된 지불 통지
3.Apple Pay 도입
출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/
🗄
💳
🧑💻
1
8
7
2
5
10
6
3
4
9
1.암호화된 결제 정보가 전송


2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider)


3.Token number 에 따른 결제 처리 (Provider -> 카드회사)


4.지불 처리 결과의 알림 (카드회사 -> Provider)


5.지불 처리 결과의 알림 (Provider -> 판매자)
6.결제 완료 알림 (판매자 -> 고객)


7.서비스 제공 / 제품 전달 (판매자 -> 고객)


8.판매 금액 (고객 -> 카드회사)


9.판매 금액 (카드회사 -> Provider)


10.판매 금액 (Provider -> 판매자)
고객 Provider
판매자
카드 회사
판매 금액
3.Apple Pay 도입
🗄
💳
🧑💻
고객 Provider
판매자
카드 회사
3.Apple Pay 도입
🗄
💳
🧑💻
고객 Provider
판매자
카드 회사
3.Apple Pay 도입
🗄
💳
🧑💻
고객 Provider
판매자
카드 회사
3.Apple Pay 도입
🗄
💳
🧑💻
고객 Provider
판매자
카드 회사
구매정보,구매 번호,처리된 지불 통지
3.Apple Pay 도입
출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/
🗄
💳
🧑💻
1 2
5
6
3
4
1.암호화된 결제 정보가 전송


2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider)


3.Token number 에 따른 결제 처리 (Provider -> 카드회사)


4.지불 처리 결과의 알림 (카드회사 -> Provider)


5.지불 처리 결과의 알림 (Provider -> 판매자)
6.결제 완료 알림 (판매자 -> 고객)


7.서비스 제공 / 제품 전달 (판매자 -> 고객)


8.판매 금액 (고객 -> 카드회사)


9.판매 금액 (카드회사 -> Provider)


10.판매 금액 (Provider -> 판매자)
고객 Provider
판매자
카드 회사
판매 금액
구매정보,구매 번호,처리된 지불 통지
3.Apple Pay 도입
출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/
🗄
💳
🧑💻
1
8
7
2
5
10
6
3
4
9
1.암호화된 결제 정보가 전송


2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider)


3.Token number 에 따른 결제 처리 (Provider -> 카드회사)


4.지불 처리 결과의 알림 (카드회사 -> Provider)


5.지불 처리 결과의 알림 (Provider -> 판매자)
6.결제 완료 알림 (판매자 -> 고객)


7.서비스 제공 / 제품 전달 (판매자 -> 고객)


8.판매 금액 (고객 -> 카드회사)


9.판매 금액 (카드회사 -> Provider)


10.판매 금액 (Provider -> 판매자)
고객 Provider
판매자
카드 회사
판매 금액
출처 : https://developer.apple.com/apple-pay/planning/
3.Apple Pay 도입
상품 화면에서 바로 구매 쇼핑 카트 화면에서 구매
Apple Pay가 실행되는 화면
4.Apple Pay 구현
4.Apple Pay 구현
출처 : https://developer.apple.com/apple-pay/planning/
1.상품 화면에서 Apple Pay 버튼 터치 2.결제 시트에서 주문 내용 확인
+ FaceID (Touch ID)
3.주문 완료
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
✔ 확인해야 할 것
- ApplePay Button
4.Apple Pay 구현
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
import UIKit


import PassKit


class ViewController: UIViewController {


private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black)


override func viewDidLoad() {


super.viewDidLoad()


setupApplePayButton()


}


}


private extension ViewController {


func setupApplePayButton() {


view.addSubview(applePayButton)


applePayButton.translatesAutoresizingMaskIntoConstraints = false


[


applePayButton.centerXAnchor.constraint(


equalToSystemSpacingAfter: view.centerXAnchor,


multiplier: 0.0


),


applePayButton.centerYAnchor.constraint(


equalToSystemSpacingBelow: view.centerYAnchor,


multiplier: 0.0


)


].forEach { constraint in


constraint.isActive = true


}


}


}
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
import UIKit


import PassKit


class ViewController: UIViewController {


private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black)


override func viewDidLoad() {


super.viewDidLoad()


setupApplePayButton()


}


}


private extension ViewController {


func setupApplePayButton() {


view.addSubview(applePayButton)


applePayButton.translatesAutoresizingMaskIntoConstraints = false


[


applePayButton.centerXAnchor.constraint(


equalToSystemSpacingAfter: view.centerXAnchor,


multiplier: 0.0


),


applePayButton.centerYAnchor.constraint(


equalToSystemSpacingBelow: view.centerYAnchor,


multiplier: 0.0


)


].forEach { constraint in


constraint.isActive = true


}


}


}


@available(iOS 8.3, *)


public enum PKPaymentButtonType : Int {


case plain = 0


case buy = 1


@available(iOS 9.0, *)


case setUp = 2


@available(iOS 10.0, *)


case inStore = 3


@available(iOS 10.2, *)


case donate = 4


@available(iOS 12.0, *)


case checkout = 5


@available(iOS 12.0, *)


case book = 6


@available(iOS 12.0, *)


case subscribe = 7


}


@available(iOS 8.3, *)


public enum PKPaymentButtonStyle : Int {


case white = 0


case whiteOutline = 1


case black = 2


}
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
import UIKit


import PassKit


class ViewController: UIViewController {


private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black)


override func viewDidLoad() {


super.viewDidLoad()


setupApplePayButton()


}


}


private extension ViewController {


func setupApplePayButton() {


view.addSubview(applePayButton)


applePayButton.translatesAutoresizingMaskIntoConstraints = false


[


applePayButton.centerXAnchor.constraint(


equalToSystemSpacingAfter: view.centerXAnchor,


multiplier: 0.0


),


applePayButton.centerYAnchor.constraint(


equalToSystemSpacingBelow: view.centerYAnchor,


multiplier: 0.0


)


].forEach { constraint in


constraint.isActive = true


}


}


}
1.상품 화면에서 Apple Pay 버튼 터치
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
2.결제 시트에서 주문 내용 확인
+ FaceID (Touch ID)
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
✔ 확인해야 할 것
- Payment Sheet 만들기
4.Apple Pay 구현
2.결제 시트에서 주문 내용 확인
+ FaceID (Touch ID)
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
2.결제 시트에서 주문 내용 확인
+ FaceID (Touch ID)
출처 : https://developer.apple.com/apple-pay/planning/
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


}


}
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


}


}
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


}


}
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


}


}
ApplePay 대행사인 Provider가 대응하고 있는 카드사로만 설정해줘야 한다.
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


}


}
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
func setupApplePayButton() {


applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside)


}


@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item]


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request)


else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}


}


extension ViewController: PKPaymentAuthorizationViewControllerDelegate {


func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {


applePayButton.isHidden = true


paymentStatusLabel.isHidden = false


controller.dismiss(animated: true)


}


}
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
Guest 구매의 경우에는 없어도 OK
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKPaymentSummaryItem(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송 전체 금액을 별도의 Item으로 만들어줘야 한다.
출처 : https://developer.apple.com/apple-pay/planning/
4.Apple Pay 구현
PaymentSheet 만들 때 입력할 value
Apple 계정 정보 or 회원 정보
Wallet App에서 가져오는 정보
@objc func presentToPaymentVC() {


let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000))


let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500))


let summary = PKPaymentSummaryItem(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500))


let request = PKPaymentRequest()


request.currencyCode = "KRW"


request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺


request.supportedNetworks = [.amex, .visa, .masterCard]


request.merchantCapabilities = .capability3DS


request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value


request.paymentSummaryItems = [item, shippingMethod, summary]


request.shippingType = .shipping


request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress]


// 회원의 경우에만 회원정보를 설정하면 된다.


let userInfo = UserInfo.shared


let contact = PKContact()


contact.emailAddress = userInfo.email


contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber)


var name = PersonNameComponents()


name.givenName = userInfo.name


contact.name = name


let address = CNMutablePostalAddress()


address.street = userInfo.address1


contact.postalAddress = address


request.shippingContact = contact


guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return }


paymentViewController.delegate = self


present(paymentViewController, animated: true)


}
배송
전체 금액 Item은 가장 마지막
4.Apple Pay 구현
4.Apple Pay 구현
Code는 GitHub를 참고해주세요
https://github.com/unnnyong/ApplePayDemo
3.주문 완료
출처 : https://developer.apple.com/apple-pay/planning/
주문 요청 사항 입력하기
✔ 확인해야 할 것
- Error Handling
⚠ 주의사항
- 주문 요청 사항의 입력은 여기서 구현해야 합니다.(Apple Pay와는 관련없는 판매자의 서버 API로 구현)
주문 요청 사항
비대면 배송 부탁드려요 😄
취소 저장
4.Apple Pay 구현
App Clips
iOS 14 ~
https://developer.apple.com/app-clips/
4.Apple Pay 구현
5.Apple Pay 개발시의 주의점
5.Apple Pay 개발시의 주의점
Apple Pay 버튼을


다른 결제 수단과 동일하게


선택할 수 있게하면 안되나요?
물론 단독 배치가 아니더라도 가능합니다.
참고 : Make the Most of Apple Pay
출처 : https://developer.apple.com/apple-pay/planning/
minne iOS 어플리케이션 화면
5.Apple Pay 개발시의 주의점
Apple Pay 에는


어떤 카드를 등록하더라도


사용이 가능한가요?
Apple Pay의 결제 대행사인 Provider가 지원하고 있는 카드사에 의존됩니다.


Example


- Provider 회사가 Master Card,AMEX만 지원하고 VISA는 지원하지 않는다면,
VISA 카드를 Wallet에 등록하더라도 해당 App에서 Apple Pay 결제는 불가능합
니다.😥
참고 : Apple Pay Provider
5.Apple Pay 개발시의 주의점
상품 화면 쇼핑 카트의 주문 내용 입력 화면
Apple Pay 버튼은


꼭 상품 화면에도 추가해야하나요?
필수는 아니지만,유저의 편리성이 증대됩니다.(Apple피셜)


참고 : Buttons and Marks - Apple Pay
출처 : https://developer.apple.com/apple-pay/planning/
5.Apple Pay 개발시의 주의점
Unit Test나 UI Test는 가능한가요?
제가 담당했었을 당시에는 아직 API가 구비되지 않아서 제가 담당했던 서비스에서는 사람이 Test 했습니다.😭
출처 : https://developer.apple.com/apple-pay/planning/
5.Apple Pay 개발시의 주의점
Apple Pay에 등록할 수 있는


Test용 신용카드가 있나요?
https://developer.apple.com/apple-pay/sandbox-testing/
출처 : https://developer.apple.com/apple-pay/planning/
감사합니다.🙏
궁금하신 점이 있으시면 언제든지 unnnuyong@gmail.com 로 부탁드립니다.

More Related Content

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Apple Pay 개발을 못해도 어떻게 하는지 아는 건 죄가 아니잖아

  • 2. 김은영 @unnnyong - 2018.04 ~ 2020.03 일본에서 minne iOS 개발 - try! Swift Tokyo 2020 Organizer @try! Swift Tokyo 2019 🐣 소개
  • 3. 🗂 목차 1. Apple Pay ? 2. 일본에서 Apple Pay 활용 3. Apple Pay 도입 4. Apple Pay 구현 5. Apple Pay 개발시의 주의점
  • 5. 1.Apple Pay ? iOS 의 Wallet App에 결제 카드를 등록하면 iPhone,iPad,Mac,Apple Watch 에서 결제수단으로 사용할 수 있는 Apple의 결제 서비스입니다.
  • 6. 1.Apple Pay ? Apple Pay 사용
  • 7. 1.Apple Pay ? 1.Wallet App 에서 카드 등록 출처 https://www.apple.com/apple-pay/# fi lm-card - 카드를 등록할 때 로그인된 Apple Account에 카드가 등록됩 니다. - 카드를 등록한 계정이 로그인 되어있는 iPhone,iPad,Mac 에서 사용 가능합니다. - Apple Watch에서 사용하기 위해서는 별도의 설정이 필요합 니다.
  • 8. 1.Apple Pay ? 2. Wallet App에 등록된 카드로 결제 출처 https://support.apple.com/en-us/HT201239 - 결제에는 Apple 계정 비밀번호(또는 Touch ID,Face ID)가 필요
  • 11. 2.일본에서 Apple Pay 활용 - 오프라인 점포에서 NFC를 이용한 Apple Pay 결제 - Apple Pay로 Suica(한국의 티머니 동일한 서비스) 사용 - Safari에서 결제 수단으로 사용 - iOS(iPadOS) App의 결제 수단으로 사용
  • 12. 2.일본에서 Apple Pay 활용 오프라인 점포에서 NFC를 이용한 Apple Pay 결제 출처 https://www.apple.com/jp/apple-pay/ - 오프라인 점포에 구비된 NFC 단말기에 iPhone(Apple Watch)를 가져다 대면 Apple Pay로 결제가 가능.
  • 13. 2.일본에서 Apple Pay 활용 Apple Pay로 Suica(한국의 티머니 동일한 서비스) 사용 출처 https://www.apple.com/jp/apple-pay/ - 실물 교통 카드를 iPhone에 가져다 대는 것만으로 iPhone에 Suica 등 록 가능. - 신규 Suica를 iPhone에서 발급받는 것도 가능. - Suica 충전을 Suica App으로 가능.(Apple Pay 대신 일반 신용/체크 카드 사용 가능) - 한국의 티머니와 동일하게 지하철/버스 탑승을 iPhone(Apple Watch) 를 갖다 대는 것만으로 사용 가능. - Suica로 결제가 가능한 편의점 등의 오프라인 상점에서도 사용 가능.
  • 14. 2.일본에서 Apple Pay 활용 Safari에서 결제 수단으로 사용 출처 https://www.apple.com/jp/apple-pay/
  • 15. 2.일본에서 Apple Pay 활용 iOS(iPadOS) App의 결제 수단으로 사용 출처 https://www.apple.com/jp/apple-pay/ 👉 오늘의 메인 주제 👈
  • 17. iOS(iPadOS) App의 결제 수단으로 사용할 때 3.Apple Pay 도입 - 배송이 필요한 상품을 판매하는 iOS App. 출처 https://www.apple.com/jp/apple-pay/ - 판매된 상품은 배송 방법,배송지, 고객 요청 사항의 입력이 필요.
  • 18. 구매정보,구매 번호,처리된 지불 통지 3.Apple Pay 도입 출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/ 🗄 💳 🧑💻 1 8 7 2 5 10 6 3 4 9 1.암호화된 결제 정보가 전송 2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider) 3.Token number 에 따른 결제 처리 (Provider -> 카드회사) 4.지불 처리 결과의 알림 (카드회사 -> Provider) 5.지불 처리 결과의 알림 (Provider -> 판매자) 6.결제 완료 알림 (판매자 -> 고객) 7.서비스 제공 / 제품 전달 (판매자 -> 고객) 8.판매 금액 (고객 -> 카드회사) 9.판매 금액 (카드회사 -> Provider) 10.판매 금액 (Provider -> 판매자) 고객 Provider 판매자 카드 회사 판매 금액
  • 19. 3.Apple Pay 도입 🗄 💳 🧑💻 고객 Provider 판매자 카드 회사
  • 20. 3.Apple Pay 도입 🗄 💳 🧑💻 고객 Provider 판매자 카드 회사
  • 21. 3.Apple Pay 도입 🗄 💳 🧑💻 고객 Provider 판매자 카드 회사
  • 22. 3.Apple Pay 도입 🗄 💳 🧑💻 고객 Provider 판매자 카드 회사
  • 23. 구매정보,구매 번호,처리된 지불 통지 3.Apple Pay 도입 출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/ 🗄 💳 🧑💻 1 2 5 6 3 4 1.암호화된 결제 정보가 전송 2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider) 3.Token number 에 따른 결제 처리 (Provider -> 카드회사) 4.지불 처리 결과의 알림 (카드회사 -> Provider) 5.지불 처리 결과의 알림 (Provider -> 판매자) 6.결제 완료 알림 (판매자 -> 고객) 7.서비스 제공 / 제품 전달 (판매자 -> 고객) 8.판매 금액 (고객 -> 카드회사) 9.판매 금액 (카드회사 -> Provider) 10.판매 금액 (Provider -> 판매자) 고객 Provider 판매자 카드 회사 판매 금액
  • 24. 구매정보,구매 번호,처리된 지불 통지 3.Apple Pay 도입 출처 https://www.gmo-pg.com/en/service/mulpay/apple-pay/ 🗄 💳 🧑💻 1 8 7 2 5 10 6 3 4 9 1.암호화된 결제 정보가 전송 2.암호화된 지불 정보에 따른 지불 처리 (판매자 -> Provider) 3.Token number 에 따른 결제 처리 (Provider -> 카드회사) 4.지불 처리 결과의 알림 (카드회사 -> Provider) 5.지불 처리 결과의 알림 (Provider -> 판매자) 6.결제 완료 알림 (판매자 -> 고객) 7.서비스 제공 / 제품 전달 (판매자 -> 고객) 8.판매 금액 (고객 -> 카드회사) 9.판매 금액 (카드회사 -> Provider) 10.판매 금액 (Provider -> 판매자) 고객 Provider 판매자 카드 회사 판매 금액
  • 25. 출처 : https://developer.apple.com/apple-pay/planning/ 3.Apple Pay 도입 상품 화면에서 바로 구매 쇼핑 카트 화면에서 구매 Apple Pay가 실행되는 화면
  • 27. 4.Apple Pay 구현 출처 : https://developer.apple.com/apple-pay/planning/ 1.상품 화면에서 Apple Pay 버튼 터치 2.결제 시트에서 주문 내용 확인 + FaceID (Touch ID) 3.주문 완료
  • 28. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ ✔ 확인해야 할 것 - ApplePay Button 4.Apple Pay 구현
  • 29. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현
  • 30. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 import UIKit import PassKit class ViewController: UIViewController { private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black) override func viewDidLoad() { super.viewDidLoad() setupApplePayButton() } } private extension ViewController { func setupApplePayButton() { view.addSubview(applePayButton) applePayButton.translatesAutoresizingMaskIntoConstraints = false [ applePayButton.centerXAnchor.constraint( equalToSystemSpacingAfter: view.centerXAnchor, multiplier: 0.0 ), applePayButton.centerYAnchor.constraint( equalToSystemSpacingBelow: view.centerYAnchor, multiplier: 0.0 ) ].forEach { constraint in constraint.isActive = true } } }
  • 31. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 import UIKit import PassKit class ViewController: UIViewController { private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black) override func viewDidLoad() { super.viewDidLoad() setupApplePayButton() } } private extension ViewController { func setupApplePayButton() { view.addSubview(applePayButton) applePayButton.translatesAutoresizingMaskIntoConstraints = false [ applePayButton.centerXAnchor.constraint( equalToSystemSpacingAfter: view.centerXAnchor, multiplier: 0.0 ), applePayButton.centerYAnchor.constraint( equalToSystemSpacingBelow: view.centerYAnchor, multiplier: 0.0 ) ].forEach { constraint in constraint.isActive = true } } } @available(iOS 8.3, *) public enum PKPaymentButtonType : Int { case plain = 0 case buy = 1 @available(iOS 9.0, *) case setUp = 2 @available(iOS 10.0, *) case inStore = 3 @available(iOS 10.2, *) case donate = 4 @available(iOS 12.0, *) case checkout = 5 @available(iOS 12.0, *) case book = 6 @available(iOS 12.0, *) case subscribe = 7 } @available(iOS 8.3, *) public enum PKPaymentButtonStyle : Int { case white = 0 case whiteOutline = 1 case black = 2 }
  • 32. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 import UIKit import PassKit class ViewController: UIViewController { private let applePayButton = PKPaymentButton(paymentButtonType: .buy, paymentButtonStyle: .black) override func viewDidLoad() { super.viewDidLoad() setupApplePayButton() } } private extension ViewController { func setupApplePayButton() { view.addSubview(applePayButton) applePayButton.translatesAutoresizingMaskIntoConstraints = false [ applePayButton.centerXAnchor.constraint( equalToSystemSpacingAfter: view.centerXAnchor, multiplier: 0.0 ), applePayButton.centerYAnchor.constraint( equalToSystemSpacingBelow: view.centerYAnchor, multiplier: 0.0 ) ].forEach { constraint in constraint.isActive = true } } }
  • 33. 1.상품 화면에서 Apple Pay 버튼 터치 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현
  • 34. 2.결제 시트에서 주문 내용 확인 + FaceID (Touch ID) 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 ✔ 확인해야 할 것 - Payment Sheet 만들기
  • 35. 4.Apple Pay 구현 2.결제 시트에서 주문 내용 확인 + FaceID (Touch ID) 출처 : https://developer.apple.com/apple-pay/planning/
  • 36. 4.Apple Pay 구현 2.결제 시트에서 주문 내용 확인 + FaceID (Touch ID) 출처 : https://developer.apple.com/apple-pay/planning/ PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보
  • 37. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false } }
  • 38. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false } }
  • 39. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false } }
  • 40. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false } } ApplePay 대행사인 Provider가 대응하고 있는 카드사로만 설정해줘야 한다.
  • 41. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false } }
  • 42. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 func setupApplePayButton() { applePayButton.addTarget(self, action: #selector(presentToPaymentVC), for: .touchUpInside) } @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item] guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } } extension ViewController: PKPaymentAuthorizationViewControllerDelegate { func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) { applePayButton.isHidden = true paymentStatusLabel.isHidden = false controller.dismiss(animated: true) } }
  • 43. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보
  • 44. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보
  • 45. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송
  • 46. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송
  • 47. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송
  • 48. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송 Guest 구매의 경우에는 없어도 OK
  • 49. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKShippingMethod(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송
  • 50. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKPaymentSummaryItem(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송 전체 금액을 별도의 Item으로 만들어줘야 한다.
  • 51. 출처 : https://developer.apple.com/apple-pay/planning/ 4.Apple Pay 구현 PaymentSheet 만들 때 입력할 value Apple 계정 정보 or 회원 정보 Wallet App에서 가져오는 정보 @objc func presentToPaymentVC() { let item = PKPaymentSummaryItem(label: "삼겹살 500g", amount: NSDecimalNumber(integerLiteral: 10_000)) let shippingMethod = PKShippingMethod(label: "미사일배송", amount: NSDecimalNumber(integerLiteral: 2_500)) let summary = PKPaymentSummaryItem(label: "전체 금액", amount: NSDecimalNumber(integerLiteral: 12_500)) let request = PKPaymentRequest() request.currencyCode = "KRW" request.countryCode = "JP" // "KR"은 아직 안됩니다 🥺 request.supportedNetworks = [.amex, .visa, .masterCard] request.merchantCapabilities = .capability3DS request.merchantIdentifier = "merchant.com.example.applePay" // 임의의 Identifier value request.paymentSummaryItems = [item, shippingMethod, summary] request.shippingType = .shipping request.requiredShippingContactFields = [.postalAddress, .name, .phoneNumber, .emailAddress] // 회원의 경우에만 회원정보를 설정하면 된다. let userInfo = UserInfo.shared let contact = PKContact() contact.emailAddress = userInfo.email contact.phoneNumber = CNPhoneNumber(stringValue: userInfo.phoneNumber) var name = PersonNameComponents() name.givenName = userInfo.name contact.name = name let address = CNMutablePostalAddress() address.street = userInfo.address1 contact.postalAddress = address request.shippingContact = contact guard let paymentViewController = PKPaymentAuthorizationViewController(paymentRequest: request) else { return } paymentViewController.delegate = self present(paymentViewController, animated: true) } 배송 전체 금액 Item은 가장 마지막
  • 53. 4.Apple Pay 구현 Code는 GitHub를 참고해주세요 https://github.com/unnnyong/ApplePayDemo
  • 54. 3.주문 완료 출처 : https://developer.apple.com/apple-pay/planning/ 주문 요청 사항 입력하기 ✔ 확인해야 할 것 - Error Handling ⚠ 주의사항 - 주문 요청 사항의 입력은 여기서 구현해야 합니다.(Apple Pay와는 관련없는 판매자의 서버 API로 구현) 주문 요청 사항 비대면 배송 부탁드려요 😄 취소 저장 4.Apple Pay 구현
  • 55. App Clips iOS 14 ~ https://developer.apple.com/app-clips/ 4.Apple Pay 구현
  • 57. 5.Apple Pay 개발시의 주의점 Apple Pay 버튼을 다른 결제 수단과 동일하게 선택할 수 있게하면 안되나요? 물론 단독 배치가 아니더라도 가능합니다. 참고 : Make the Most of Apple Pay 출처 : https://developer.apple.com/apple-pay/planning/
  • 58. minne iOS 어플리케이션 화면 5.Apple Pay 개발시의 주의점 Apple Pay 에는 어떤 카드를 등록하더라도 사용이 가능한가요? Apple Pay의 결제 대행사인 Provider가 지원하고 있는 카드사에 의존됩니다. Example - Provider 회사가 Master Card,AMEX만 지원하고 VISA는 지원하지 않는다면, VISA 카드를 Wallet에 등록하더라도 해당 App에서 Apple Pay 결제는 불가능합 니다.😥 참고 : Apple Pay Provider
  • 59. 5.Apple Pay 개발시의 주의점 상품 화면 쇼핑 카트의 주문 내용 입력 화면 Apple Pay 버튼은 꼭 상품 화면에도 추가해야하나요? 필수는 아니지만,유저의 편리성이 증대됩니다.(Apple피셜) 참고 : Buttons and Marks - Apple Pay 출처 : https://developer.apple.com/apple-pay/planning/
  • 60. 5.Apple Pay 개발시의 주의점 Unit Test나 UI Test는 가능한가요? 제가 담당했었을 당시에는 아직 API가 구비되지 않아서 제가 담당했던 서비스에서는 사람이 Test 했습니다.😭 출처 : https://developer.apple.com/apple-pay/planning/
  • 61. 5.Apple Pay 개발시의 주의점 Apple Pay에 등록할 수 있는 Test용 신용카드가 있나요? https://developer.apple.com/apple-pay/sandbox-testing/ 출처 : https://developer.apple.com/apple-pay/planning/
  • 62. 감사합니다.🙏 궁금하신 점이 있으시면 언제든지 unnnuyong@gmail.com 로 부탁드립니다.