Paypal Digital Goods, Transactions not displaying - paypal

I've integrated Digital Goods with Express Checkout for my site and I've successfully tested with using sandbox. However I doesn't show any record of the transaction I've just completed in either the merchant account or the test account.
Should I be seeing a transaction? and if so, what could have gone wrong such that a transaction record isn't appearing?

You're most likely not calling the DoExpressCheckoutPayment API call to finalize the transaction.
DoExpressCheckoutPayment is a mandatory API call used to create a transaction out of a TOKEN and PAYERID (assuming the buyer has approved the transaction on the PayPal website).
The API doc (NVP) for DoExpressCheckoutPayment is available at developer.paypal.com.

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.

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.

Paypal Billing Agreement with Do DIrect Payment/CreditCard

I have been working on Reference Transactions. Is it possible to create a Billing Agreement using Do Direct Payment as it is not returning any token in the response ??
Thanks
There is no billing agreement that gets created with the DoDirectPayment API. In order to charge the buyer again, all you have to do is make the API call for a reference transaction and pass over the previous successful transaction id. Express Checkout would be the API that you would want to use if you want to set up a billing agreement.

Paypal NVP with IPN for confirmation - what ties them together

I am using PayPal with NVP API (using PHP) for express checkout. I am creating an invoice record in the database before redirecting the user to Paypal. In case the user doesn't return to my site after processing, I am using IPN to confirm the purchase and then update the invoice record that the payment is confirmed. I am still in the sandbox mode and trying to figure out how I will tie the transaction started with NVP to the confirmation I get with IPN.
I need to verify if the "PAYMENTREQUEST_n_INVNUM" sent in the NVP will come back as "invoice" in the IPN post.
It appears I cannot actually test this until I am live since the Sandbox IPN does not seem to be active with NVP initiated sandbox transactions - is this correct?
Thanks for your help.
You can test this in Sandbox. But if you're using "PayPal NVP", I assume you're using PayPal Express Checkout and calling the SetExpressCheckout and DoExpressCheckoutPayment API's.
If that's the case, you don't really need IPN, because a transaction will only be completed as soon as you call DoExpressCheckoutPayment.
In other words, buyers will always be redirected to the RETURNURL you specified in SetExpressCheckout, and the transaction is completed (or not) when you call DoExpressCheckoutPayment on this return page.
To get the invoice number, you could call GetExpressCheckoutDetails and supply the TOKEN you retrieved earlier (it's also appended to the GET of the RETURNURL).
Finally, check PAYMENTSTATUS=Completed in the DoExpressCheckoutPayment API response to see whether the transaction has completed or not.
Thank you Robert for the clarity on the process - especially useraction=commit.
I finally realized that I could turn on IPN in the Sandbox for my test seller and test NVP with IPN together. I was able to verify that PAYMENTREQUEST_0_INVNUM matches the 'INVOICE' parameter in the IPN POST.
I will use the custom field to pass customer email from my system in case they use a different email to log into paypal with, therefore allowing me to have email/invoice number pair for confirmation.

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.