Tokenization

Save the payment card using a token

Introduction

Interested in making your customer pay faster? Okay, Tokenization is the solution for you. Tokenization is a feature that you can use through our API that will enable you to save your customer's credit card encrypted and hashed based on token communication.

With a simple call, you can request to save the credit card token, get the token back to your application, and associate it with your customer profile for future easier payment execution.

Moreover, MyFatoorah provides the Save Card Information feature that will do all the job for you.

❗️

Approval is Needed

Kindly, contact your account manager or sales representative to activate the Direct Payment and Tokenization features.


How it works

In the beginning, you need to create a new card token by using the DirectPayment endpoint and passing the PaymentType parameter with the value "card" and the SaveToken parameter with the value "true".

Note that, this request is a direct payment request. The payment process will go through, the invoice amount will be deducted from the client account, and the card token will be generated. The response body contains a Token parameter. This Token will be saved in your system with your customer profile to be used in any potential direct payment requests.

To create new payment requests using the card token, use the DirectPayment endpoint and pass the PaymentType parameter with the value "token" and the token parameter with the stored card token value.

For more security, you have to send the CVV (security code) in the request body with the token.

📘

Cancel Token

If the customer wants to change their card information, or their card information has been expired or stolen, you have the possibility to cancel a credit card token by using the CancelToken endpoint.

👍

Testing Tokenization

For the test purpose, you should use the PaymentMethodId parameter with value "20" in the request body of ExecutePayment endpoint.


Sample Messages

DirectPayment request with card token generation:

{
   "PaymentType":"card",
   "Bypass3DS":false,
   "SaveToken":true,
   "Card":{
      "Number":"5453010000095539",
      "ExpiryMonth":"05",
      "ExpiryYear":"21",
      "SecurityCode":"212",
      "HolderName":"fname lname"
   }
}
{
  "IsSuccess": true,
  "Message": null,
  "ValidationErrors": null,
  "Data": {
    "Status": "Success",
    "ErrorMessage": null,
    "PaymentId": "060666602253577763",
    "Token": "TOKEN316652",
    "RecurringId": null,
    "PaymentURL": "https://securepaymentstest.fsspaynet.com/ipayd/VPAS.htm?actionVPAS=VbvVEReqProcessHTTP&trandata=2D71384184321893BD4D3A3D78C83FBCAADB97D259F089CB6DCA9E397C40E6A203AA1AE6EB7511AA515F2FA63CA805CF6D98C35616FA73839C3E8696F1704AF81A21A208F21B868D5D7A7D63CB1A711F56A10FE8B714927D9446BBB7F18F5FA3709AEF6DD8EDB5B45642E7646408DF6EC6C7FA674F9E9C63A6EC360A3932DE8D2DFE8802E9FFD5B522EF16DE635BCCC6C7D9460BBCABC680535CAB703C922E2E8A6EED4061A2E310116E9776579185EA20784AD54111AEABAAAF7642925F3C17F04148ECEF45F2A83F8CA572D2EAFD31F7CD960AC1874FB8C19A11C7F18ED688D35144F46E886031B6B337617EFE74B6B4C3E9468D90B9C57B31A03E8DEC85F2FBD496FF87C0949A129302B0039993A60FCCC1E45197E4FF0E298A5BC56669940326FE7EFD40041721959E9BCC9BBBB9B72B64A1FBF56ECE302D5E9AA79BECC86D3AF29945927C95180CE9B35DA88A68B1D583366402773BAD4112C86E4057AE65F340FFF4CE5DD0AB1CF08C49EC51019E8CDC16D006BD25DCCC6E14698142E0A86F7075FA19406E5D7A7D63CB1A711F6A6A23E143E92694327E444B9869E6E1B1F71D88697EDD7E4528BF6941650AB025D9BADDF6ACCA6E427AEC0E0AAE2EBCFF185C9CEAEE4A70F3A638B15D56B2F5D092CD8C3DD1A962&errorURL=https://demo.MyFatoorah.com/En/KWT/PayInvoice/FssFail/09-06-2021_535777&responseURL=https://demo.MyFatoorah.com/En/KWT/PayInvoice/FssSuccess/09-06-2021_535777&tranportalId=E0208401",
    "CardInfo": null
  }
}

DirectPayment request using the card token:

{
   "PaymentType":"token",
   "Bypass3DS":false,
   "token":"TOKEN316652",
   "Card":{
      "SecurityCode":"212"
   }
}
{
  "IsSuccess": true,
  "Message": null,
  "ValidationErrors": null,
  "Data": {
    "Status": "Success",
    "ErrorMessage": null,
    "PaymentId": "060666602253578262",
    "Token": null,
    "RecurringId": null,
    "PaymentURL": "https://securepaymentstest.fsspaynet.com/ipayd/VPAS.htm?actionVPAS=VbvVEReqProcessHTTP&trandata=2D71384184321893BD4D3A3D78C83FBCAADB97D259F089CB6DCA9E397C40E6A203AA1AE6EB7511AA515F2FA63CA805CF6D98C35616FA73839C3E8696F1704AF81A21A208F21B868D5D7A7D63CB1A711F56A10FE8B714927D9446BBB7F18F5FA3709AEF6DD8EDB5B45642E7646408DF6EC6C7FA674F9E9C63A6EC360A3932DE8D2DFE8802E9FFD5B522EF16DE635BCCC6C7D9460BBCABC680535CAB703C922E2E8A6EED4061A2E310116E9776579185EA20784AD54111AEABAAAF7642925F3C17F04148ECEF45F2A83F8CA572D2EAFD31F7CD960AC1874FB8C19A11C7F18ED688D35144F46E886031B6B337617EFE74B658DFC4754E1F9D65C2630F577978DE58FBD496FF87C0949A129302B0039993A60FCCC1E45197E4FF0E298A5BC56669940326FE7EFD40041721959E9BCC9BBBB9B72B64A1FBF56ECE302D5E9AA79BECC86D3AF29945927C95180CE9B35DA88A68EDF5B2A44A67549BAD4112C86E4057AE65F340FFF4CE5DD0AB1CF08C49EC51019E8CDC16D006BD25DCCC6E14698142E0A86F7075FA19406E5D7A7D63CB1A711F6A6A23E143E92694327E444B9869E6E1B1F71D88697EDD7E4528BF6941650AB025D9BADDF6ACCA6E427AEC0E0AAE2EBCFF185C9CEAEE4A70F3A638B15D56B2F5D092CD8C3DD1A962&errorURL=https://demo.MyFatoorah.com/En/KWT/PayInvoice/FssFail/09-06-2021_535782&responseURL=https://demo.MyFatoorah.com/En/KWT/PayInvoice/FssSuccess/09-06-2021_535782&tranportalId=E0208401",
    "CardInfo": null
  }
}