我正在尝试在我的网站上集成贝宝快速结帐。我试图使用沙箱进行检查。当我从我的网站提交数据时,生成的令牌没有错误,但当重定向到 PayPal 时,它不显示付款金额。
顺便说一句,我正在使用贝宝快速结帐向导中的代码。如果有人指出我正确的方向,那将会很有帮助。
require_once ("paypalfunctions.php");
$paymentAmount = 15;
$currencyCodeType = "GBP";
$paymentType = "Sale";
$returnURL = "http://www.mysite.com/paypal/confirm.php";
$cancelURL = "http://www.mysite.com/paypal/index.php";
$resArray = CallShortcutExpressCheckout ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL);
$ack = strtoupper($resArray["ACK"]);
if($ack=="SUCCESS")
{
RedirectToPayPal ( $resArray["TOKEN"] );
}
由于您没有传递所谓的“订单项详细信息”(产品数据),PayPal 不会显示总金额。
如果您只想显示当前购买的金额,请将买家重定向到(代替)
如果您想开始向 PayPal 发送订单项详细信息,请在您的SetExpressCheckout
API请求:
// Total amount of the purchase, incl shipping, tax, etc
PAYMENTREQUEST_0_AMT=300.0
// Total amount of items purchased, excl shipping, tax, etc
PAYMENTREQUEST_0_ITEMAMT=300.0
// Authorize the funds first (Authorization), or capture immediately (Sale)?
PAYMENTREQUEST_0_PAYMENTACTION=Sale
// First item
L_PAYMENTREQUEST_0_NAME0=Item1
L_PAYMENTREQUEST_0_QTY0=1
L_PAYMENTREQUEST_0_AMT0=100.00
// Second item
L_PAYMENTREQUEST_0_NAME1=Item2
L_PAYMENTREQUEST_0_QTY1=1
L_PAYMENTREQUEST_0_AMT1=200.00
如果您也想在自己的历史记录中看到这一点,您还需要将其包含在DoExpressCheckoutPayment
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)