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

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

问题描述

我已经使用 paypal_helper 将 paypal 集成到 codeigniter 中(不记得我在哪里找到它了,但它是 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".

在 Sandbox 和 Live 中,paypal 网站上都没有显示金额...

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

可能有什么问题?

编辑,进一步解释我的过程.我使用它,主要是在 https://www.paypal-labs 中指定的.com/integrationwizard/ecpaypal/cart.php.没有表格这应该可行吗?在调用函数 CallShortcutExpressCheckout? 时,paymentAmount 可以作为标准变量发送:

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;
}

令牌保存在数据库中.用户被重定向到 Paypal,其中未列出任何金额.

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天全站免登陆