PayPal Express Checkout中缺少金额和订单摘要 [英] Missing amount and order summary in PayPal Express Checkout

查看:153
本文介绍了PayPal Express Checkout中缺少金额和订单摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将paypal集成到codeigniter与paypal_helper(没有rememeber在哪里,我发现它,但它是一个稍微重写版本的Paypals原始代码快速检出。我尝试调用此函数,

I have integrated paypal into codeigniter with paypal_helper (didn't rememeber where I found it, but it is a slightly rewritten version of Paypals original code for express checkout. I try calling this function,


CallShortcutExpressCheckout($ paymentAmount,$ currencyCodeType,
$ paymentType,$ returnURL,$ cancelURL)

CallShortcutExpressCheckout( $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL)

将$ paymentAmount作为int发送,将$ currencyCodeType作为NOK,将$ paymentType作为Sale发送。

sending $paymentAmount as int, $currencyCodeType as "NOK" and $paymentType as "Sale".

金额出现在paypal网站上...

Both in Sandbox and live, no amount appears on the paypal site...

可能出错?

我使用这个,主要是在 https://www.paypal-labs.com/integrationwizard中指定的/ecpaypal/cart.php 。这应该没有形式吗?paymentAmount可以作为标准变量发送,当调用函数CallShortcutExpressCheckout?:

Edit, to further explain my process. I use this, mostly as specified in the https://www.paypal-labs.com/integrationwizard/ecpaypal/cart.php. This should be doable without the form? The paymentAmount could be sent as a standard variable, when calling the function CallShortcutExpressCheckout?:

$resArray = CallShortcutExpressCheckout ($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL);
$ack = strtoupper($resArray["ACK"]);
if($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
{
    RedirectToPayPal ( $resArray["TOKEN"] );
} 
else  
{
    //Display a user friendly Error on the page using any of the following error information returned by PayPal
    $ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
    $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
    $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
    $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);

    echo "SetExpressCheckout API call failed. ";
    echo "Detailed Error Message: " . $ErrorLongMsg;
    echo "Short Error Message: " . $ErrorShortMsg;
    echo "Error Code: " . $ErrorCode;
    echo "Error Severity Code: " . $ErrorSeverityCode;
}

令牌保存在数据库中。

The token is saved in a database. The user gets redirected to Paypal, where no amount is listed.

推荐答案

由于您没有传递所谓的订单项详细信息'(产品数据),PayPal不显示总金额。

As you're not passing so called 'line item details' (product data), PayPal doesn't display the total amount.

如果您只想显示目前购买的金额,请将买家重新导向至 https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-xxxxxx&useraction=commit (而不是 https://www.paypal.com) / cgi-bin / webscr?cmd = _express-checkout& token = EC-xxxxx

If you only want to show the amount for the current purchase, redirect buyers to https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-xxxxxx&useraction=commit (instead of https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-xxxxx)

如果您要开始向PayPal发送订单项详细信息,请在 SetExpressCheckout API请求中包含以下内容:

If you want to start sending line-item details to PayPal, include the following in your SetExpressCheckout API request:

// 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 中。

If you want to see this in your own history as well, you'll also need to include this in DoExpressCheckoutPayment.

这也发布在 php paypal快速结帐问题

这篇关于PayPal Express Checkout中缺少金额和订单摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆