Japan Apple Pay Development

A77456b262557e22986345f6d0555c58?s=47 nakajijapan
February 02, 2017

Japan Apple Pay Development

日本のApple Pay開発

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

A77456b262557e22986345f6d0555c58?s=128

nakajijapan

February 02, 2017
Tweet

Transcript

  1. Japan Apple Pay Development 1&1"#05FDI$POG !OBLBKJKBQBO

  2. None
  3. @nakajijapan GMO PEPABO inc. Principal Engineer iOS / Web /

    OS X shibuya.swift About Me Daichi Nakajima
  4. NKJMultiMovieCaptureView NKJMovieComposer NKJPagerViewController PhotoSlider Teiten GitHub Sengiri Shari frustration.me Kazaguruma

  5. ϋϯυϝΠυ࡞඼Λ ചΕΔɺങ͑Δɻ ࠃ಺࠷େڃͷ ϋϯυϝΠυϚʔέοτ

  6. None
  7. Apple Pay JP launch partner

  8. Agenda • What is Apple Pay? • Background • Project

    • Required features • Problems • Conclusion
  9. Apple Pay

  10. 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
  11. Apple Pay • Developer • Don't need to handle actual

    card numbers • Higher conversion rates and faster checkouts • No onboarding or existing accounts required
  12. Ͱ͔͍ Demo

  13. Apple Pay "EE$BSU 4FMFDU 4UPDL 4FMFDU 1BZNFOUNFUIPE $POpSNBUJPO $PNQMFUJPO

  14. Apple Pay "EE$BSU 4FMFDU 4UPDL 4FMFDU 1BZNFOUNFUIPE $POpSNBUJPO $PNQMFUJPO $POpSNBUJPO

    $PNQMFUJPO "QQMF1BZ #VUUPO
  15. Apple Pay "EE$BSU 4FMFDU 4UPDL 4FMFDU 1BZNFOUNFUIPE $POpSNBUJPO $PNQMFUJPO $POpSNBUJPO

    $PNQMFUJPO "QQMF1BZ #VUUPO Simple!!!!
  16. Background

  17. ʊਓਓਓਓਓʊ ʼɹಥવͷɹʻ ʉY^Y^Y^Y^Yʉ

  18. “ࣾ௕௚׋ϓϩδΣΫτ”

  19. ۃൿϛογϣϯ

  20. Project

  21. Member • ॳظ • nakajijapan

  22. Member • ։ൃ࣌ • ϝϯόʔ • Mobile 2 • Web

    3 • Designer 1
  23. Source Management • ׬શʹ੾Γ཭ͯ͠ൿີཪʹ։ൃ • ެࣜൃදޙPull Request • ฒߦͯ͠։ൃ͍ͯͨ͠΋ͷ͸࠷ऴஈ֊ͰϚʔδ •

    ಉ࣌͡ظʹಉ͡StoryboardΛฤू͍ͯͨ͠
  24. Sorry, we could not display the entire diff because too

    many files (472) changed.
  25. Sorry, we could not display the entire diff because too

    many files (472) changed.
  26. Required Features

  27. Required Features • Mobile • Session 702 #WWDC16 • Web

    • Session 703 #WWDC17
  28. Design • Defaulting • σϑΥϧτͱͯ͠ଘࡏ͢΂͖ • Upstream • ۃྗ্ྲྀʹϘλϯ͸഑ஔ͞ΕΔ΂͖

  29. Defaulting

  30. Upstream "EE$BSU 4FMFDU 4UPDL 4FMFDU 1BZNFOUNFUIPE $POpSNBUJPO $PNQMFUJPO ❌

  31. Payment • Account which already registered • ……

  32. Apple Pay • Developer • Don't need to handle actual

    card numbers • Higher conversion rates and faster checkouts • No onboarding or existing accounts required
  33. Payment • Account which already registered • Guest

  34. Problems

  35. Anonymize

  36. Situation • Ϣʔβ৘ใͷೖྗ͕ඞਢ • νΣοΫ͸ࣗલͰߦ͏ඞཁ͋Γ

  37. PKPaymentAuthorizationViewControllerDelegate func paymentAuthorizationViewController( controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: (PKPaymentAuthorizationStatus,

    [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) {
  38. Problem • ໊લΛ࿈བྷઌ͔Βऔಘ͢Δ࣌ • ձ໊͚ࣾͩͷ৔߹ɺ໊લ͕ۭʹͳΔ • ΤϥʔνΣοΫ͕͞Ε͍ͯͳ͍ʂʂ • μϝͳͷͰ͸ʁ

  39. Problem • ϓϥΠόγʔ੍ݶ͕͋Δ • ඞཁͳ࣌ʹඞཁͳ৘ใ͔͠औಘͰ͖ͳ͍ • ίετͷܭࢉʹ໊લ͸͍Βͳ͍ʂ

  40. 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
  41. Solution • ໊લͷνΣοΫ͸ܾࡁ࣌ʹߦ͏

  42. PKPaymentButton

  43. None
  44. Situation • Apple Payະઃఆ࣌ • Χʔυొ࿥ը໘΁ • ొ࿥ޙɺߪೖͰ͖ΔΑ͏ʹ͢Δ

  45. Demo

  46. PKPayment Button let paymentButton = PKPaymentButton(type: .SetUp, style: .Black)

  47. PKPayment Button let paymentButton = PKPaymentButton(type: .SetUp, style: .Black) paymentButton.state

    = .buy
  48. Problem • Ϙλϯ͕ߋ৽͞Εͳ͍

  49. let paymentButton = PKPaymentButton(type: .SetUp, style: .Black) paymentButton.state = .buy

    PKPayment Button ❌
  50. 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) } • ΠϯελϯεԽ͔͠ڐ͞Εͳ͍ʂ
  51. Solution • ߋ৽(reloadData())ຖʹΠϯεϯλεԽ͢Δඞཁ͕ ͋Δ

  52. Solution paymentButton?.removeFromSuperview() // ΫϨδοτΧʔυ͕ηοτΞοϓࡁΈ͔ if PKPaymentAuthorizationViewController.canMakePaymentsUsingNetworks( ApplePaymentManager.supportedPaymentNetworks) { paymentButton =

    PKPaymentButton(type: .Buy, style: .Black) } else { paymentButton = PKPaymentButton(type: .SetUp, style: .Black) } applePayBackgroundView.addSubview(paymentButton)
  53. Contacts

  54. Contacts

  55. Problem • ήετߪೖ • Apple PayΛར༻͠ͳ͍έʔε • ࿈བྷઌͷೖྗ͕ͩΔ͍

  56. Solution • ࿈བྷઌ͔Βͷࣗಈೖྗ • ৘ใ͕ෳ਺͋Δ৔߹͸ActionSheetͰ௨஌ • ௨ৗͷߪೖϓϩηεͰ΋ೖྗΛۃྗ؆୯ʹ

  57. import ContactsUI • ࿈བྷઌʹΞΫηεͰ͖Δ • CNContactPickerViewController func contactPicker(picker: CNContactPickerViewController, didSelectContact

    contact: CNContact) { picker.dismissViewControllerAnimated(true)
  58. 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 }
  59. 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..)
  60. 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 • ϥϕϧ
  61. Demo

  62. more

  63. IUUQUFDIQFQBCPDPNBQQMFQBZJOKBQBO

  64. Conclusion

  65. Coclusion • Apple Payࣗମٕज़తͳ೉͘͠ͳ͍ • ৭ʑͭ·ͮ͘Օॴ͕͋Δ • UIΛΑΓΑ͘͢ΔͨΊʹෳ਺ͷFrameworkΛཧղ ͢Δඞཁ͋Γ

  66. Coclusion • Apple Payࣗମٕज़తͳ೉͘͠ͳ͍ • ৭ʑͭ·ͮ͘Օॴ͕͋Δ • UIΛΑΓΑ͘͢ΔͨΊʹෳ਺ͷFrameworkΛཧղ ͢Δඞཁ͋Γ •

    ൿີ͸΍ΊΑ͏
  67. • Apple Payࣗମٕज़తͳ೉͘͠ͳ͍ • ৭ʑͭ·ͮ͘Օॴ͕͋Δ • UIΛΑΓΑ͘͢ΔͨΊʹෳ਺ͷFrameworkΛཧղ ͢Δඞཁ͋Γ • ൿີ͸΍ΊΑ͏

    Coclusion ߪೖମݧ͕γϯϓ ϧʹͳΔʂʂʂʂ
  68. Coclusion • ϏδωεαΠυ • ΫϨδοτΧʔυΛରԠ͢Δͷ͸ඞਢ • ⭕ Master ❌ JCB

    ❓ Visa
  69. Thanks.