Allowing customer to choose previously saved default payment method when using hosted fields
See original GitHub issueThis is not strictly a bug report, but more of the question. I’m trying to figure out how to show previously stored payment methods for the customer in the web app that’s using v3 JS SDK. While that’s easy with the drop-in UI, I was not able to find anything in the documentation for the hosted fields approach.
There are two ways that I found:
- Send a list of payment methods associated with the customer from the server.
- I’m not sure this is secure, as
CreditCard
object on the server-side returns reusabletoken
and not a nonce.
- Upon reading the drop-in v3 plugin source code, I found this:
this._client.request({
endpoint: 'payment_methods',
method: 'get',
data: {
defaultFirst: 1
}
}, function (err, paymentMethodsPayload) {
...
});
- Why there’s no public method in the client object (or elsewhere) that does exactly this?
- Is it OK to use the snippet above as-is?
- Any potential compliancy issues if this snippet is used without the
braintree-web-drop-in
?
Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Permissions for the Hosted Card Payments Component
The Hosted Card Payments component requires default object permissions from the Hosted Payment User Permission set. It also requires non-default object ...
Read more >braintree-web/hosted-fields - Documentation
A field for postal or region code. A field for the cardholder name on the customer's credit card.
Read more >Save payment details during payment | Stripe Documentation
Use the Payment Intents API to save payment details from a purchase. There are several use cases: Charge a customer for an e-commerce...
Read more >Hosted Payment Pages 2.0 Settings - Knowledge Center - Zuora
In Zuora Quotes, you can configure to allow your users to add a payment method, e.g., a credit card, while creating a quote....
Read more >Hosted Fields - Braintree Developer Documentation
Data collected using Hosted Fields is sent directly from your client to Braintree, so your customers' raw payment information never touches your server....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We just released a vault-manager component to assist with this:
See http://braintree.github.io/braintree-web/current/VaultManager.html for docs
At the moment we don’t have a public method just to retrieve payment methods, but it is something we’ve discussed. In the meantime, we recommend using a request from the client shown in this CodePen, which is the same method we use in Drop-in. There are not any compliance issues using the client to retrieve this data.