Missing amount and order summary in PayPal Express Checkout
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
After an extensive reading on messy Paypal docs site this is a short ExpressCheckout guide working on year 2013. I wanted to have item details shown on paypal payment page and merchant transaction history page.
Paypal documentation links
- https://developer.paypal.com/webapps/developer/docs/classic/api/
- https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
- https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/DoExpressCheckoutPayment_API_Operation_NVP/
- https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/GetExpressCheckoutDetails_API_Operation_NVP/
You can call following url methods directly on web browser, update token and payerid parameters accordingly.
This is a digital goods so shipping and handling fees are not given. Single item row. Amount and tax fees are given. Do not require a confirmed delivery address, no shipping address fields, no allow freetext note, payer don't need paypal account and no registration required (solutiontype=sole). Activate credit card section on paypal site (landingpage=billing). Use customized brand title on paypal site. Use custom field to give own value for tracking purpose. Merchant site transaction history must show item details (give item details on SetExpressCheckout and DoExpressCheckoutPayment methods).
SetExpressCheckout method opens a new transaction
https://api-3t.sandbox.paypal.com/nvp? USER=<userid> &PWD=<pwd> &SIGNATURE=<mysig> &METHOD=SetExpressCheckout &VERSION=98 &PAYMENTREQUEST_0_PAYMENTACTION=SALE &REQCONFIRMSHIPPING=0 &NOSHIPPING=1 &ALLOWNOTE=0 &SOLUTIONTYPE=Sole &LANDINGPAGE=Billing &BRANDNAME=MY+WEBSHOP+TITLE &PAYMENTREQUEST_0_AMT=22.22 &PAYMENTREQUEST_0_TAXAMT=4.30 &PAYMENTREQUEST_0_ITEMAMT=17.92 &PAYMENTREQUEST_0_DESC=mypurdesc &PAYMENTREQUEST_0_CUSTOM=custom1 &PAYMENTREQUEST_0_CURRENCYCODE=EUR &L_PAYMENTREQUEST_0_NUMBER0=itemid1 &L_PAYMENTREQUEST_0_NAME0=MyItem1 &L_PAYMENTREQUEST_0_DESC0=Item1+description &L_PAYMENTREQUEST_0_QTY0=1 &L_PAYMENTREQUEST_0_AMT0=17.92 &L_PAYMENTREQUEST_0_TAXAMT0=4.30 &RETURNURL=https://myserver.com/webapp/paypal.jsp%3Fcmd=successexp &CANCELURL=https://myserver.com/webapp/paypal.jsp%3Fcmd=cancelexp
Reply must have ACK=Success or ACK=SuccessWithWarning, read TOKEN value
Redirect user browser to Paypal site, give token value
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=<token>
User uses paypal account or credit card. Paypal redirects user to return or cancel url.Redirect destination url gets token and PayerID parameter values.Transaction is not completed yet we must call doExpressCheckoutPayment method.
Show confirm dialog on screen (with OK, CANCEL button) or simple casecommit a transaction and show "Thank you, purchase completed" message.User has already accepted a payment in paypal site and expects transaction be finalized.
You may commit transaction within a same request-response handler or usingasynchronous background task. Paypal site may temporarily be unavailable so don't expect it to work immediately.
Commit transaction if redirect was success, use token and payerid
https://api-3t.sandbox.paypal.com/nvp? USER=<userid> &PWD=<pwd> &SIGNATURE=<mysig> &METHOD=DoExpressCheckoutPayment &VERSION=98 &PAYMENTREQUEST_0_PAYMENTACTION=SALE &PAYMENTREQUEST_0_AMT=22.22 &PAYMENTREQUEST_0_TAXAMT=4.30 &PAYMENTREQUEST_0_ITEMAMT=17.92 &PAYMENTREQUEST_0_CURRENCYCODE=EUR &L_PAYMENTREQUEST_0_NUMBER0=itemid1 &L_PAYMENTREQUEST_0_NAME0=MyItem1 &L_PAYMENTREQUEST_0_QTY0=1 &L_PAYMENTREQUEST_0_AMT0=17.92 &L_PAYMENTREQUEST_0_TAXAMT0=4.30 &token=<token> &payerid=<payerid>
Read ACK=Success and verify fields
ACK=SuccessPAYMENTINFO_0_PAYMENTSTATUS=CompletedPAYMENTINFO_0_ACK=SuccessPAYMENTINFO_0_AMT=22.22 total amount must matchPAYMENTINFO_0_FEEAMT=0.99 (just for fun, read paypal comission fee)PAYMENTINFO_0_CURRENCYCODE=EUR currency must match
(Optional) Read transaction details from Paypal
You can use this during transaction workflow or any time if stored a token for later use.
https://api-3t.sandbox.paypal.com/nvp ?USER=<userid> &PWD=<pwd> &SIGNATURE=<mysig> &METHOD=GetExpressCheckoutDetails &VERSION=98 &token=<token>
Read response parameters.
ACK=SuccessCHECKOUTSTATUS=PaymentActionCompletedPAYMENTREQUEST_0_AMT=22.22PAYMENTREQUEST_0_TAXAMT=4.30PAYMENTREQUEST_0_CURRENCYCODE=EUR
(Optional) Read and save transaction id, correlation id and token id and write to logtable.
PAYMENTREQUEST_0_TRANSACTIONID=11E585715B622391ECORRELATIONID=4534b683c335f
I'm willing to receive comments if there is any logic errors.
Check this link, hope it helps in some sense:https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted
PAYMENTREQUEST_0_AMT=amount //for amount