Saving handler in useEffect()
The current implementation contains this:
useEffect(() => {
savedHandler.current = handler;
}, [handler]);
Is there any reason this has to be in a useEffect()? I would just do:
savedHandler.current = handler;
I would think that would be quicker to just store handler every time than having useEffect() check to see if it's changed.
Or am I missing something?
+1 had to make extra API calls to get around this problem.
I also had this problem. Ended up just updating through the customer API:
$result = Braintree_Customer::update('the_customer_id', array(
'creditCard' => array(
'paymentMethodNonce' => 'nonce-received-from-your-client',
'options' => array(
'updateExistingToken' => 'the_payment_method_token',
'verifyCard' => true
)
)
));
Please excuse my slow response to the original issue.
This was a documentation issue after the original launch that we've since corrected. @mdluna77 is correct that in order to use a paymentMethodNonce to update an existing Braintree_PaymentMethod, one must pass in the updateExistingToken option with the existing token via a call to Braintree_Customer::update.
If you have any further issues with your integration don't hesitate to contact us either by email ([email protected]) or by phone (877.434.2894).
Best!
Hello, I am dealing with this same issue. Could it have been broken again?
@TylerScottSullivan, if you're having this issue, it is most likely something specific to your integration. Our technical support team is the best to help you work through this. Feel free to email ([email protected]) or call (877.434.2894).
+1 work in sandbox with fake nonces but not with real nonces.
@mairo744 please reach out to our technical support team to figure out what is going wrong: https://developer.paypal.com/braintree/help