我正在尝试Paypal订阅功能,但是我没有找到任何与多产品相关的演示或SDK。它只允许我一次插入一个产品信息。
不幸的是,我只能将所有信息和价格合并为一个产品。是否有关于这个问题的解决方案?
我正在尝试Paypal订阅功能,但是我没有找到任何与多产品相关的演示或SDK。它只允许我一次插入一个产品信息。
不幸的是,我只能将所有信息和价格合并为一个产品。是否有关于这个问题的解决方案?
<?php
$paypal = new DPayPal(); //Create an object
$requestParams = array(
'RETURNURL' => "http://yourwebsite.com", //Enter your webiste URL here
'CANCELURL' => "http://yourwebsite.com/payment/cancelled"//URL where user will be redirected if he/she cancel the payment
);
$item = array(
//Total order amount and currency
'PAYMENTREQUEST_0_AMT' => "155",//This has to be equal to sum of all items
'PAYMENTREQUEST_0_CURRENCYCODE' => 'GBP',
'PAYMENTREQUEST_0_ITEMAMT' => "155",//This has to be equal to sum of all items
//Item 1
'L_PAYMENTREQUEST_0_NAME0' => 'Item 1',
'L_PAYMENTREQUEST_0_DESC0' => 'Item 1 description',
'L_PAYMENTREQUEST_0_AMT0' => "55",
'L_PAYMENTREQUEST_0_QTY0' => '1',
//Item 2
'L_PAYMENTREQUEST_0_NAME1' => 'Item 2',
'L_PAYMENTREQUEST_0_DESC1' => 'Item 2 description',
'L_PAYMENTREQUEST_0_AMT1' => "100",
'L_PAYMENTREQUEST_0_QTY1' => '1',
);
//Call SetExpressCheckout
$response = $paypal->SetExpressCheckout($requestParams + $orderParams + $item);
if (is_array($response) && $response['ACK'] == 'Success') { //Request successful
//Now we have to redirect user to the PayPal
$token = $response['TOKEN'];
header('Location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . urlencode($token));
} else if (is_array($response) && $response['ACK'] == 'Failure') {
echo "Error";
exit;
}
CreateRecurringPaymentsProfile
。这是我正在使用的请求:string(506) "METHOD=CreateRecurringPaymentsProfile&VERSION=64&PWD={PWD}&USER={USER}&SIGNATURE={SIGNATURE}&TOKEN={TOKEN}=bluezeal+softnet&SHIPTOSTREET=kolkata&SHIPTOCITY=kolkata&SHIPTOSTATE=West+Bengal&SHIPTOZIP=700114&SHIPTOCOUNTRY=IN&PROFILESTARTDATE=2011-07-01T0%3A0%3A0&DESC=Test+Recurring+Payment%28%241+monthly%29&BILLINGPERIOD=Month&BILLINGFREQUENCY=5&AMT=1&CURRENCYCODE=USD&IPADDRESS=::1&BUTTONSOURCE=PP-ECWizard"
。 - user5217945