fixthestatusquo/proca

PayPal button uses the initial amount - never updating when a new amount is selected

aaronelliotross opened this issue · 0 comments

The PayPal button uses a callback (createOrder) to set the amount. That closure is used by the PayPalButton component. The buttons don't see the change in the callbacks unless the Context that PayPal is using is updated.

Ahem. I don't really know what that all means - but that's the best I got!

In my language I'd say that while the closure is recreated each time the code that contains it (and the paypal button) is run with a new amount, the paypal button doesn't see / use the newly created closure when calling the onCreateOrder callback.

That appears to be expected - the docs have examples of using forceReRender with an amount argument, even though amount isn't passed to the buttons. It's only used in the callback to create the order.

Anyway - PR coming that works around the problem for amount and for frequency.