创建MasterCard标记化API

时间:2017-05-16 10:27:39

标签: api mastercard

我有一个包含万事达卡付款方式的移动应用。我有这个教程:

https://ap-gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/latest/api.html?locale=en_US

我想创建包含客户主要细节的标记化,我已经按照本教程的部分进行了编写:

https://ap-gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/latest/operation/Tokenization%3a Create or Update Token (with system-generated token).html?locale=en_US

我尝试过:

发布 https://ap-gateway.mastercard.com/api/rest/version/41/merchant/{{MyMerchantID}}/token

PARAMS:

{
"sourceOfFunds": {
"type": "CARD",
"provided": {
"card":{
"number": "5123450000000008",
"expiry": {
"month": "05",
"year": "17"
}
}
}

注意:该号码是万事达卡测试号码。

我总是得到这个错误:

error   
cause   "INVALID_REQUEST"
explanation "Invalid credentials."
result  "ERROR"

我在第二个网址中跟踪了参数。 有人可以帮忙吗? params是正确的还是我错过了什么?

2 个答案:

答案 0 :(得分:0)

在配置文件中,您需要设置以下内容:

$configArray["merchantId"] = "[merchantId]";

// API用户名,格式如下,其中商家ID与上述相同

$configArray["apiUsername"] = "merchant.[merchantId]";

//可在商家管理中配置的API密码

$configArray["password"] = "your api password";

在配置文件中设置上述参数将解决您的问题

答案 1 :(得分:0)

尝试用为您提供的真实网关替换“ ap-gateway”。测试网关不支持您的商人ID。