使用 2 次结帐进行定期付款,令牌已成功生成,但在收取费用时出现错误“无法处理请求”,这是代码。谁能帮我解决问题。
include(APPPATH.'third_party/two_checkout/Twocheckout.php');
if(isset($_POST['token']) && $_POST['token']!="")
{
$token=$_POST['token'];
Twocheckout::privateKey('503CF97F-46DA-4E55-8235-4D006C065624');
Twocheckout::sellerId('901284807');
Twocheckout::sandbox(true); #Uncomment to use Sandbox
try {
$charge = Twocheckout_Charge::auth(array(
"merchantOrderId" => "123",
"token" => $token,
"currency" => 'USD',
/*"total" => '10.00',*/
/*"recurrence" => "1 Month",*/
"billingAddr" => array(
"name" => 'Testing Tester',
"addrLine1" => '123 Test St',
"city" => 'Columbus',
"state" => 'OH',
"zipCode" => '43123',
"country" => 'USA',
"email" => 'testingtester@2co.com',
"phoneNumber" => '555-555-5555'
),
"shippingAddr" => array(
"name" => 'Testing Tester',
"addrLine1" => '123 Test St',
"city" => 'Columbus',
"state" => 'OH',
"zipCode" => '43123',
"country" => 'USA',
"email" => 'testingtester@2co.com',
"phoneNumber" => '555-555-5555'
),
"lineItems" => array(
"type" => "product",
"name" => "Gold",
"quantity" => "1",
"price" => "10.00",
"tangible" => "N",
"productId" => "GLD",
"recurrence" => "1 Month",
"duration" => "1 Year",
"startupFee" => "0"
)
), 'array');
if ($charge['response']['responseCode'] == 'APPROVED') {
echo "Thanks for your Order!";
}
} catch (Twocheckout_Error $e) {
echo $e->getMessage();
}
}