1๐
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
There are some things worth noting about setting the default payment method.
- The first payment method created for a customer is set as the default
- When you generate the client token you can pass in an option to make the last used payment method the default payment method
- The API also lets you update a payment method and set the default for a customer
Hopefully that helps
1๐
Add the defaultFirst
option to the braintree.setup
and your set default payment method will be automatically selected and show in the drop-in UI.
braintree.setup("{{ client_token }}", "dropin", {
container: "checkout",
form: "checkoutForm",
defaultFirst: true
});
Feature added in braintree JS v2.24.0
Documentation: https://developers.braintreepayments.com/reference/client-reference/javascript/v2/configuration#setup-method-options
Source: https://github.com/braintree/braintree-web/issues/76#issuecomment-244162120
0๐
i Solved this issue by deleting the payment method immediate after failed or successful transaction.
views.py
payment_method_result = braintree.Transaction.sale({
"customer_id": merchant_customer_id,
"amount": am,
"options": {
"submit_for_settlement": True
}
})
# print dir(payment_method_result.transaction)
# print payment_method_result
# print payment_method_result.transaction
try:
result = braintree.PaymentMethod.delete(payment_method_result.transaction.credit_card['token'])
except:
pass
as it was one time payment, it did not affected much by deleting the user payment method.
In transaction anyway i can see the details.
Hope this will help some one.
- [Answered ]-Django drf login template
- [Answered ]-Why not calling save() on one model, while calling on another
- [Answered ]-Google ReCAPTCHA validation failed with Django
- [Answered ]-How to mock an external api in django?
- [Answered ]-Incremented CharField