cancel
Showing results for 
Search instead for 
Did you mean: 

How to force error to javascript sdk in Sandbox

Contributor

How to force error to javascript sdk in Sandbox

I am working with the simple Checkout javascript API, works great. What I am unable to do is to force an error so I can handle it in my code. I feel like maybe I am not understanding how to force errors to be returned to the javascript using the documentation in the Developer center - it appears I can only do this with the server side apis? anyone have any pointers? This is what I am using. <script src="https://www.paypal.com/sdk/js?client-id=[removed]&intent=capturet&integration-date=2020-09-15"></scr...> and this javascript paypal.Buttons({ style: { shape: 'pill', color: 'gold', layout: 'vertical', label: 'paypal', }, createOrder: function(data, actions) { return actions.order.create({ purchase_units: [{ amount: { value: ppObj.amount }, invoice_id :ppObj.invoice, description: ppObj.description, soft_descriptor : ppObj.soft_descriptor }] }); }, onApprove: function(data, actions) { return actions.order.capture().then(function(details) { $('#showme1').empty().text('CAPTURE RESULTS\n'+JSON.stringify(details, undefined, 4)); alert('Transaction completed by ' + details.payer.name.given_name); }); } }).render('#paypal1');