cancel
Showing results for 
Search instead for 
Did you mean: 

Simulate errors with PayPal's Smart Payment Buttons

Highlighted
Contributor

Simulate errors with PayPal's Smart Payment Buttons

I am using Smart Payment Buttons in Sandbox. Im almost finished.

Can anyone tell me how can i simulate errors? I've turned on Negative testing. But what's next?

 

I saw that the documentation does provide 2 methods of simulating errors.

Those methods are: test values and request headers.

 

But both methods seem to be unrelated to Smart Payment Buttons because these methods use something called "Payouts API" - which i dont have.

 

I think i use Orders API.

 

Please help.

10 REPLIES 10
Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

I could not find an answer to that. Did you find a way yet?

 

A few days ago, I activated negative testing for the sandbox account and made it worked with a a specific amount. I can't find that documentation anymore and could not reprod

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

Hey, thanks for taking the time to respond.

 

Unfortunately, i have not found a sollution for this yet. 

Highlighted
Moderator

Re: Simulate errors with PayPal's Smart Payment Buttons

Hi @Borisu @CamelliaSinensi,


Here is some content we have on Developer.PayPal.com, please let me know if this helps. 


Thanks,
Christina 

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

@MTS_Christina 

 

I think you can see from the replies that it does NOT help.


PLEASE provide us with CLEAR documentation on how to test the SMART BUTTON (not REST API, not SOAP, not NVM) for error conditions.

Highlighted
Moderator

Re: Simulate errors with PayPal's Smart Payment Buttons

Hi @jlippiner

 

I understand the concerns, I'm working with the product teams to see how we can make this more clear. I apologize for the challenges this is presenting you. 


Christina 

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

https://developer.paypal.com/docs/api/request-headers/ seems to suggest that we can use request headers for testing the Orders API, which is used by the Smart Button, but I don't see how we can add these headers to the request made by the button?

 

In the javascript Smart Button SDK, we give the call like this:

  paypalConfig = {
    createOrder: function(data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '0.01'
          }
        }]
      });
    }
}

which I guess eventually calls https://developer.paypal.com/docs/api/orders/v2/#orders_create

How would we add the request header to the orders_create API call?

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

You'll have to go to your Dashboard on https://developer.paypal.com/ . 

On the left side go to Sandbox --> Accounts. You'll see at least two accounts. One for your business (the seller) and one personal one (the buyer). 

Important: Go to the business account under "manage account" --> "view/edit account" and then choose the last tab on the right called "Settings". There you can enable negative testing

 

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

I've not found a way to perform negative testing with smart buttons.  Negative testing has been enabled for my sandbox business account.  I found a page that says to use a value of 107.55 in order to simulate the 10755 error code, but createOrder() always returns completed.

 

The documentation for negative testing does not seem to be complete for smart buttons, and always refers back to using request headers, which doesn't seem to be possible with smart buttons.  Your last response about enabling negative testing does not seem to have any effect.

 

Thanks for your help,

Highlighted
Contributor

Re: Simulate errors with PayPal's Smart Payment Buttons

@Paul_Adamson I completely agree.

 

This is INSANE that we cant test error conditions easily using the Smart Button.  I have an error handler and were seeing issues but no way to test it.  Turning on negative testing does nothing and there is no place for headers.

 

If you figure this out, please let me know.

 

Josh