PayPalStandart PDTHandler expects get while Paypal uses POST

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 4 años
Hello, I want to configure PayPal standard plugin
Version 1.60, NopCommerseVersion 4.30

I've created business PayPal account
I configured under
Account settings > Website payments > Website preferences (https://www.paypal.com/businessmanage/preferences/website)
Auto return for website payments: Set to "On" and entered my site URL:
http://.../Plugins/PaymentPayPalStandard/PDTHandler
also I set
Payment data transfer: to "On"

After redirecting to PayPal, I've logged in and made a payment. And by pressing "Return to merchant", I was expected PayPal would redirect to http://.../Plugins/PaymentPayPalStandard/PDTHandler.
But instead of GET, PayPal uses post

Request URL: http://.../Plugins/PaymentPayPalStandard/PDTHandler
Request Method: POST
and posts Form parameters:
payer_email: [email protected]
payer_id: JBH2JMEFAZEN2
payer_status: VERIFIED
first_name: John
last_name: Doe
...

I looked at PDTHandler code in nopCommerce, it expects GET and reads parameters from QueryString, but PayPal uses POST.
Is it possible to configure PayPal for it to use GET, or am I missing some configuration in NopCommerce part?
Hace 4 años
The current version is 1.61 which is in nopCommerce version 4.3
https://github.com/nopSolutions/nopCommerce/tree/develop/src/Plugins/Nop.Plugin.Payments.PayPalStandard
PDTHandler works on my version.
Have you  configured the plugin with the Identity token from the following page
See https://www.paypal.com/businessmanage/preferences/website
Hace 4 años
Yidna wrote:

PDTHandler works on my version.
Have you  configured the plugin with the Identity token from the following page
See https://www.paypal.com/businessmanage/preferences/website

Yes, I've configured PaypalStandard plugin and inserted PDT identity token.
But how PDTHandler works in your version is PayPal responding to you with GET or POST?

I saw the source code of 1.61 plugin version. There are no changes in PDTHandler it still accepts GET and reads parameters from QueryString
Hace 4 años
Paypal calls the PDTHandler via a GET
The PDTHandler in nopCommerce POSTs back to Paypal to get a response
Which is correct according to this documentation
https://developer.paypal.com/docs/api-basics/notifications/payment-data-transfer/

What is the actual problem you are facing ?
Hace 4 años
Yidna wrote:
What is the actual problem you are facing ?

As I mentioned instead of GET PayPal was using POST to my site with totally different parameters.

I figured it out, that in PayPal Standard settings I specified Sandbox: true, Business email: actual business email. And payed from sandbox accounts.

After I specified Business email: sandbox business email. PayPal started to redirect properly, my site received GET request from PayPal. But payment status is Pending? Is this the expected behavior of PayPal sandbox?
Hace 4 años
I have the same problem.  In PayPal's documentation, "tx" is supposed to be returned
PayPal sends the transaction ID of the payment through HTTP as a GET variable (tx). This information is sent to the Return URL you specified in your PayPal account profile.

However, tx is always empty (in the PDTHandler function)!
Hace 4 años
It looks like there's a bug in PayPal's Sandbox.  Even if you specify the return page like "https://localhost:44356/Plugins/PaymentPayPalStandard/PDTHandler"  it never gets the tx data!
Hace 4 años
Set up Visual Studio and changed store settings to use HTTP instead of HTTPS, still no joy.  
PayPal's sandbox does not return any transaction information at all - neither POST nor GET .
So it's not possible to develop with the sandbox because of this failure on PayPal's part (I'm just going to wing it from here on out presuming that the live site will work).
Hace 4 años
beefydog wrote:
if you specify the return page like "https://localhost:44356/Plugins/PaymentPayPalStandard/PDTHandler"

I am assuming that PayPal cannot access this host (from the internet) and so I guess it cannot post data to it ?
I was just running fiddler as the same time as doing a paypal payment test test and saw the tx data in the post but as you say it does not make it to the host to be read by the PDTHandler function
Hace 4 años
i thought it was strange that it redirects to the localhost (PDTHandler), but doesn't include a querystring (go figure - it works on live mode, but not in sandbox, from VS).  I'm going to manually append the querystring data for testing for now, then publish again.   Basically, I just need to call the  SendNotificationsAndSaveNotes(order);  (which I already modified to ignore paypal "pending" payments with a null transactionId ) after control is returned to PDTHandler (so customers only get an order email if payment went through).
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.