Paypal Sandbox ExpressCheckout NVP not creating transaction - paypal

I'm trying to integrate PayPal Classic API NVP to our website but I'm having issues with the SetExpressCheckout API call.
I'm using the useraction=commit parameter for the payer to confirm the sale directly at PayPal.
My issue is after "Pay now" is clicked, PayPal redirects to the URL I send as RETURNURL but I don't see the transaction on the sandbox account or by using TransactionSearch.
These are the parameters I send for checkout:
METHOD=SetExpressCheckout
EMAIL=payerEmail
SOLUTIONTYPE=Sole
RETURNURL=myReturnUrl
CANCELURL=myCancelUrl
PAYMENTREQUEST_0_AMT=30.00
PAYMENTREQUEST_0_ITEMAMT=30.00
PAYMENTREQUEST_0_CURRENCYCODE=USD
PAYMENTREQUEST_0_CUSTOM=myCustomId
PAYMENTREQUEST_0_PAYMENTACTION=Sale
L_PAYMENTREQUEST_0_QTY0=1
L_PAYMENTREQUEST_0_AMT0=30.00
L_PAYMENTREQUEST_0_NAME0=myProduct
After payment, PayPal redirects to
myReturnUrl?token={Token}&PayerID={PayerId}

It's normal. The transaction is set, but you need to complete it using the DoExpressCheckoutPayment api operation.
More information and an example here: https://devtools-paypal.com/guide/expresscheckout/dotnet?success=true&token=EC-7BD474648D4932937&PayerID=WNW7LMW2UXQJG

Related

How to excute in Rest API if the return_url request lost after user has paid

I am integrating Express Checkout payments in my web by using REST API, and setting the payment intent to sale for making an immediate payment.
Here follows my steps:
1. create a direct payment by /v1/payments/payment, and set redirect_urls;
2. redirect the buyer using the approval_url in the response of step1;
3. when the buyer approves the payment, the full page will be redicrected to the url that I've been provided in redirect_urls, and then I will execute the payment to complete the payment.
My question here:
what if the redirect_url lost in my step3? The buyer paid but I wouldn't be notified. I would not receive the PAYMENT.SALE.COMPLETED webhook neither because I didn't execute the payment.

How to set an IPN URL for PayPal Recurring Payments using NVP Method(CreateRecurringPaymentsProfile)?

In CreateRecurringPaymentsProfile API Operation (NVP) no options for set IPN URL
How to track subscription?
NVP API CreateRecurringPaymentsProfile operation Support NOTIFYURL field?
On PayPal provide some information
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/#id089EG030E5Z
You can't configure IPN Url in CreateRecurringPaymentsProfile operation, you have to configure it in the business account you use.
In the account configuration there is an IPN section.

Express Checkout token was issued for a merchant account other than yours

I am building a PayPal Express Checkout integration where buyer can send payments to sellers, so I specify the recipient not as myself but as
SUBJECT=seller#domain.com
It works and according to notifications in the sandbox, the payments are received. But when I try to do a GetExpressCheckoutDetails it shows the following error:
Express Checkout token was issued for a merchant account other than yours.
Is that normal? Is there any way around it so that I can still get the details? Or should I be notified with IPN instead.

Not receiving money through Paypal Express Checkout API

I developed a small payment process that uses the Express Checkout API. I'm testing the code with my friend's account with $1. My payment process is redirecting to the live paypal site, he enters his information and pays, he is redirected to my confirmation thank you page, but I never receive funds. I've checked my API credentials in the code, and they are OK. I'm receiving a token and paypal payerid info on my confirmation screen. What could be the problem?
Thank you in advance.
See my answer in Why is DoExpressCheckoutPayment required for Paypal?
In order to use Express Checkout, you must call at least the following API calls:
1. SetExpressCheckout -- to set up the transaction.
2. DoExpressCheckoutPayment -- to finalize the transaction.
If you don't call DoExpressCheckoutPayment on the 'Thank you' page, the transaction is not completed. This is by design to allow for greater flexibility
Express Checkout is intended as a drop-in solution in your own checkout process. After Express Checkout redirects you back to your site, you're supposed to show an order confirmation where the buyer can review his/her final order details before initiating a button / link which initiates the final DoExpressCheckoutPayment API call. This is why DoExpressCheckoutPayment is required.

DNN and PayPal, how to sent email to customer after payment has been made

In my DNN website, using Paypal's Checkout button, when user has click the buy button and sent to Paypal. Make a payment and then redirect back to my site.
Question:
How can I get that customer email address (from Paypal) so that i can sent a conformation email to him/her from my DNN website?
thanks.
Two ways; you can either call the GetTransactionDetails API and supply the TRANSACTIONID as a parameter. 'EMAIL' will contain the buyer's (PayPal) email address.
Or you can use PayPal IPN to get notified through POST whenever a payment / action has been made.
GetTransactionDetails API doc is at https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetTransactionDetails
You can also have a look at TransactionSearch for past transactions.
In case you want to use IPN, just supply NOTIFYURL in your SetExpressCheckout and DoExpressCheckoutPayment call if you're using Express Checkout, or if you're using Website Payments Standard.
Remember to send the POST back to PayPal for validation at paypal.com/cgi-bin/webscr?cmd=_notify-validate and check for a VERIFIED / INVALID response.
Some sample code and docs for IPN is available at https://www.paypal.com/ipn/