question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Braintree Javascript SDK v2 OnCancelled not triggered

See original GitHub issue

General information

  • SDK version: Javascript SDK v 2.32.1
  • Environment: Sandbox
  • Browser and OS: Chrome on MacOS (10.13.6) High Sierra

Issue description

Hi, We have implemented Braintree Javascript SDK v2 in one of our application, We are using custom setup for paypal, the issue is that when user cancels or close the iframe, we don’t get any callback. We want to perform some specific task on cancellation but onCancelled event is not being fired.

braintree.setup(clientToken, "custom", {
      paypal: {
        singleUse: true,
        intent: "sale",
        amount: amount,
        currency: "USD",
        locale: "en_us",
        commit: true,
        enableShippingAddress: false,
        headless: true
      },
      onReady: function(integration) {
      ....
      },
      onCancelled: function(obj) {
       ....
      },
      onPaymentMethodReceived: function(payload) {
       ....
      }
    });

Another Attempt

braintree.setup(clientToken, "custom", {
      paypal: {
        onCancelled: function(obj) {
          .......
        },
       same as above
      },
      onReady: function(integration) {
        ....
      },
      onPaymentMethodReceived: function(payload) {
       ....
      }
    });

Nothing seems to work here, any help will be greatly appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crookedneighborcommented, Jan 24, 2019

There’s no planned end date for v2 (in fact, v1 still works), but it currently only receives necessary security updates, which is why I recommend upgrading to version 3 instead.

0reactions
muhammad-asad-26commented, Jan 24, 2019

Also can you please tell me when v2 will be completely gone. Like it won’t work anymore

Read more comments on GitHub >

github_iconTop Results From Across the Web

PayPal - Braintree Developer Documentation
The PayPal functionality of Braintree.js accepts a few different options. ... onCancelled, Function ... It is not fired in Drop-in integrations.
Read more >
PayPalCheckout - Documentation - Braintree Open Source
Called when the PayPal SDK has been loaded onto the page. The second argument is the PayPal Checkout instance. If no callback is...
Read more >
Migrating from checkout.js to the PayPal JS SDK | JavaScript
You are starting a new PayPal web integration. Previously, Braintree documented how to integrate with version 4 of PayPal's JavaScript SDK, called checkout.js....
Read more >
Handle the cancel event on paypal client with braintree
Instead of the onCancelled callback function like in v2, in v3 it is in the error handling where you can direct tokenization errors...
Read more >
PayPal Payment Integration using Braintree in Ionic 5 apps
Create Braintree sandbox account and get the required keys; Setup Ionic 5 project; Setup Node JS project; Creating Node JS API's for Braintree...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found