我无法使用 neteller API
I am unable to use neteller API
$accessToken = $this->_netellerAccess();
$data_string = '{
"paymentMethod": {
"type": "neteller",
"value": "ashutosh12@avainfotech.com"
},
"transaction": {
"merchantRefId": "26434256",
"amount": 10,
"currency": "USD"
},
"verificationCode": "234124"
}';
$token=$accessToken['accessToken'];
$ch = curl_init('https://api.neteller.com/v1/transferOut');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
"Authorization: Bearer $token"
)
);
echo $result = curl_exec($ch);
{ "error": { "code": "20005", "message": "Duplicate transaction reference" } }
我总是得到像 20005..
这样的错误
该错误意味着您已经使用此'merchantRefId'创建了一个交易。
'merchantRefId' 字段应包含您进行的每笔交易的唯一值。
"merchantRefId": "26434256"
只需将其更改为另一个随机值
$accessToken = $this->_netellerAccess();
$data_string = '{
"paymentMethod": {
"type": "neteller",
"value": "ashutosh12@avainfotech.com"
},
"transaction": {
"merchantRefId": "26434256",
"amount": 10,
"currency": "USD"
},
"verificationCode": "234124"
}';
$token=$accessToken['accessToken'];
$ch = curl_init('https://api.neteller.com/v1/transferOut');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
"Authorization: Bearer $token"
)
);
echo $result = curl_exec($ch);
{ "error": { "code": "20005", "message": "Duplicate transaction reference" } } 我总是得到像 20005..
这样的错误该错误意味着您已经使用此'merchantRefId'创建了一个交易。
'merchantRefId' 字段应包含您进行的每笔交易的唯一值。
"merchantRefId": "26434256"
只需将其更改为另一个随机值