1
votes

I'm using a program called PayPal Integrator 2016 .NET Edition. It's been in our application for years and we just noticed we can't issue refunds through the PayPal sandbox. Refunds in the live system go through, but in the sandbox, we get an error. It looks like the PayPal Sandbox URL has changed, but none of the URL's I've tried have worked. Can you tell me how to get this working?

I got the URL's from this site: https://www.nsoftware.com/kb/xml/07291101.rst. I also tried the URL mentioned on this page: https://developer.paypal.com/docs/api/sandbox/.

For the credentials, I tried both the live and sandbox credentials associated with our PayPal account. I also tried creating a new developer account under my name and using the sandbox credentials there.

Below are the URLs I've tried, what credentials I've used, and what error message I got.

Live credentials

https://api.sandbox.paypal.com/nvp  Connection closed.
https://api-3t.sandbox.paypal.com/nvp   [10002] Security error. Security header is not valid.
https://sandbox.paypal.com/nvp      [10002] Security error. Security header is not valid.

Sandbox credentials (Same account as the live credentials)

https://api.sandbox.paypal.com/nvp  Connection closed.
https://api-3t.sandbox.paypal.com/nvp   [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
https://sandbox.paypal.com/nvp      [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.

Sandbox credentials (New developer account)

https://api.sandbox.paypal.com/nvp  Connection closed.
https://api-3t.sandbox.paypal.com/nvp   [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
https://sandbox.paypal.com/nvp      [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.

Here is the code I used. I changed the URL, user, etc. using the names I listed above.

Dim ppRefund As New nsoftware.InPayPal.Refundtransaction()
Call ppRefund.Reset()

ppRefund.About = ""
ppRefund.InvokeThrough = Nothing
ppRefund.Timeout = 180

ppRefund.URL = PAYPAL_URL
ppRefund.User = PAYPAL_USERID
ppRefund.Password = PAYPAL_PASSWORD
ppRefund.Signature = PAYPAL_SIGNATURE

ppRefund.Amount = RefTrans.AmountTotal
ppRefund.RefundType = nsoftware.InPayPal.RefundtransactionRefundTypes.rtPartial
ppRefund.CurrencyCode = "USD"
ppRefund.Memo = "Credit PayPal Trans ID: " & RefTrans.Payment.payment_nbr

ppRefund.Refund(RefTrans.Payment.payment_nbr)
1

1 Answers

0
votes

Don't ever use live credentials with sandbox endpoints or vice-versa, that will result in 10002 (invalid credentials)

Your URLs are fine. Your problem is you are trying to refund an invalid ID. Your ID must correspond to an actual PayPal Sandbox transaction on the actual PayPal Sandbox account whose credentials you are using, or it will fail with that error.

Go to https://www.sandbox.paypal.com , log in with the sandbox username and password (this is not the live username and password , and it is not the sandbox API username nor sandbox API password, in case you're not clear on this), and confirm you are able to actually find this transaction ID you're trying to refund.