Can anyone explain to me how ApplePay works ?
I have gone through some blogs but I am still unclear about the payment flow.
Questions:
How card is added.
How Transaction process works.
Can anyone explain to me how ApplePay works ?
I have gone through some blogs but I am still unclear about the payment flow.
Questions:
How card is added.
How Transaction process works.
This is how apple pay works.
Step 1: Adding a card.
Step 2: Payment using contactless terminal.
Step 3: Final Transection from contactless terminal.
You can check this link.
InApp ApplePay
Just high level diagrams
Who is who:
Card - card with PAN, Cardholder name, expiration date, CVV/CVC
Cardholder - buyer, person who is an owner of a card
Merchant - seller
Issuer - Bank which supports the Cardholder
Acquirer - Bank which supports the Merchant
Payment Network - linker of Acquirer and Issuer, e.g. Visa, MasterCard, AmericanExpress...
Cardholder add a Card to Wallet App:
Cardholder buy something in an app:
Some abbreviation:
PKPayment structure:
PKPayment - Apple Payment Payload
token: PKPaymentToken - Apple Payment Token
paymentMethod: PKPaymentMethod
displayName: String
network: PKPaymentNetwork - Payment Network(visa, masterCard, amex...)
type: PKPaymentMethodType - (debit, credit, prepaid...)
paymentPass: PKPaymentPass
paymentData: Data
signature - deatached signature of version == EC_v1(ephemeralPublicKey, data, transactionId, applicationData), version == RSA_v1(wrappedKey, data, transactionId, applicationData) in PKCS7 to verify
data - Encrypted Payment Data(EPD)
applicationPrimaryAccountNumber - DAN
applicationExpirationDate - Card expiration date
currencyCode - Currency Code
transactionAmount - Amount
cardholderName - Cardholder Name
deviceManufacturerIdentifier
paymentDataType - "3DSecure" or "EMV"
paymentData
//paymentDataType == 3D Secure
onlinePaymentCryptogram - SE Cryptogram
eciIndicator
//paymentDataType == EMV
emvData
encryptedPINData
authenticationResponses
merchantIdentifier
authenticationData
transactionAmount
merchantTokenIdentifier - TSP token
merchantTokenMetadata
version - Apple Pay servers encrypted the payment token(data)
EC_v1 - ECC
RSA_v1 - RSA
header
transactionId - Transaction Id
applicationData - SHA–256 hash which was swnd in PKPaymentRequest.applicationData
publicKeyHash - SHA–256 hash of Merchant public key
//version == EC_v1
ephemeralPublicKey - Ephemeral public key bytes
//version == RSA_v1
wrappedKey - Symmetric Key which is decrypted by Merchant public key
billingAddress
billingContact
shippingContact
shippingAddress
shippingMethod
Verify the Signature:
PKPayment.PKPaymentToken.Data.signature
is detached PKCS #7 signature[About] with Intermediate and End-user chain certificates[About]
Restore the Symmetric Key:
//version == EC_v1
Side Apple:
Side Merchant:
Merchant computes shared secret key = Merchant private key AND ephemeral public key
KDF(shared secret key, MerchantId) => Symmetric Key
Decrypt the Payment Data by Symmetric Key