cancel
Showing results for 
Search instead for 
Did you mean: 

Sandbox Negative Testing of insufficient funds

Options
jashinj
Contributor
Posted on

I am trying to simulate a payment with a sandbox account which contains a test credit card containing insufficient funds. I have followed the steps https://developer.paypal.com/docs/api/overview/#create-sandbox-accounts to create a sandbox account however, this does not allow me to set a balance on the credit card specifically.

 

This method only allows the PayPal balance to be modified. How do I create a credit card in the sandbox with insufficient funds?

 

The following link describes how to enable negative testing on my account but I can't seem to find this setting anywhere - https://developer.paypal.com/docs/classic/lifecycle/sandbox/sb-error-conditions/#enable-negative-tes...

 

 

5 REPLIES 5

Sandbox Negative Testing of insufficient funds

Options
MTS_Justin
Moderator
Hello,

"how to enable negative testing on my account"

As you mentioned, the following link contains details on how to enable negative testing on a sandbox account, although whilst reading the instructions I didn't find them very clear, so I'll clarify below and also file a documentation update request to make this information clearer to understand.

https://developer.paypal.com/docs/classic/lifecycle/sandbox/sb-error-conditions/#enable-negative-tes...

1. Login to your PayPal Developer account
2. Click on "Accounts", under the "Sandbox" column
3. Locate the sandbox account for which you wish to enable negative testing and click on the three dots to the right of the email address
4. A menu will appear, click on "view/edit profile"
5. The profile page will be displayed, click on the "Settings" tab and the second option will be "Negative Testing".
6. Change the button toggle to "on" to enable negative testing.

Hope this makes it easier to understand.

Thanks !

Was my post helpful? If so, please give me a kudos!

Sandbox Negative Testing of insufficient funds

Options
Dara7
New Community Member

I followed exactly these instructions but the transactions keep on succeeding on the new checkout. I even tried to meddle with the buyer account to remove all fundings but the UI doesn't allow me to remove either account nor credit card (which was recommended in another thread). More over, when creating a new buyer test account, it forces you to have a bank account, a discover card or paypal card so there is no way to start off with an account without funding. PayPal is being so inconsistent and unsatisfactory in whatever they do.

Sandbox Negative Testing of insufficient funds

Options
dominiotestxyz
New Community Member

Did you find any solution? I keep getting payment completed

Sandbox Negative Testing of insufficient funds

Options
MTS_Justin
Moderator
Hello,

@Dara7

"More over, when creating a new buyer test account, it forces you to have a bank account, a discover card or paypal card so there is no way to start off with an account without funding. PayPal is being so inconsistent and unsatisfactory in whatever they do"

I've just created a personal account today, logged into the account and removed the bank account and card without issue. The account was also created without a balance.

@jashinj

It's not possible to create a card in the sandbox environment which has insufficient funds. You can only use the provided negative testing scenarios to simulate the response.

REST Orders V2 : https://developer.paypal.com/tools/sandbox/negative-testing/request-headers/#link-testapierrorhandli...

Response : UNPROCESSABLE_ENTITY

INSTRUMENT_DECLINED : The instrument presented was either declined by the processor or bank or it can't be used for this payment.

PAYER_CANNOT_PAY : The payer cannot pay for this transaction. Contact the payer to find other ways to pay for this transaction.

Thanks !


Was my post helpful? If so, please give me a kudos!

Sandbox Negative Testing of insufficient funds

Options
jashinj
Contributor

Hi Justin

 

Thanks for the steps provided. I have successfully turned on Negative Testing on my account.

 

Regarding my second question of my original post, "How do I create a credit card in the sandbox with insufficient funds?", I am trying to simulate a payment by credit card with insufficient funds to trigger the OnError handler. I am using the PayPal JavaScript SDK.

 

Regards,

Jashin

 

 

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.