braintree / braintree-web

A suite of tools for integrating Braintree in the browser
https://developer.paypal.com/braintree/docs/start/hello-client/javascript/v3
MIT License
442 stars 134 forks source link

Is braintree-web a replacement for braintree_php, or do they work together? #494

Closed jamminjames closed 4 years ago

jamminjames commented 4 years ago

General information

Issue description

Is braintree-web a replacement for braintree_php, or do they work together? I can't get fetchPaymentMethods to work. Is it supposed to show the client a list of their saved payment methods?

I have a drop-in and these scripts in the header:

<script src="https://js.braintreegateway.com/web/3.11.0/js/client.min.js"></script>
<script src="https://js.braintreegateway.com/web/dropin/1.22.1/js/dropin.min.js"></script>
<script src="https://js.braintreegateway.com/web/3.11.0/js/vault-manager.min.js"></script>

And I'm using this example I saw:

braintree.dropin.create({authorization: client_token, selector: '#bt-dropin'}, function (err, client) {
    braintree.vaultManager.create({client: client}, function (err, vm) {
       vm.fetchPaymentMethods(function (err, paymentMethods) {
           paymentMethods // an array of payment methods
    })
  })
})

But it's only producing the same thing I had before, a form the customer has to fill out with credit card info. But I'd like to let them choose from saved payment methods.

Also, I'm unclear on how to incorporate the hostedFieldsInstance.

Thanks for any help.

hollabaq86 commented 4 years ago

👋 @jamminjames, please contact Braintree Support for assistance. They can help you troubleshoot your integration and walk you through the process of integrating with Braintree's client and server SDKs.