Search Overlay

Intégrer l’API REST de Paysafe

Remarque : En tant que partenaire ISV/Paysafe, vous devrez effectuer toutes les étapes « marchand » ci-dessous au nom de l’entité juridique mère des marchands (PMLE) sous laquelle vos marchands exerceront leurs activités.

Une fois que vous avez réussi à intégrer l’API Apple Pay JS ou la SDK Requête de Paysafe, vous pouvez terminer votre intégration avec nos API REST pour traiter les transactions Apple Pay.

Vous avez besoin de vos deux clés API – la clé API pour le jeton à usage unique et la clé API Cartes.

Effectuez la séquence suivante d’appels API une fois que vous avez obtenu le contenu de la session Apple Pay :

  1. Obtenez un jeton à usage unique en utilisant l’offre de paiement Apple Pay

Si vous avez intégré la SDK Requête de Paysafe, vous disposez déjà du jeton à usage unique Paysafe. Il n’est pas nécessaire d’appeler ce point d’extrémité.

POST /customervault/v1/applepaysingleusetokens

Utilisez la clé API pour jeton à usage unique.

{

"applePayPaymentToken": {
"billingContact": {
"addressLines": [
"2600 Michelson Drive"
],
"administrativeArea": "",
"country": "USA",
"countryCode": "US",
"familyName": "John",
"givenName": "Doe",
"locality": "Maidstone",
"phoneticFamilyName": "",
"phoneticGivenName": "",
"postalCode": "92612",
"subAdministrativeArea": "",
"subLocality": ""
},
"token": {
"paymentData": {
"data": "OkO7zP3FscP5WZZYSNTMWfQIAyLo1fxdUDS2Of7iRmmCGhkkiuTTgmCKw7eFaKZr6Flbgvx+nai1uVgNo7SS40dKtUqb2PdTheO1X8FpiN+vRWfLm4UnwHn9j2hpCKaEL2u8dAFaDju4Kr4L40XDEi5crM7ilmDCerhlXfFGd3OqoafhkiMFM7/c6O9+bok8c1OCK/BMIAfPEx4W/24myV6ulCUdkjs5RnETl2W8oFC6q9FoZbbfFnnvL1P1XOLux/Ii9F3Md8OaaKw0y8q1tcQDbb8sqfPuDOardlCajUYdZMnHAyJR7ZXJuj5ZhKMXnfPL7oConSqCUp0zJQfP/X3G3KDJSOpEnsBUnJgJzsjrX5uG3xnCHfNBRRLYZkwNgDn4VBwz0ICFYp2fi0lCdzbDlwpt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852cc50d30107c5d71fb3e79761013b32d11ae71a549656b07"
},
"version": "EC_v1"
},
"paymentMethod": {
"displayName": "Visa 0224",
"network": "Visa",
"type": "debit"
},
"transactionIdentifier": "8A0816DAA70415852CC50D30107C5D71FB3E79761013B32D11AE71A549656B07"
}
}

}

{

"id": "16b446d5-9756-4291-812f-c17f3355b501",
"paymentToken": "AyZHBRLp2ShIb8u",
"timeToLiveSeconds": 899,
"transaction": {
"amount": 60,
"currencyCode": "CAD"
},
"applePayPaymentToken": {
"billingContact": {
"addressLines": [
"2600 Michelson Drive"
],
"administrativeArea": "",
"countryCode": "US",
"locality": "Maidstone",
"postalCode": "92612"
},
"token": {
"paymentData": {
"header": {
"transactionId": "8a0816daa70415852cc50d30107c5d71fb3e79761013b32d11ae71a549656b07",
"publicKeyHash": "QHqFFKFBhq/xDNX2lwwRsGz7NbogFjxDGGsASq5MvUM="
},
"signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID5DCCA4ugAwIBAgIIWdihvKr0480wCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTIxMDQyMDE5MzcwMFoXDTI2MDQxOTE5MzY1OVowYjEoMCYGA1UEAwwfZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtU0FOREJPWDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgjD9q8Oc914gLFDZm0US5jfiqQHdbLPgsc1LUmeY+M9OvegaJajCHkwz3c6OKpbC9q+hkwNFxOh6RCbOlRsSlaOCAhEwgg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hkiG9w0BCTQxHTAbMA0GCWCGSAFlAwQCAQUAoQoGCCqGSM49BAMCMC8GCSqGSIb3DQEJBDEiBCB/lE+I3WEwZf7HEMLwH7Qse/i0wYL/PZkjfAmeLVBGZTAKBggqhkjOPQQDAgRHMEUCIQDBK2e7R7Zr4sxWxvUhKQiildc2yeOtyGlHozDJ2ID7sgIgfSB6/4VjsfXjzlCJqsNAQFlLv0S3PdpOuI2yAXYbT+oAAAAAAAA=",
"version": "EC_v1"
},
"paymentMethod": {
"displayName": "Visa 0224",
"network": "Visa",
"type": "debit"
}
}
},
"card": {
"status": "ACTIVE",
"lastDigits": "3471",
"cardCategory": "PREPAID"
}

}
  1. Appelez l’API Paiements par carte à l’aide du jeton à usage unique pour traiter la transaction.

Depuis votre serveur, utilisez le jeton à usage unique (paymentToken) pour effectuer une requête d’autorisation ou d’achat auprès de notre API Paiements par carte.

Utilisez la clé de l’API Cartes

Appelez le point de terminaison suivant à partir de votre serveur pour encaisser le paiement :

POST /cardpayments/v1/accounts/account_id/auths

curl -X POST https://api.test.paysafe.com/cardpayments/v1/accounts/1001087580/auths \
-u devcentre322:B-qa2-0-53625f86-302c021476f52bdc9deab7aea876bb28762e62f92fc6712d0214736abf501e9675e55940e83ef77f5c304edc7968 \
-H ’Content-Type: application/json’ \
-d ’ {
"merchantRefNum" : "payment-token-demo-1",
"amount" : 500,
"settleWithAuth":true,
"card" : {
"paymentToken" : "CaBP0abDKgROjYU"
},
"billingDetails": {
"street":"100 Queen Street West",
"city":"Toronto",
"state":"ON",
"country" : "CA","country":"CA",
"zip":"M5H 2N2"
}
} ’

{

"links": [
{
"rel": "settlement",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1001087580/settlements/25c5a148-c5aa-4157-8318-c91961e1128e"
},
{
"rel": "self",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1001087580/auths/25c5a148-c5aa-4157-8318-c91961e1128e"
}
],
"id": "25c5a148-c5aa-4157-8318-c91961e1128e",
"merchantRefNum": "payment-token-demo-1",
"txnTime": "2017-03-06T20:42:06Z",
"status": "COMPLETED",
"amount": 520,
"settleWithAuth": true,
"preAuth": false,
"availableToSettle": 0,
"card": {
"type": "VI",
"lastDigits": "2345",
"cardExpiry": {
"month": 2,
"year": 2020
}
},
"authCode": "100614",
"billingDetails": {
"street": "100 Queen Street West",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zip": "M5H2N2"
},
"merchantDescriptor": {
"dynamicDescriptor": "DD Line 1",
"phone": "000-111000099"
},
"currencyCode": "GBP",
"avsResponse": "MATCH",
"cvvVerification": "NOT_PROCESSED",
"settlements": [
{
"links": [
{
"rel": "self",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1001087580/settlements/25c5a148-c5aa-4157-8318-c91961e1128e"
}
],
"id": "25c5a148-c5aa-4157-8318-c91961e1128e",
"merchantRefNum": "payment-token-demo-1",
"txnTime": "2017-03-06T20:42:06Z",
"status": "PENDING",
"amount": 520,
"availableToRefund": 520
}
]

}
  1. Envoyez au site Web la réponse que votre serveur reçoit de l’API Paiements par carte.

    L’API Paiements par carte renvoie une réponse (succès ou échec) à votre serveur, que vous devez renvoyer à votre site Web.

Sur cette page