andrewangelle / react-paypal-button

A button component to implement PayPal's Express Checkout in React
23 stars 9 forks source link

Paypal Actions not available through callbacks. No way to force-fail callbacks. #15

Open 123Spork opened 4 years ago

123Spork commented 4 years ago

Trying to force a payment rejection in onShippingChange. The goal is to reject purchases outside of a certain address like the use case here: https://developer.paypal.com/docs/checkout/integration-features/shipping-callback/.

This is not possible to do as the actions are locked off. I'm using typescript.


//in react element
onShippingChange={(data:OnShippingChangeData)=>{
    actions.reject() //not available
    throw new Error() //not caught and forcing a rejection
    return null //not handled as a failure
}}`
andrewangelle commented 4 years ago

@123Spork Will take a look. Thanks for reporting.