我试图通过php Curl (mycurl)使用PaySafe Rest API,但是我得到了错误。我的php代码:
$url="https://api.test.paysafe.com/cardpayments/v1/accounts/xxxxxxx/auths";// si erreur ajouter HTTP/1.1
$headers=array('content-type: application/json');
$call_api=new mycurl($url);
$call_api->useAuth(true);
$call_api->setName(" my username");
$call_api->setPass("my password");
$call_api->setHeaders($headers);
$curlopt_postfields=json_encode( array(
'merchantRefNum' => 'merchant ref',
'amount' => 10,
'settleWithAuth'=>true,
'card' => array(
'paymentToken' => 'my token key'
),
'billingDetails' => array(
'street' => '100 Queen Street West',
'city' => 'Toronto',
'state' => 'ON',
'country' => 'CA',
'zip' => 'M5H 2N2'
)
));
$call_api->setPost($curlopt_postfields);
$call_api->setJson();
$call_api->createCurl($url);
//result
$result_api_httpStatus=$call_api->getHttpStatus();
$result_api=$call_api->tostring();
if($result_api_httpStatus==200)
{
echo 'OK';
}
else {
//echo $result_api_httpStatus;
print_r($result_api);
}此过程在here中进行了解释
下面是返回的错误:
{"links":[{"rel":"self","href":"https:\/\/api.test.paysafe.com\/cardpayments\/v1\/accounts\/xxxxxx\/auths\/yyyyyyyyyy"}],"id":"yyyyyyyyyy","merchantRefNum":"merchant number","error":{"code":"1007","message":"Internal Error.","links":[{"rel":"errorinfo","href":"https:\/\/developer.paysafe.com\/en\/rest-api\/cards\/test-and-go-live\/card-errors\/#ErrorCode1007"}]},"settleWithAuth":true}“message”:“内部错误。”但我不知道为什么..。
我记得按照here的解释,我遵循了paysafe.js的标记化过程来生成令牌
请帮帮我
发布于 2018-08-04 01:25:30
解决了,我的帐户有一个问题,Paysafe支持解决了它。谢谢
https://stackoverflow.com/questions/51642692
复制相似问题