Integration Types
Altre funzionalità
Card Payments
Mobile Wallets
Alternative Payment Methods
Resources
Apple Pay è un servizio di pagamento e wallet digitale di Apple Inc. che consente di effettuare pagamenti con i dispositivi iOS e macOS supportati. Apple Pay è una delle modalità di pagamento tramite dispositivo supportate nel Mastercard Gateway.
In questa pagina vengono descritti i dettagli specifici dell'integrazione di Apple Pay, Si consiglia di leggere le Linee guida per l'integrazione per il pagamento tramite dispositivo prima di creare un'integrazione Apple Pay.
Per accettare pagamenti Apple Pay:
È possibile integrare Apple Pay nell'app mobile o sulla pagina di checkout del proprio sito Web utilizzando Direct Payment.
Se si desidera effettuare la decrittografia del token del pagamento sul proprio server, vedere Decrittografia del token di pagamento.
order.walletProvider
=APPLE_PAY
order.amount
: Il valore specificato deve essere l'importo totale dell'ordine (inclusi i costi di spedizione e altri costi aggiuntivi)order.currency
sourceOfFunds.provided.card.devicePayment.paymentToken
: Il token di pagamento crittografato ottenuto dall'SDK Apple Pay. Ad esempio, il valore in PKPaymentToken.paymentData
sourceOfFunds.provided.card.devicePayment.paymentToken [REST][NVP]
Oltra ai campi standard, affinché l'autorizzazione sia eseguita correttamente, vengono restituiti i campi di risposta indicati di seguito utilizzando il token di pagamento.
sourceOfFunds.provided.card.encryption
=DEVICE
sourceOfFunds.provided.card.deviceSpecificNumber
: Il DPAN nel formato di oscuramento.sourceOfFunds.provided.card.deviceSpecificExpiry.month
sourceOfFunds.provided.card.deviceSpecificExpiry.year
sourceOfFunds.provided.card.number
: Il FPAN nel formato di oscuramento.sourceOfFunds.provided.card.expiry.month
: Il mese di scadenza della carta.sourceOfFunds.provided.card.expiry.year
: L'anno di scadenza della carta.sourceOfFunds.provided.card.devicePayment.cryptogramFormat
Di seguito è riportata una richiesta di autorizzazione di esempio in REST in cui il token di pagamento è decrittato dal gateway.
URL | https://eu-gateway.mastercard.com/api/rest/version/72/merchant/{merchantId}/order/{orderid}/transaction/{transactionid} |
Metodo HTTP | PUT |
{ "apiOperation": "AUTHORIZE", "order": { "currency": "EUR", "amount": "61.00", "walletProvider": "APPLE_PAY" }, "sourceOfFunds": { "type": "CARD", "provided":{ "card":{ "devicePayment":{ "paymentToken":"{\r\n\t\"version\": \"EC_v1\",\r\n\t\"data\":\"WO\/fTbdARsB1Rg3tS4ISwNG4cWDRk3JZDSbP32iDdeMP7UFouS...\", \r\n\t\"signature\": \"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkg...\", \r\n\t\"header\": {\r\n\t\t\"transactionId\": \"c162557e7ae1c69a47583bc2364d1a3e531428d13fb664032f9e09fa37381fc1\", \r\n\t\t\"ephemeralPublicKey\": \"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEMeuRqVEOZAQ...\", \r\n\t\t\"publicKeyHash\": \"tBGp1mEoHLiHwfOkazpKVbf3cMKmVS98PGufUJ2Q3ys=\"\r\n\t}\r\n}" //This is only a sample token and will not pass validation. You should substitute this with an actual payment token returned from Apple Pay (PKPaymentToken.paymentData). //The gateway considers this value to be a string, NOT JSON itself. The parenthesis are a part of the string. } } } }, "transaction": { "source": "INTERNET" } }
{ "authorizationResponse": { "date": "0327", "posData": "1025104006600", "posEntryMode": "812", "processingCode": "003000", "responseCode": "49", "stan": "297295", "time": "235040" }, "gatewayEntryPoint": "WEB_SERVICES_API", "merchant": "TEST_MERCHANT", "order": { "amount": 30.1, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "certainty": "ESTIMATED", "chargeback": { "amount": 0, "currency": "EUR" }, "creationTime": "2022-03-27T23:50:40.162Z", "currency": "EUR", "id": "01", "lastUpdatedTime": "2022-03-27T23:50:40.650Z", "merchantAmount": 100, "merchantCategoryCode": "1234", "merchantCurrency": "EUR", "status": "AUTHORIZED", "totalAuthorizedAmount": 30.1, "totalCapturedAmount": 0, "totalDisbursedAmount": 0, "totalRefundedAmount": 0, "walletProvider": "APPLE_PAY" }, "response": { "acquirerCode": "00", "acquirerMessage": "Approved", "gatewayCode": "APPROVED" }, "result": "SUCCESS", "sourceOfFunds": { "provided": { "card": { "brand": "MASTERCARD", "devicePayment": { "cryptogramFormat": "3DSECURE" }, "deviceSpecificExpiry": { "month": "9", "year": "22" }, "deviceSpecificNumber": "520424xxxxxx6937", "encryption": "DEVICE", "fundingMethod": "UNKNOWN", "number": "xxxxxxxxxxxxxxxx", "scheme": "MASTERCARD", "storedOnFile": "NOT_STORED" } }, "type": "CARD" }, "timeOfLastUpdate": "2022-03-27T23:50:40.650Z", "timeOfRecord": "2022-03-27T23:50:40.282Z", "transaction": { "acquirer": { "id": "TESTACQUIRER", "merchantId": "123463" }, "amount": 30.1, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "currency": "EUR", "id": "1", "receipt": "208623297295", "source": "INTERNET", "stan": "297295", "terminal": "12333", "type": "AUTHORIZATION" }, "version": "64" }
Si può scegliere di effettuare la decrittografia del token di pagamento sul proprio server invece di fornire al gateway il token di pagamento per la decrittografia. In tal caso, si dovrà provvedere a conservare le credenziali per la decrittografia ed effettuarla.
Chiave JSON Apple Pay |
Campo richiesta API corrispondente |
Descrizione |
---|---|---|
applicationPrimaryAccountNumber | sourceOfFunds.provided.card.number | Il numero del conto principale del dispositivo (ad esempio, token o DPAN) della carta utilizzata per questa transazione. |
applicationExpirationDate | sourceOfFunds.provided.card.expiry.month sourceOfFunds.provided.card.expiry.year |
La data di scadenza di applicationPrimaryAccountNumber. |
cardholderName | sourceOfFunds.provided.card.nameOnCard | (Facoltativo) Il nome del titolare della carta. |
currencyCode | order.currency | Il codice valuta ISO 4217 per la transazione. |
transactionAmount | order.amount | L'importo dell'ordine. |
paymentDataType | sourceOfFunds.provided.card. devicePayment.cryptogramFormat |
Il formato del crittogramma. Impostarlo su 3DSECURE. |
onlinePaymentCryptogram | sourceOfFunds.provided.card.devicePayment. 3DSecure.onlinePaymentCryptogram |
Crittogramma in formato 3-D Secure. |
eciIndicator | sourceOfFunds.provided.card.devicePayment. 3DSecure.eciIndicator |
Immettere l'indicatore transazione di e-commerce (ECI), se disponibile. |
PAYER_TERMINAL_OFF_PREMISES
o PAYER_TERMINAL_ON_PREMISES
. Se non si specifica un valore, sarà utilizzato PAYER_TERMINAL_OFF_PREMISES
.Di seguito è riportata una richiesta di autorizzazione di esempio in REST in cui i valori ottenuti dal token di pagamento decrittato sono forniti al gateway.
{ "apiOperation": "AUTHORIZE", "order": { "amount": "30.10", "currency": "USD", "walletProvider":"APPLE_PAY" }, "sourceOfFunds": { "provided": { "card": { "expiry": { "month": "01", "year": "39" }, "number": "5123450000000008", "devicePayment":{ "cryptogramFormat":"3DSECURE", "3DSecure":{ "onlinePaymentCryptogram":"IA/8pdiWftSsxpFT6wABoDABhgA=", "eciIndicator":"20" } } } }, "type": "CARD" }, "device": { "ani":"12341234" }, "transaction": { "source": "INTERNET" } }
{ "authorizationResponse": { "commercialCard": "123", "commercialCardIndicator": "1", "date": "0329", "financialNetworkCode": "MCC", "posData": "1025104006600", "posEntryMode": "812", "processingCode": "003000", "responseCode": "00", "stan": "287916", "time": "005723", "transactionIdentifier": "260113124", "transactionIntegrityClass": "A1" }, "device": { "ani": "12341234" }, "gatewayEntryPoint": "WEB_SERVICES_API", "merchant": "TEST_MERCHANT", "order": { "amount": 30.1, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "certainty": "ESTIMATED", "chargeback": { "amount": 0, "currency": "USD" }, "creationTime": "2022-03-29T00:57:22.553Z", "currency": "USD", "id": "C999903", "lastUpdatedTime": "2022-03-29T00:57:23.813Z", "merchantAmount": 30.1, "merchantCategoryCode": "1234", "merchantCurrency": "USD", "status": "AUTHORIZED", "totalAuthorizedAmount": 30.1, "totalCapturedAmount": 0, "totalDisbursedAmount": 0, "totalRefundedAmount": 0, "walletProvider": "APPLE_PAY" }, "response": { "acquirerCode": "00", "acquirerMessage": "Approved", "gatewayCode": "APPROVED" }, "result": "SUCCESS", "sourceOfFunds": { "provided": { "card": { "brand": "MASTERCARD", "devicePayment": { "cryptogramFormat": "3DSECURE" }, "deviceSpecificExpiry": { "month": "1", "year": "39" }, "deviceSpecificNumber": "512345xxxxxx0008", "fundingMethod": "UNKNOWN", "number": "xxxxxxxxxxxxxxxx", "scheme": "MASTERCARD", "storedOnFile": "NOT_STORED" } }, "type": "CARD" }, "timeOfLastUpdate": "2022-03-29T00:57:23.813Z", "timeOfRecord": "2022-03-29T00:57:22.675Z", "transaction": { "acquirer": { "batch": 20220329, "date": "0329", "id": "TESTACQUIRER", "merchantId": "123463", "transactionId": "260113124" }, "amount": 30.1, "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT", "authorizationCode": "112233", "currency": "USD", "id": "1", "receipt": "208800287916", "source": "INTERNET", "stan": "287916", "terminal": "12333", "type": "AUTHORIZATION" }, "version": "64" }
È possibile verificare l'integrazione con il gateway in fase di produzione utilizzando il profilo esercente di prova e un FPAN supportato fornito da Apple per l'ambiente di test.
È necessario configurare la propria app per utilizzare l'ambiente di test di Apple Pay con il proprio profilo esercente di prova del gateway. Quando il pagante seleziona una carta in Apple Pay, l'app genera un token di pagamento in modalità di prova.
Se si sta effettuando la decrittografia del token di pagamento, utilizzare il DPAN del token decrittato per effettuare transazioni di prova.
Se il gateway effettua la decrittografia del token di pagamento, è necessario procurarsi un certificate firmato da Apple e caricarlo sul gateway tramite Merchant Administration nella fase di produzione utilizzando il proprio profilo esercente di prova del gateway. Il gateway utilizza il certificato per effettuare la decrittografia del token di pagamento.
Se lo stato delle transazioni è APPROVED o DECLINED significa che il gateway è stato in grado di elaborare correttamente le transazioni di prova.
Mobile SDK offre assistenza per lo sviluppo di un'applicazione mobile (app) che accetterà pagamenti digitali tramite il Mastercard Gateway. Il gateway offre supporto per Apple Pay tramite Mobile SDK. Fare clic qui per le linee guida per l'integrazione di Mobile SDK per la piattaforma iOS.