braintree / braintree-web-drop-in

Braintree Drop-in for the web
MIT License
200 stars 127 forks source link

Device Data is never returned #926

Closed joelsantosbr closed 6 months ago

joelsantosbr commented 7 months ago

General information

Issue description

I'm using the drop-in by passing the dataCollector: true parameter as in the code below and I'm always receiving deviceData Null/undefined

Dropin sdk triggers the following error in the console: TypeError: Cannot read properties of undefined (reading 'create') at dropin.min.js:1:304859

Code:

dropin.create(
  {
    authorization: clientToken.data,
    selector: "#dropin-container",
    locale: "pt_BR",
    dataCollector: true,
    translations: {
      cvvLabel: "CVV",
      cardholderNameLabel: "Nome como impresso no cartão",
    },
    card: {
      cardholderName: {
        required: true,
      },
    },
    threeDSecure: true
  },
  function (err, dropinInstance) {
    $scope.$apply(function () {
      vm.dropinInstance = dropinInstance;

      dropinSubmitButton.addEventListener("click", function (event) {
        let requestPaymentOptions = {
          threeDSecure: {
            amount: 100,
            email: 'customer@email.com',
            collectDeviceData: true,
            dataOnlyRequested: true,
          }
        };

        dropinInstance.requestPaymentMethod(
          requestPaymentOptions,
          function (err, payload) {
            sendToServer(payload.nonce, payload.deviceData);
            // deviceData is returning null everytime
          }
        );
      });
    });
  }
);
andrejikonikov commented 6 months ago

Hi, we're having exactly same issue

jplukarski commented 6 months ago

Hey @joelsantosbr and @andrejikonikov , I am not able to reproduce this error using our Drop-In Demo -> https://braintree.github.io/braintree-web-drop-in/?dataCollector=true

As you can see, if you go through a test card, device data is captured with a correlation ID and that error does not show up in the console.

Please open a ticket with our support team with code snippets, videos demonstrating the behavior, or a test site with steps to reproduce so that we can look into your integration.