Book Image

Apple Pay Essentials

By : Ernest Bruce
Book Image

Apple Pay Essentials

By: Ernest Bruce

Overview of this book

Apple Pay, one of the most talked about offerings of the latest iOS 9 release, is a digital wallet and electronic payment system developed by Apple Inc. Paying in stores or within apps has never been easier or safer. Gone are the days of searching for your wallet, and the wasted moments finding the right card! Now you can use your credit cards and rewards cards with just a touch. It allows payment to merchants, using Near field Communication (NFC), and within iOS apps. Implementing Apple Pay within apps for payment is a bit tricky, but our book solves this problem for you. Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with necessary skills to successfully implement Apple Pay in your online-payment workflow. Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with the necessary skills to successfully implement Apple Pay. We start off by teaching you how to obtain the certificates necessary to encrypt customers’ payment information. We will use Xcode and Objective C for the interface and Node.js for server side code. You will then learn how to determine whether the customer can use Apple Pay, and how to create payment requests. You will come to grips with designing a payment-processor program to interact with the payment gateway. Finally, we take a look at a business-focused view of Apple Pay protocols and classes. By the end of this book, you will be able to build a fully functional Apple Pay-integrated iOS app
Table of Contents (13 chapters)

Index

A

  • actors, authorization workflow
    • about / Actors and operations in the authorization workflow
  • actors, payment processing workflow / Actors and operations in the processing workflow
  • app
    • Apple Pay, enabling / Enabling Apple Pay in your app
  • Apple merchant identifier / Merchant identifier and capabilities
  • Apple Pay
    • payment workflow / The Apple Pay payment workflow
    • enabling, in app / Enabling Apple Pay in your app
  • Apple Pay, app
    • merchant identifier, creating / Creating your app's Apple Pay merchant identifier
    • merchant certificate, installing in Mac / Installing your app's Apple Pay merchant certificate on your Mac
    • enabling, Xcode project / Enabling Apple Pay in your app's Xcode project
  • Apple Pay classes
    • PKPaymentButton / Main classes
    • PKPaymentRequest / Main classes
    • PKPaymentSummaryItem / The PKPaymentSummaryItem class
    • PKPaymentMethod class / The PKPaymentMethod class
    • PKShippingMethod class / The PKShippingMethod class
    • PKPaymentAuthorizationViewController class / The PKPaymentAuthorizationViewController class
    • PKPayment class / The PKPayment class
    • PKPaymentToken class / The PKPaymentToken class
  • application data, PKPaymentRequest class
    • applicationData (NSData*) / applicationData (NSData*)
    • payment sheet delegate / delegate id <PKPaymentAuthorizationViewControllerDelegate>
  • authorization process, online payment process
    • steps / An overview of the online payment process
    • transaction authorization / An overview of the online payment process
  • authorization workflow
    • actors / Actors and operations in the authorization workflow
    • operations / Actors and operations in the authorization workflow
    • steps / Actors and operations in the authorization workflow
  • auxiliary classes
    • about / Auxiliary classes
    • PKContact class / Auxiliary classes
    • NSPersonNameComponents class / The NSPersonNameComponents class
    • CNPhoneNumber class / The CNPhoneNumber class
    • CNPostalAddress class / The CNPostalAddress class

B

  • billing and shipping contacts, PKPaymentRequest class
    • about / Billing and shipping contacts
    • billingContact (PKContact*) / billingContact (PKContact*), shippingContact (PKContact*)

C

  • Certificate Signing Request (CSR) / Creating your app's Apple Pay merchant identifier
  • clients
    • inventory information, providing / Providing inventory information to clients
  • CNPhoneNumber class
    • phone numbers, creating / Creating a phone number
    • phone numbers, string / Phone number string
  • CNPostalAddress class
    • postal address components / Postal address components
  • components, PKPayment object
    • payment token (PKPaymentToken) / The merchant app receives the payment token
    • billing contact / The merchant app receives the payment token
    • shipping contact / The merchant app receives the payment token
    • shipping method (PKShippingMethod) / The merchant app receives the payment token
  • components, PKPaymentToken object
    • payment data / The merchant app receives the payment token
    • payment method (PKPaymentMethod / The merchant app receives the payment token
    • transaction identifier (NSString) / The merchant app receives the payment token
  • contact address components, PKContact class
    • emailAddress (NSString*) / emailAddress (NSString*)
    • name (NSPersonNameComponents*) / name (NSPersonNameComponents*)
    • phoneNumber (CNPhoneNumber*) / phoneNumber (CNPhoneNumber*)
    • postalAddress (CNPostalAddress*) / postalAddress (CNPostalAddress*)
  • country code
    • reference link / Country and currency code
  • currency code
    • reference link / Country and currency code
  • custom information, tied to order
    • specifying / Specifying custom information tied to the order

E

  • Europay, MasterCard, and Visa (EMV) / Creating the payment request

F

  • fields, order records
    • date / Defining order management data structures
    • description / Defining order management data structures
    • shipping_contact / Defining order management data structures
    • shipping_email / Defining order management data structures
    • shipping_street / Defining order management data structures
    • shipping_city / Defining order management data structures
    • shipping_state / Defining order management data structures
    • shipping_zip / Defining order management data structures
    • shipping_method_name / Defining order management data structures
  • fields, product records
    • name / Defining order management data structures
    • description / Defining order management data structures
    • image_uri / Defining order management data structures
    • quantity_on_hand / Defining order management data structures
    • price / Defining order management data structures
  • fields, shipping records
    • name / Defining order management data structures
    • description / Defining order management data structures
    • transit_days / Defining order management data structures
    • price / Defining order management data structures

H

  • HTTPS (HTTP Secure) protocol / Implementing secure communication

I

  • inventory information
    • obtaining / Getting inventory information
    • providing, to clients / Providing inventory information to clients
  • inventory service
    • information, gathering / Getting information from an inventory service
    • information, obtaining / Getting inventory information
    • shipping information, obtaining / Getting shipping information

M

  • Mac
    • merchant certificate, installing / Installing your app's Apple Pay merchant certificate on your Mac
  • merchant app
    • payment token, receiving / The merchant app receives the payment token
    • charge token receiving from payment gateway / The merchant app receives the charge token from the payment gateway
    • order information, sending to order processing system / The merchant app sends the order information to the order processing system
    • transaction status, receiving from processing web app / The merchant app receives the transaction status from the order processing web app
    • transaction status, conveying to user / The merchant app conveys the transaction status to the user
    • payment sheet, dismissing / The merchant app dismisses the payment sheet
  • merchant capabilities / Merchant identifier and capabilities
  • merchant certificate
    • installing, in Mac / Installing your app's Apple Pay merchant certificate on your Mac
  • merchant identifier
    • creating / Creating your app's Apple Pay merchant identifier

N

  • NSPersonNameComponents class
    • about / The NSPersonNameComponents class
    • person name components / Person name components

O

  • online payment process
    • overview / An overview of the online payment process
    • payment gateway / An overview of the online payment process
    • payment processor / An overview of the online payment process
    • issuing bank (issuer) / An overview of the online payment process
    • (authorized or declined) / An overview of the online payment process
    • acquiring bank (acquirer) / An overview of the online payment process
    • working / An overview of the online payment process
    • authorization hold / An overview of the online payment process
    • authorization process / An overview of the online payment process
    • settlement process / An overview of the online payment process
  • operations, authorization workflow
    • about / Actors and operations in the authorization workflow
    • payment request (PKPaymentRequest) / Actors and operations in the authorization workflow
    • shipping type (PKShippingType) / Actors and operations in the authorization workflow
    • payment summary items (PKPaymentSummaryItem) / Actors and operations in the authorization workflow
    • shipping method (PKShippingMethod) / Actors and operations in the authorization workflow
    • shipping methods (PKShippingMethod objects) / Actors and operations in the authorization workflow
    • payment sheet (PKPaymentAuthorizationViewController) / Actors and operations in the authorization workflow
    • payment sheet-interaction protocol (PKPaymentAuthorizationViewControllerDelegate) / Actors and operations in the authorization workflow
  • operations, payment processing workflow
    • about / Actors and operations in the processing workflow
    • payment authorized / Actors and operations in the processing workflow
    • payment token / Actors and operations in the processing workflow
    • order info and charge token / Actors and operations in the processing workflow
    • charge card / Actors and operations in the processing workflow
    • approved or declined / Actors and operations in the processing workflow
    • transaction result and order metadata / Actors and operations in the processing workflow
    • transaction result / Actors and operations in the processing workflow
    • payment sheet done / Actors and operations in the processing workflow
    • dismiss / Actors and operations in the processing workflow
  • order management
    • data structures, defining / Defining order management data structures
  • order management server web app
    • configuring / Configuring an order management server web app
    • about / Configuring an order management server web app
  • orders, from client
    • processing / Processing orders from clients

P

  • Pay button
    • presenting / Presenting the Apple Pay button
  • Pay button, online payment process
    • presenting / Presenting the Apple Pay button
  • payment details
    • specifying / Specifying payment details
  • payment processing information, PKPaymentRequest class
    • countryCode (NSString*) code / countryCode (NSString*)
    • currencyCode (NSString*) code / currencyCode (NSString*)
    • merchantCapabilities (PKMerchantCapability) / merchantCapabilities (PKMerchantCapability)
    • merchantIdentifier (NSString*) / merchantIdentifier (NSString*)
    • supportedNetworks (NSArray<NSString*>*) / supportedNetworks (NSArray<NSString*>*)
  • payment processing workflow
    • actors / Actors and operations in the processing workflow
    • operations / Actors and operations in the processing workflow
  • payment request
    • payment summary items / Creating the payment request
    • creating / Creating the payment request, Creating the payment request
    • details, specifying / Specifying payment details
    • currency code, specifying / Country and currency code
    • country code, specifying / Country and currency code
    • Apple merchant identifier / Merchant identifier and capabilities
    • merchant capabilities / Merchant identifier and capabilities
  • payment sheet / Presenting the payment sheet
    • payment summary items / Presenting the payment sheet
    • used, for responding to user interactions / Responding to user interactions with the payment sheet
  • payment sheet user event protocol
    • about / Payment sheet user event protocol
    • PKPaymentAuthorizationViewControllerDelegate protocol / The PKPaymentAuthorizationViewControllerDelegate protocol
  • payment summary items, PKPaymentRequest class
    • paymentSummaryItems (NSArray<PKPaymentSummaryItem*>*) / paymentSummaryItems (NSArray<PKPaymentSummaryItem*>*)
  • payment workflow, Apple Pay
    • about / The Apple Pay payment workflow
    • Pay button, presenting / The Apple Pay payment workflow, Presenting the Apple Pay button
    • payment request, presenting / The Apple Pay payment workflow, Creating the payment request
    • payment sheet, presenting / The Apple Pay payment workflow, Presenting the payment sheet
    • order changes, responding to / The Apple Pay payment workflow, Responding to order changes and payment authorization
    • payment information, submitting to gateway / The Apple Pay payment workflow, Submitting the payment information to the payment gateway
    • payment authorization, responding to / Responding to order changes and payment authorization
  • person name components, NSPersonNameComponents class
    • namePrefix (NSString*) / namePrefix (NSString*)
    • givenName (NSString*) / givenName (NSString*)
    • middleName (NSString*) / middleName (NSString*)
    • familyName (NSString*) / familyName (NSString*)
    • nameSuffix (NSString*) / nameSuffix (NSString*)
    • nickname (NSString) / nickname (NSString)
    • phoneticRepresentation (NSPersonNameComponents*) / phoneticRepresentation (NSPersonNameComponents*)
  • PKContact class
    • about / The PKContact class
    • contact address components / Contact address components
  • PKPaymentAuthorizationViewController class
    • functions / The PKPaymentAuthorizationViewController class
    • Apple Pay support, determing / Determining Apple Pay support
    • Apple Pay support, +canMakePayments / +canMakePayments
    • Apple Pay support,+canMakePaymentsUsingNetworks* / +canMakePaymentsUsingNetworks:
    • Apple Pay support, +canMakePaymentsUsingNetworks*capabilities / +canMakePaymentsUsingNetworks:capabilities:
    • initializing / Initializing and presenting
    • presenting / Initializing and presenting
    • -initWithPaymentRequest* / -initWithPaymentRequest:, -initWithPaymentRequest:
  • PKPaymentAuthorizationViewControllerDelegate protocol
    • about / The PKPaymentAuthorizationViewControllerDelegate protocol
    • payment card, selecting / The user chooses a payment card
    • shipping address, selecting / The user selects a shipping address
    • shipping method, selecting / The user selects a shipping method
    • payment request, authorizing / The user authorizes the payment request, -paymentAuthorizationViewController:didAuthorizePayment: completion:
    • payment sheet, completing / The payment sheet is done
  • PKPaymentButton class
    • about / Main classes, The PKPaymentButton class
    • Pay button, creatng / Creating the button
    • +buttonWithType*style, used for creating Pay button / +buttonWithType:style
  • PKPayment class
    • about / The PKPayment class
    • token (PKPaymentToken*) / token (PKPaymentToken*)
    • billingContact (PKContact*) / billingContact (PKContact*)
  • PKPaymentMethod class
    • about / The PKPaymentMethod class
    • card name / Card tame
    • card name, displayName (NSString*) / displayName (NSString*)
    • card type, PKPaymentMethodType / type (PKPaymentMethodType)
    • payment network / Payment network
    • payment network, NSString* / network (NSString*)
    • payment pass property / Payment pass
    • payment pass property, paymentPass (PKPaymentPass*) / paymentPass (PKPaymentPass*)
  • PKPaymentRequest class
    • about / Main classes, The PKPaymentRequest class
    • payment processing information / Payment processing information
    • payment summary items / Payment summary items
    • required address fields / The required address fields
    • billing and shipping contacts / Billing and shipping contacts
    • shipping method / Shipping methods
    • shipping type / Shipping type
    • application data / Application data
  • PKPaymentSummaryItem class
    • about / The PKPaymentSummaryItem class
    • summary item, creating / Creating a summary item
    • summary item, components / Summary item components
    • summary item, types / Pending or final
  • PKPaymentToken class
    • abou / The PKPaymentToken class
    • encrypted payment information / Encrypted payment information
  • PKShippingMethod class
    • about / The PKShippingMethod class
    • user-friendly description property / User-friendly description
    • user-friendly description property, detail (NSString*) / detail (NSString*)
    • App-level identifier property / App-level identifier
    • App-level identifier property, identifier (NSString*) / identifier (NSString*)
  • postal address components, CNPostalAddress class
    • street (NSString*) / street (NSString*)
    • city (NSString*) / city (NSString*)
    • state (NSString*) / state (NSString*)
    • postalCode (NSString*) / postalCode (NSString*)
    • country (NSString*) / country (NSString*)
    • ISOCountryCode (NSString*) / ISOCountryCode (NSString*)
  • Postprocess phase
    • about / The postprocess phase
    • transaction status, receiving from processing web app by merchant app / The merchant app receives the transaction status from the order processing web app
    • transaction status, conveying to user by merchant app / The merchant app conveys the transaction status to the user
    • payment sheet, dismissing by merchant app / The merchant app dismisses the payment sheet
  • Preprocess phase
    • about / The preprocess phase
    • payment token, receiving by merchant app / The merchant app receives the payment token
    • charge token, receiving from payment gateway by merchant app / The merchant app receives the charge token from the payment gateway
    • order information, sending to order processing system by merchant app / The merchant app sends the order information to the order processing system
  • Process phase
    • about / The process phase
  • product card
    • displaying / Displaying the product card
    • product information, presenting / Presenting product information
    • Pay button, presenting / Presenting the Apple Pay button
  • product information
    • presenting / Presenting product information

R

  • RED MINI-MAGS
    • URL / Implementing secure communication
  • Representational State Transfer (REST) / Getting information from an inventory service
  • required address fields, PKPaymentRequest class
    • requiredBillingAddressFields (PKAddressField) / requiredBillingAddressFields (PKAddressField), requiredShippingAddressFields (PKAddressField)
    • requiredShippingAddressFields (PKAddressField) / requiredBillingAddressFields (PKAddressField), requiredShippingAddressFields (PKAddressField)

S

  • secure communication
    • implementing / Implementing secure communication
  • settlement process online payment process
    • steps / An overview of the online payment process
  • shared method
    • implementation, for computing summary items / Implementing a shared method to compute summary items
  • shipping and billing information
    • requiring / Requiring shipping and billing information
    • addresses, requiring / Requiring shipping or billing addresses
    • addresses, specifying / Specifying shipping or billing addresses
    • shipping methods, specifying / Specifying shipping methods
  • shipping information
    • obtaining / Getting shipping information
  • ShippingMethod collection / Defining order management data structures
  • shipping methods, PKPaymentRequest class
    • abou / Shipping methods
    • shippingMethods (NSArray<PKShippingMethod*>*) / shippingMethods (NSArray<PKShippingMethod*>*)
  • shipping type, PKPaymentRequest class
    • about / Shipping type
    • PKShippingTypeShipping / shippingType (PKShippingType)
    • PKShippingTypeDelivery / shippingType (PKShippingType)
    • PKShippingTypeStorePickup / shippingType (PKShippingType)
    • PKShippingTypeServicePickup / shippingType (PKShippingType)
  • summary item, PKPaymentSummaryItem class
    • creating / Creating a summary item
    • +summaryItemWithLabel*amount* / +summaryItemWithLabel:amount:
    • +summaryItemWithLabel*amountTopicntype* / +summaryItemWithLabel:amount:type:
    • label (NSString*) component / label (NSString*)
    • amount (NSDecimalNumber*) / amount (NSDecimalNumber*)
    • type (PKPaymentSummaryItemType) / type (PKPaymentSummaryItemType)
  • summary items
    • specifying / Specifying summary items
    • computing, for shared method implementation / Implementing a shared method to compute summary items

U

  • Uniform Resource Identifier (URI) / Getting inventory information
  • user interactions
    • responding to, payment sheet used / Responding to user interactions with the payment sheet
  • user interactions, with payment sheet
    • shipping information, modifying / User changes shipping information
    • shipping method, modifying / User changes shipping method
    • payment request, authorizing / User authorizes payment request

W

  • web server
    • about / Configuring an order management server web app
  • web service / Getting information from an inventory service

X

  • Xcode project
    • Apple Pay, enabling / Enabling Apple Pay in your app's Xcode project