Simulate errors with PayPal's Smart Payment Buttons

Borisu
Contributor
Contributor

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.

Login to Me Too
18 REPLIES 18

GreenJelly
Contributor
Contributor

Has anyone found ANY way to test ANY aspects of these Smart Payment Buttons?  The sample data doesn't show how things like what Options the user selected are sent to the web events.  It also lacks other key explanations or details.

Login to Me Too

mauriblint
Contributor
Contributor

Hello, please Paypal team give us a solution. I have a lot of customers that receive a payment error because you charge 1USD to validate the credit, they receive a SMS from their banks regarding the payment, and is giving me a lot of problems. I cannot testing on sandbox to improve the error message at least

Login to Me Too

IsReady-io
Contributor
Contributor

Yes, this same here. REST API is well documented but the smart button is not. 

Triggering error by passing value in the note field would be nice (just like you do for REST):

createOrder: function(data, actions) {
    return actions.order.create({
        purchase_units: [{
            amount: {
                currency_code: "USD",
                value: getTotal()
            },
            custom_id: orderId,
            note: "ERRPYO002"
        }]
    });
}, ​

 

Login to Me Too

GreenJelly
Contributor
Contributor

I've also, just tried to find a solution for this.  I searched for over 2 hours with no solutions.  Firing ACTUAL subscription events, based on current users is apparently impossible.  This doesn't seem to be related to just Smart Payment Buttons but ALL transactions.  According to Paypal, we need to use their test data.  Which means, we can't support ANY features of paypal that are not covered in the Test Data.  This includes Smart Payments, and custom options for the various products.

 

This is REALLY bad, and REALLY frustrating.  I certainly share in the communities reactions to this.  Paypal makes it VERY hard.  It would be nice to have a button, wizard, or some type of interface that will send out events from actual accounts.  Sadly, they seem to be lacking in this.

 

As a result, we've already abandon the Buttons, but we're finding the generic subscription options no better.

 

It would be nice if Paypal offered any support.  

Login to Me Too

GreenJelly
Contributor
Contributor

Should we abandon Paypal as a payment provider and just use Stripe?

Login to Me Too

IsReady-io
Contributor
Contributor

I looked at the source code of the smart buttons on github and I couldn't really find a way to overwrite headers before their library makes a call the their API. 


If the transaction fails I don't even know what is the returned object like and how can I show error message to the user.

This is sad.

I'm moving to Stripe today.

Login to Me Too

imthrealone
Member
Member

Hi @MTS_Christina 

 

Is there any updates to this issue. The only information I found was https://developer.paypal.com/docs/checkout/integration-features/handle-errors/

paypal.Buttons({
  onError: function (err) {
    // Show an error page here, when an error occurs
  }
}).render('#paypal-button-container');

Note: This error handler is a catch-all. Errors at this point are not expected to be handled beyond showing a generic error message or page.

 

So this method of error capturing would not display any specific error codes?

Login to Me Too

tealord
Contributor
Contributor

Anything new here in 2021 or is this still an unsolved case?

Login to Me Too

IsReady-io
Contributor
Contributor

Nope. We ditched Paypal and using Stripe instead. It is way better.

Login to Me Too

Haven't Found your Answer?

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