I'm working on Paypal integration in my website, following Paypal's API specifications. I'm testing it in a sandbox, and after sending a SetExpressCheckout request like this:
CURRENCYCODE=EUR
&RETURNURL=http%3A%2F%2Fwww.xxxxxxxx
&CANCELURL=http%3A%2F%2Fwww.xxxxxxxx
&PAYMENTACTION=Sale
&L_PAYMENTREQUEST_0_NAME0=T-shirt+ring-spun+attillata%3B+taglia+L%3B+colore+Navy
&L_PAYMENTREQUEST_0_NUMBER0=0LLR7IQ-B0SIE+%28Product+%230LLR7IQ-B0SIE%29
&L_PAYMENTREQUEST_0_DESC0=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT0=1.90
&L_PAYMENTREQUEST_0_QTY0=1
&L_PAYMENTREQUEST_0_NAME1=T-shirt+ring-spun+attillata%3B+taglia+M%3B+colore+Dark+Heather
&L_PAYMENTREQUEST_0_NUMBER1=0LLR7IQ-2KEI1+%28Product+%230LLR7IQ-2KEI1%29
&L_PAYMENTREQUEST_0_DESC1=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT1=1.90
&L_PAYMENTREQUEST_0_QTY1=1
&L_PAYMENTREQUEST_0_NAME2=T-shirt+ring-spun+attillata%3B+taglia+S%3B+colore+White
&L_PAYMENTREQUEST_0_NUMBER2=0LLR7IQ-TFOHI+%28Product+%230LLR7IQ-TFOHI%29
&L_PAYMENTREQUEST_0_DESC2=160+g%2Fm%C2%B2%2C+100+%25+cotone+ring-spun%2C+pre-ristretto%2C+simple+jersey%2C+scollatura+arrotondata%2C+maniche+corte%2C+impunture+sulla+scollatura%2C+sul+bordo+delle+maniche+e+sulla+base%2C+cuciture+laterali.
&L_PAYMENTREQUEST_0_AMT2=1.59
&L_PAYMENTREQUEST_0_QTY2=1
&ITEMAMT=5.39
&TAXAMT=1.08
&SHIPPINGAMT=0.00
&AMT=6.47
&ALLOWNOTE=1
&USER=XXXXXXXX
&PWD=XXXXXXXX
&SIGNATURE=XXXXXXXX
&METHOD=SetExpressCheckout
&VERSION=53.0
I forward the user to here, which is the token Paypal gives me back in response to my first request.
The problem is that, despite the successful request with all prices set in, I have an empty Paypal review page, with absolutely no prices into.
What am I missing?
Attack of the poor API docs! Paypal sure tried hard, but they fall short. I've fought this API and won! :)
Change these values in what you already have... let me know if it takes care of the problem
&PAYMENTREQUEST_0_PAYMENTACTION=Sale [[ <--- payment action ]]
&PAYMENTREQUEST_0_CURRENCYCODE=EUR [[<-- currency code]]
&PAYMENTREQUEST_0_ITEMAMT=5.39 [[<---- subtotal here]]
&PAYMENTREQUEST_0_TAXAMT=1.08 [[<---- tax here]]
&PAYMENTREQUEST_0_SHIPPINGAMT=0.00 [[<---- shipping here]]
&PAYMENTREQUEST_0_AMT=6.47 [[<---- grand total here]]
&PAYMENTREQUEST_0_ALLOWNOTE=1
This one bugged me as well for a couple of days.
Using the Java SDK from developer.paypal.com (as of 2008), I finally came across a new version of the SDK (Nov 2011) at https://www.x.com/developers/paypal/documentation-tools/sdk#3
Using the new SDK (in particular, the updated paypal_base.jar) however did NOT yet solve my issue.
You have to figure out the correct API Version String to make it run. With version "51.0" (as in some of my example code), the call failed. As with version "78.0", the new SDK did the job.
Cheerio....
In addition to the other comments here, be sure to use the undocumented "useraction" option when you redirect to PayPal after getting the response from SetExpressCheckout:
?cmd=_express-checkout&useraction=commit&token=the-returned-token
(the link below no longer works)
Here's the PayPal forum reference to this parameter
Related
I am using PayPal API of php. It was ok since 2 years but now its creating problems for some customers. Some of the orders are fine but for few users, the transaction is completed but API doesn't response (throw empty response).
I don't think it will be because of code issue. I am unable to track the issue. Anyone know, why it's showing the random behavior.
The interesting thing is, for the same customer, doing the second time transaction, it works fine. Totally random behavior. Please need expert suggestion.
Please contact PayPal Merchant Technical Support, provide with your PayPal account and API request example which go empty response.
https://www.paypal-techsupport.com/
I'm trying to understand if it's convenient for a client to switch from Paypal Express Checkout to Braintree, but I find the latter way too complicated and hard to understand (terrible docs, only reference is good).
Documentation lacks COMPLETE WORKING examples, with all the pages needed where you can just change API credentials and everything works. That is fundamental for any system/API to get quickly the logic and workflow.
I basically currently have a checkout system with all my customer's data and a basket_id, with a form a redirect customer to Paypal passing all these data, and once the customer completes the payment Paypal calls back a URL on my server sending back all the data I sent plus transaction id, and this way I mark that basket_id/order as paid and assign to it a transaction. And no sensitive payment data are typed or pass through our server/network.
How to do all this on Braintree js+php? Any full and complete sandbox working example where I can just change my credentials and have working code to understand the logics? Is much faster than reading the honestly quite confusing documentation.
Thanks!
I have a Magento website with the PayPal express payment option. I'm trying to skip the review page when my costumers pay with PayPal. As was mentioned in a former thread (Magento: easy way to remove "paypal/express/review" step), this can be easily achieved by writing an extension that changes a few line in the controller, and this behavior is actually built into v1.9.
However, these solutions didn't work for me. The built-in option apparently did nothing, and the review page was still there. The workarounds proposed in the former thread caused an infinite loop between the actions "placeOrder" and "review".
After a long time, I have now found out that when the user comes back from PayPal, the system doesn't recognize the shipping method selected in the PayPal checkout screen, and accordingly sends the user back to the review page to select a shipping method.
Has anyone ever encountered that or have any solution in mind? I am using Magento 1.9.1.0, and PayPal express is in sandbox mode.
We have used DoDirectMethod to credit card payment and recurring payment with CreateRecurringPaymentsProfile Method. But Some how i can not get error "This transaction cannot be processed due to an invalid merchant configuration.".
I found some solution for this :
1)I have problem like : Features that are not enabled for live transactions
2) If for use of REST API ,
I need to change my country then how can i change country or currency.
3) In paypal errorcode i found : Occurs when you have not agreed to the billing agreement.
- Then how can i agreed billing agrrement- need steps for it.
Please help me by providing steps of configuration or any other solution.
PayPal is confusing peoples/developers completely, i am also getting the same issue from one month on one of our client's website, i was used DoDirectPayment, and it works like a charm for test transactions, but as i make it LIVE it is was showing the same issue, i found that too, to performing transactions in LIVE mode we need to 'Enable' this feature for Direct Credit Cards, but many times i requested them (PayPal) to enable that feature, but all time they just received my Application Online and reponsed that it will take about 24 hours. I have also added extra information like SSN, EIN all that but they are so lazy or not active to do that.
At one point they are saying we need Website Payments Pro but i have not found a single link to register that, I found PayPal Payments Pro link at many sites and even in their site, these guys have a huge documentation on that website payments pro and dodirect method but not a single link how to register for that service or how they enable that feature for 'Live' mode.
And today i found they updated their developers site and make things a little different, also provided an extra method "braintreegateway" in order to process, and i tried that too using their sandbox account, its working with only PHP 5.4 and above, so old PHP version servers are unable to get that. And they also need to register your details at their end.
If i have already a PayPal Business account why do i need to register at every single method.
Sucked
I am using the Paypal Express Checkout and everything working good except the shipping carrier not being updated when the Callback is being called.
I can verify the callback is being called (call is logged).
When Paypal call the callback URL with the customer shipping country I return the following values.
METHOD=CallbackResponse&OFFERINSURANCEOPTION=false&CURRENCYCODE=USD&TOKEN=EC-5Fsdf5523823&LOCALECODE=en_US&L_SHIPPINGOPTIONNAME0=USPS&L_SHIPPINGOPTIONLABEL0=First+Class+%283-7+Days%29&L_SHIPPINGOPTIONAMOUNT0=0.00&L_SHIPPINGOPTIONISDEFAULT0=true&L_TAXAMT0=0.00&L_INSURANCEAMOUNT0=0.00&L_SHIPPINGOPTIONNAME1=USPS&L_SHIPPINGOPTIONLABEL1=Priority+%282-3+Days%29&L_SHIPPINGOPTIONAMOUNT1=7.95&L_SHIPPINGOPTIONISDEFAULT1=false&L_TAXAMT1=0.00&L_INSURANCEAMOUNT1=0.00&L_SHIPPINGOPTIONNAME2=UPS&L_SHIPPINGOPTIONLABEL2=Next+Day+Air&L_SHIPPINGOPTIONAMOUNT2=39.95&L_SHIPPINGOPTIONISDEFAULT2=false&L_TAXAMT2=0.00&L_INSURANCEAMOUNT2=0.00
The Callback message is being echo'd through PHP (I even tried save this as a txt file and point the callback URL to this file), even then Paypal doesn't update the Shipping Method.
I also changed CALLBACKTIMEOUT to 6 seconds but it doesn't matter. I am using HTTPS and also tried it with normal HTTP.
I am testing this in sandbox mode.
Anyone could help me out? I am really stuck here and I have been searching for similar problems but couldn't find any.
For your information I followed this Paypal guide : https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPInstantUpdateAPI/
I also checked if I am returning all the required fields as described here :
https://developer.paypal.com/docs/classic/api/merchant/Callback_API_Operation_NVP/
I hope someone can help me out, thanks in advance!
UPDATE
I try the NO SHIPPING OPTION
METHOD=CallbackResponse&NO_SHIPPING_OPTION_DETAILS=1&CALLBACKVERSION=95.0
Paypal responds with 'doesnot ship to this location. Please use a different address.'
So the response url is working, the problem is when responding with other shipping options.
Regards,
Kuroudu
I was having the same problems as you, but then I tried the example code from the PayPal Instant Update integration guide and added it as a text file on my server:
METHOD=CallbackResponse&OFFERINSURANCEOPTION=true&L_SHIPPINGOPTIONNAME0=UPS+Air&L_SHIPPINGOPTIONLABEL0=UPS+Next+Day+Air+Freight&L_SHIPPINGOPTIONAMOUNT0=20.00&L_TAXAMT0=2.20&L_INSURANCEAMOUNT0=1.51&L_SHIPPINGOPTIONISDEFAULT0=false&L_SHIPPINGOPTIONNAME1=UPS+Expedited&L_SHIPPINGOPTIONLABEL1=UPS+Express+2+Days&L_SHIPPINGOPTIONAMOUNT1=10.00&L_TAXAMT1=2.00&L_INSURANCEAMOUNT1=1.35&L_SHIPPINGOPTIONISDEFAULT1=true&L_SHIPPINGOPTIONNAME2=UPS+Ground&L_SHIPPINGOPTIONLABEL2=UPS+Ground+2+to+7+Days&L_SHIPPINGOPTIONAMOUNT2=5.99&L_TAXAMT2=1.99&L_INSURANCEAMOUNT2=1.28&L_SHIPPINGOPTIONISDEFAULT2=false
This at least gave me a CallbackResponse that finally worked which I then could update with programming to make it function the rest of the way. Spent many hours ripping my hair out. As PayPal doesn't really provide any means of debugging the CallbackResponses, I was happy to have a functioning starting point.
Hopefully this helps to point others in the right direction.