0

I am currently working on a new integration with PayPal with the NVP (paypalfunctions.php) to process payments. Same integration works for other projects, but on the current one it fails.

Description: Payment Link gets created successfully - gets redirected to Paypal - Login and pay the amount (1 or 5 EUR) - get redirected to the success url.

Problem: Neither the shop account nor the senders account sees the payment and I dont get any callback from PayPal - thus the payment was not processed/accepted, etc. but I dont get any information from Paypal.

The NVP settings that I use are minimal and dont need a delivery address:

$nvpstr="&PAYMENTREQUEST_0_AMT=". $paymentAmount;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType;
$nvpstr = $nvpstr . "&RETURNURL=" . $returnURL;
$nvpstr = $nvpstr . "&CANCELURL=" . $cancelURL;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType;
$nvpstr = $nvpstr . "&NOSHIPPING=1";
$nvpstr = $nvpstr . "&BRANDNAME=MyName";
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CUSTOM=" . $paymentId;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_NOTIFYURL=https://my.callback.com";

The URL gets created successful and all variables are set.

Any idea why this is not working?

Many Thanks

bert2002

bert2002
  • 67
  • 1
  • 1
  • 6

1 Answers1

0

It sounds like you're missing the final call in the process. The flow should be:

  1. SetExpressCheckout
  2. GetExpressCheckoutDetails
  3. DoExpressCheckoutPayment

No money will be moved until the final DECP call is completed successfully.

Side note: What you're doing is not using the REST API / SDK, so that tag is misleading.

I have a PayPal PHP SDK that will make these API calls very quick and easy for you, so you won't have to build those out manually like you are now. I would recommend you take a look at it. I think you'll like it.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • Hi, thank you very much. I use CallShortcutExpressCheckout() which should be enough (or they changed something in the last weeks/month) or I did it wrong the whole time and it works out of magic. I followed [link](https://devtools-paypal.com/integrationwizard/ecpaypal/code.php) and it does not mention your functions. I will check your SDK if I can integrate this instead. Would just like to know why mine is not working anymore. – bert2002 Oct 11 '16 at 14:16
  • Okay I found a way, but its kind of weird. First I make an CallMarkExpressCheckout() with all my details, then the users pays and gets redirected to ReturnURL which processes the token and PayerID with DoExpressCheckoutPayment(). Then the payment gets approved. Does this workflow makes sense? In another project all the second part is handlded with the callback and not with the ReturnUrl from the user. That ReturnUrl is kind of weird. – bert2002 Oct 11 '16 at 19:06
  • The API names I outlined are the actual names. Those functions are build to do specific things with the SetExpressCheckout request. For example, one of the parameters in SetExpressCheckout can be set to "Billing" or "Mark" and the experience is different based on how you set that. Regardless, those functions are running SetExpressCheckout for you, and probably handling the redirect for you, but yes, you need to also add the DoExpressCheckoutPayment call after you're returned back to your ReturnURL supplied with SetExpressCheckout. – Drew Angell Oct 11 '16 at 21:51
  • "Callback" would be a term typically used with IPN, which is when PayPal's server sends a POST of data (or calls back) to your server so that you can automate procedures with the transaction data. This is a very useful tool, but that's completely separate from the flow of Express Checkout and finalizing a payment. – Drew Angell Oct 11 '16 at 21:52
  • Yes, IPN I mean. Sorry. Is it possible they changes the workflow? Before I never had to use the ReturnUrl to verify the payment. Nevertheless seems like the new way to handle this. Many Thanks! – bert2002 Oct 12 '16 at 07:44
  • Express Checkout has always required a ReturnURL with completion via DoExpressCheckoutPayment. If you weren't doing that before you were probably using PayPal Standard, which is just basic HTML forms. – Drew Angell Oct 12 '16 at 11:40