onPaymentMethodReceived callback not called with paypal
See original GitHub issueI have the following setup for our Braintree integration:
braintree.setup(client_token, 'custom', {
id: 'checkout',
paypal: {
container: 'paypal-container',
onPaymentMethodReceived: function(obj) {
// this is never called
console.log(obj);
}
}
});
When using the PayPal button, the payment_method_nonce
is correctly inserted and updated, but the onPaymentMethodReceived
callback is never called. It works, however, when I change the braintree.setup
call to be paypal
only, instead of custom
:
braintree.setup(client_token, 'paypal', {
container: 'paypal-container',
onPaymentMethodReceived: function(obj) {
// this is called
console.log(obj);
}
});
Any idea what I’m doing wrong?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Braintree - paymentMethodNonceReceived not being invoked
I am using below JavaScript and its working fine: braintree.setup(clientToken, "custom", { id: "my-sample-form", hostedFields: { number: { selector: ...
Read more >PayPal - Braintree Developer Documentation
A callback function that is fired immediately after a user has logged in to PayPal; it is not fired upon form submission like...
Read more >Configuration for braintree.setup - PayPal Developer
onPaymentMethodReceived, any, function, This callback is called after the successful tokenization of a payment method. When subscribed to this callback, ...
Read more >Best Practices and Troubleshooting - Braintree Developer ...
When calling braintree.setup , you can attach a callback to onReady which will ... onPaymentMethodReceived: function (payload) { // retrieve nonce from ...
Read more >Setup and Integration - Braintree Developer Documentation
For more information about these top-level callbacks, see the JavaScript SDK reference. onPaymentMethodReceived. This is called when a payment_method_nonce has ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@basco-johnkevin You can do this with v3 of the sdk.
Here’s an example using the new PayPal Checkout component:
@kyledetella I’m experiencing a similar issue.
onPaymentMethodReceived
callback is not immediately called after paypal login flow when I’m using custom integration & supporting multiple payment methods (credit card & paypal). It is called immediately though when I’m using custom integration but only support a single payment method (paypal).https://gist.github.com/anonymous/255702dbd196d3b5592f395b9ad60d3b
I’m now using
onSuccess
callback as a solution but I wanted to pre-populate our form fields with the customer’s paypal first name, last name, address, zip etc… Unfortunately, those infos are not available on theonSuccess
callback. Those info are available ononPaymentMethodReceived
. How can I fetch those details inside theonSuccess
callback?