braintree / braintree-web-drop-in

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

updateConfiguration cannot update credit card properties #906

Closed phigrofi closed 1 year ago

phigrofi commented 1 year ago

General information

Issue description

After initializing the dropin, our users are able to select if they want a subscription or a single purchase. If they only do a single purchase we do not want to vault their payment method. For paypal this works fine:

dropinInstance.updateConfiguration("paypal", "flow", "checkout");

or

dropinInstance.updateConfiguration("paypal", "flow", "vault");

We would like to do the same for credit cards, but we can't figure out how to use updateConfiguration in this case.

We tried:

dropinInstance.updateConfiguration("card", "vault", { vaultCard: true }); 

But this does not seem to have an effect. Also the documentation of updateConfiguration states that allowed values for property are paypal, paypalCredit, applePay, or googlePay but not card.

I would be grateful for any hint, how to achieve this.

jplukarski commented 1 year ago

Hey @phigrofi , thanks for bringing this question to us. You are correct that updateConfiguration is only available for paypal, paypalCredit, applePay, or googlePay. What I can suggest is instead of vaulting cards on the client-side, to instead conditionally vault the cards on your server side using paymentMethod.create() with the nonce that is generated in the cases where you would like to vault the payment.

I hope that suggestion works for you. Let us know if there are any additional questions.

phigrofi commented 1 year ago

Hi @jplukarski Ok thanks a lot for your feedback. I will try the server side solution.

jplukarski commented 1 year ago

You're welcome, @phigrofi. I am going to close this issue. If you have any additional questions feel free to open a new one or reach out to our Support Team.