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

Drop-in UI not showing default payment #157

Closed p4sh4 closed 8 years ago

p4sh4 commented 8 years ago

This has been identified as an issue and fixed in the Android SDK. Any updates on when it is going to be fixed in the JavaScript Drop-In UI?

JoshuaGRubin commented 8 years ago

+1

mrak commented 8 years ago

This fix is planned to go out with the next JS SDK release.

crookedneighbor commented 8 years ago

This feature has been added in version 2.24.0

The docs will be released shortly, but in the meantime, here's how you would configure it:

var clientToken = "client_token_from_server"; // this client token must have the customer id parameter configured
braintree.setup(clientToken, 'dropin', {
  defaultFirst: true
});
aashidham commented 6 years ago

@crookedneighbor How would I use defaultFirst for v3 drop-in? I don't see it mentioned in the docs: https://braintree.github.io/braintree-web-drop-in/docs/current/module-braintree-web-drop-in.html#.create

crookedneighbor commented 6 years ago

defaultFirst is the only way payment methods are shown: https://github.com/braintree/braintree-web-drop-in/blob/39ca485487ea4107288e32b8a0b1fb368474d138/src/dropin-model.js#L286

aashidham commented 6 years ago

@crookedneighbor

Is this true for https://js.braintreegateway.com/web/dropin/1.11.0/js/dropin.min.js as well? Because it isn't working on my end. The first payment method I see is not the default method. Furthermore, the default method is not checked.

As a side note, why are the dropin files versioned seperately from the whole client SDK? Does 1.11 of the dropin correlate to the most recent v3 Client SDK?

aashidham commented 6 years ago

@crookedneighbor

Here is what I am doing to set the dropin up:

braintree.dropin.create({
                authorization: client_token_server,
                container: '#dropin-container', 
                venmo: {}, paypal: {flow: 'vault'}, paypalCredit: {flow: 'vault'},
              }, function (createErr, instance) { [...] })

Is there something I'm missing in the setup?

crookedneighbor commented 6 years ago

Please open a new issue on Drop-in's repo and we'll dig into it: https://github.com/braintree/braintree-web-drop-in

Drop-in uses version 3 of braintree-web, but is itself it's own product. Which is why it has a separate repo and version.

cosmin-novac commented 3 years ago

@crookedneighbor

Here is what I am doing to set the dropin up:

braintree.dropin.create({ authorization: client_token_server, container: '#dropin-container', venmo: {}, paypal: {flow: 'vault'}, paypalCredit: {flow: 'vault'}, }, function (createErr, instance) { [...] }) Is there something I'm missing in the setup?

Did you manage to solve this?

crookedneighbor commented 3 years ago

I've been out of office. It's been added as a feature on master, but has not been released yet. Hoping to get a release out next week or so.

https://github.com/braintree/braintree-web-drop-in/pull/675