Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing amount and order summary in PayPal Express Checkout

Tags:

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)

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

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

What could be wrong?

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.

like image 766
Øyvind Avatar asked Nov 21 '11 00:11

Øyvind


People also ask

Is PayPal Express checkout deprecated?

PayPal has deprecated PayPal Express payment. Existing forms with PayPal Express will still work, but we highly recommend switching to/using our newest PayPal integrations, such as the following: Paypal Checkout. Paypal Business.

How do I check my PayPal Express checkout?

You can switch the «Paypal Express Checkout» payment method to the sandbox (test) mode on the PayPal module settings backend section: Create a PayPal sandbox account adn get credentials for it.

Is PayPal Express checkout free?

PayPal Express Checkout is a solution offered alongside PayPal Checkout. With this option, PayPal will charge you the same fees as the standard checkout solution (3.49 percent plus 49 cents per transaction), but your customers receive an upgraded experience.


1 Answers

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

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)

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   

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

This was also posted in php paypal express checkout problem

like image 158
Robert Avatar answered Sep 28 '22 04:09

Robert