使用2Checkout 支持的 PHP 库,我无法使用他们提供的示例和我自己的凭据通过他们的 API 在他们的沙箱中进行退款。我究竟做错了什么?请注意,我可以在他们的沙箱中进行收费,但不能退款。
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
header('Content-Type: text/plain');
require_once('lib/Twocheckout.php');
$sChargeID = '4093729353592'; // my order ID
Twocheckout::username('USER'); // my username
Twocheckout::password('PASSWORD'); // my password
Twocheckout::sandbox(true);
Twocheckout::verifySSL(false);
$charge = Twocheckout_Sale::refund(array(
'sale_id' => $sChargeID,
'comment' => 'Customer decided the item did not meet expectations and it was within their refund period.',
'category' => 2 // did not like item
));
echo "\nRESPONSE = \n";
print_r($charge);
echo "\n";
当我转储 CURL 响应时,我看到:
{
"errors" : [
{
"code" : "FORBIDDEN",
"message" : "Access denied to API"
}
]
}