How to use the braintree-web/google-payment.create function in braintree-web

To help you get started, we’ve selected a few braintree-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github braintree / braintree-web-drop-in / src / views / payment-sheet-views / google-pay-view.js View on Github external
buttonType: 'short'
  }, self.googlePayConfiguration.button, {
    onClick: function (event) {
      event.preventDefault();

      self.preventUserAction();

      self.tokenize().then(function () {
        self.allowUserAction();
      });
    }
  });

  self.model.asyncDependencyStarting();

  return btGooglePay.create({
    client: self.client,
    googlePayVersion: googlePayVersion,
    googleMerchantId: merchantId
  }).then(function (googlePayInstance) {
    self.googlePayInstance = googlePayInstance;
    self.paymentsClient = createPaymentsClient(self.client);
  }).then(function () {
    var buttonContainer = self.getElementById('google-pay-button');

    buttonContainer.appendChild(self.paymentsClient.createButton(buttonOptions));

    self.model.asyncDependencyReady();
  }).catch(function (err) {
    self.model.asyncDependencyFailed({
      view: self.ID,
      error: new DropinError(err)