Search code examples
paypalpaypal-sandboxpaypal-rest-sdk

PayPal DoReferenceTransaction bug when charging specific amount of 100.10


Unfortunately I can't get a response from PayPal tech support via their ticket system so maybe someone else has seen this. I'm certain it's a bug. Here are two API calls:

This one worked successfully:

[USER] => ***
[PWD] => ***
[SIGNATURE] => ***
[VERSION] => 86
[METHOD] => DoReferenceTransaction
[AMT] => 101.10
[TAXAMT] => 0.00
[ITEMAMT] => 101.10
[CURRENCYCODE] => USD
[PAYMENTACTION] => SALE
[REFERENCEID] => ***
[DESC] => ***

And this one didn't (only difference is the amount):

[USER] => ***
[PWD] => ***
[SIGNATURE] => ***
[VERSION] => 86
[METHOD] => DoReferenceTransaction
[AMT] => 100.10
[TAXAMT] => 0.00
[ITEMAMT] => 100.10
[CURRENCYCODE] => USD
[PAYMENTACTION] => SALE
[REFERENCEID] => ***
[DESC] => ***

The error returned for the second one is this:

[TIMESTAMP] => 2017-06-20T19:10:03Z
[CORRELATIONID] => ff77dc0fdff4e
[ACK] => Failure
[VERSION] => 86
[BUILD] => 29297572
[L_ERRORCODE0] => 10010
[L_SHORTMESSAGE0] => Invalid Invoice
[L_LONGMESSAGE0] => Non-ASCII invoice id is not supported
[L_SEVERITYCODE0] => Error

Clearly the error is also nothing to do with the problem as I'm even submitting an invoice id. Basically any amount other than 100.10 seems to work.

What's even more strange is that amount matches the PayPal error code that gets returned!

This is all in using the Sandbox.

Many thanks!


Solution

  • It sounds like you have negative testing enabled in the sandbox account, which allows you to force errors so that you test them by passing in an AMT that matches the error code you want to trigger. See the link for more details on this including how to enable/disable it.