Reputation: 285
I am using Braintree's Hosted Fields and Javascript. I am successfully able to do a successful signup and sending a payment nonce however I am unable to figure out how to have a user who already has a subscription in the Braintree portal to show up with their information preloaded in the Braintree Hosted Fields already (address, part of credit card, etc).
Upvotes: 0
Views: 690
Reputation: 86
The only address field in Hosted Fields is the postal code. You may need to build a custom form to populate the additional address values.
You can grab Vault data from your server using a payment method lookup. Then you can prefill the data in Hosted Fields.
Here is an example that shows how to use prefilled values for the expiration date:
var storedCreditCardInformation = {
// get this info from your server with a payment method lookup
month: '09',
year: '2017'
};
braintree.hostedFields.create({
client: clientInstance,
fields: {
expirationMonth: {
selector: '#expiration-month',
prefill: storedCreditCardInformation.month
},
expirationYear: {
selector: '#expiration-year',
prefill: storedCreditCardInformation.year
}
}
},
callback);
Full Disclosure: I work at Braintree. For additional questions, please feel free to contact Braintree Support [email protected].
Upvotes: 1