I'm trying to update a session with card info.
I'm following this guide:
In the section "Update session", it says:
You can request to add or update request fields contained in the session.
Using Postman, i set the
Authorization: Basic Auth as 'merchant.{your gateway merchant ID}' in the username portion and your API password in the password portion.
Url:"https://ap-gateway.mastercard.com/api/rest/version/51/merchant/{merchantId}/session/{sessionId}"
Method: PUT
Body: "raw" as JSON, like so:
{
"sourceOfFunds":{
"provided":{
"card":{
"nameOnCard":"Joseph",
"number":"5506900140100305",
"securityCode":"100",
"expiry":{
"month": "05",
"year": "21"
}
}
}
}
}
Issue: Getting the response.
{
"error": {
"cause": "INVALID_REQUEST",
"explanation": "Directly providing cardholder data is not supported. Consider using a session or token."
},
"result": "ERROR"
}
How I have obtained the Session id.!
I have followed this guide:
Using Postman, i set the
Authorization: Basic Auth as 'merchant.{your gateway merchant ID}' in the username portion and your API password in the password portion.
Url:"https://ap-gateway.mastercard.com/api/rest/version/51/merchant/{merchantId}/session"
Method: POST
Body: "raw" as JSON, like so:
{
"apiOperation": "CREATE_CHECKOUT_SESSION",
"order": {
"currency": "USD",
"id": "2000",
"amount": 5
}
}
Success: Getting the response.
{
"merchant": "merchantId",
"result": "SUCCESS",
"session": {
"id": "SESSION0002210064458I18884862F9",
"updateStatus": "SUCCESS",
"version": "f531053101"
},
"successIndicator": "4c47702b70cb4f16"
}
The session id i have received in above request has been passed to update session request.
I expected the updated session with card information but getting the error: "Directly providing cardholder data is not supported. Consider using a session or token."