I want to make tokenization , check mpgs documentation from here
- The idea is that I want to have a token that I can use with all purchases
- First step i have successfully make purchase using hosted checkout way , as you know , the hosted check out page is hosted on mastercard , not my server, so i can not be able to see the card details like number or cvv or expire date.
- So , I check out the documentation to generate token , i found this api :
POST: https://test-gateway.mastercard.com/api/rest/version/59/merchant/{{merchantId}}/token
Here is the documentation fot it
- I want to get token without know the card details(card number..or cvv...) , but this api request it requires to send card details to get the token:
For example: POST: https://test-gateway.mastercard.com/api/rest/version/59/merchant/999000999/token
Body As Row :
{
"sourceOfFunds": {
"provided": {
"card": {
"expiry": {
"month": "05",
"year": "21"
},
"number": "5123456789012346"
}
},
"type": "CARD"
}
}
And the Response :
{
"repositoryId": "REP999000999",
"response": {
"gatewayCode": "NO_VERIFICATION_PERFORMED"
},
"result": "SUCCESS",
"sourceOfFunds": {
"provided": {
"card": {
"brand": "MASTERCARD",
"expiry": "0521",
"fundingMethod": "CREDIT",
"number": "512345xxxxxx2346",
"scheme": "MASTERCARD"
}
},
"type": "CARD"
},
"status": "VALID",
"token": "9116324659162248",
"usage": {
"lastUpdated": "2021-04-24T08:17:18.383Z",
"lastUpdatedBy": "999000999",
"lastUsed": "2021-04-24T08:17:18.410Z"
},
"verificationStrategy": "NONE"
}
As you see from the response , i get on "token": "9116324659162248" , But what i need is to get that token but without send card details , i want to do that to avoid PCI Compline ,(My bank told me that)
Is there a way to tokenize without send card payments?
I found the solution after a lot of trouble,you can tokenize card details using these steps:
1- First, you should ask you bank to enable the tokenization for your merchant account
2- Visit this page and read the documentation from mpgs gateway
3- After the payment process is completely finished using hosted checkout ,the sessionId should be return, so store it,then execute this api :