Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Japan Apple Pay Development

nakajijapan
February 02, 2017

Japan Apple Pay Development

日本のApple Pay開発

第7回ペパボテックカンファレンス~ minneアプリのミライ~
https://pepabo.connpass.com/event/49081/

nakajijapan

February 02, 2017
Tweet

More Decks by nakajijapan

Other Decks in Technology

Transcript

  1. @nakajijapan GMO PEPABO inc. Principal Engineer iOS / Web /

    OS X shibuya.swift About Me Daichi Nakajima
  2. Agenda • What is Apple Pay? • Background • Project

    • Required features • Problems • Conclusion
  3. Apple Pay • User • Easy • No need to

    re-enter payment and contact information • Secure • Pay using Touch ID • Private • Card number not expose to the merchant
  4. Apple Pay • Developer • Don't need to handle actual

    card numbers • Higher conversion rates and faster checkouts • No onboarding or existing accounts required
  5. Apple Pay • Developer • Don't need to handle actual

    card numbers • Higher conversion rates and faster checkouts • No onboarding or existing accounts required
  6. Problem • Contact • A contact object representing the new

    shipping address. To maintain privacy, the shipping information is anonymized. For example, in the United States it only includes the city, state, and zip code. This provides enough information to calculate shipping costs, without revealing sensitive information until the user actually approves the purchase. IUUQTEFWFMPQFSBQQMFDPNSFGFSFODFQBTTLJUQLQBZNFOUBVUIPSJ[BUJPOWJFXDPOUSPMMFSEFMFHBUFQBZNFOUBVUIPSJ[BUJPOWJFXDPOUSPMM
  7. PKPayment Button public class PKPaymentButton : UIButton { public convenience

    init(type buttonType: PKPaymentButtonType, style buttonStyle: PKPaymentButtonStyle) @available(iOS 9.0, *) public init(paymentButtonType type: PKPaymentButtonType, paymentButtonStyle style: PKPaymentButtonStyle) } • ΠϯελϯεԽ͔͠ڐ͞Εͳ͍ʂ
  8. Solution paymentButton?.removeFromSuperview() // ΫϨδοτΧʔυ͕ηοτΞοϓࡁΈ͔ if PKPaymentAuthorizationViewController.canMakePaymentsUsingNetworks( ApplePaymentManager.supportedPaymentNetworks) { paymentButton =

    PKPaymentButton(type: .Buy, style: .Black) } else { paymentButton = PKPaymentButton(type: .SetUp, style: .Black) } applePayBackgroundView.addSubview(paymentButton)
  9. import Contacts • બ୒ͨ͠৘ใCNContact͔Β֤ʑ͢Δ public class CNContact : NSObject, NSCopying,

    NSMutableCopying, NSSecureCoding { (..snip..) public var phoneNumbers: [CNLabeledValue] { get } public var emailAddresses: [CNLabeledValue] { get } public var postalAddresses: [CNLabeledValue] { get } public var urlAddresses: [CNLabeledValue] { get }
  10. import Contacts • ϥϕϧ public class CNLabeledValue : NSObject, NSCopying,

    NSSecureCoding { public var identifier: String { get } public var label: String? { get } @NSCopying public var value: protocol<NSCopying, NSSecureCoding> { get } public init(label: String?, value: protocol<NSCopying, NSSecureCoding>) (..snip..)
  11. public class CNLabeledValue : NSObject, NSCopying, NSSecureCoding { public var

    identifier: String { get } public var label: String? { get } @NSCopying public var value: protocol<NSCopying, NSSecureCoding> { get } public init(label: String?, value: protocol<NSCopying, NSSecureCoding>) (..snip..) import Contacts • ϥϕϧ