Reputation: 183
I want to validate the billing address of the user. But I am unable to validate that, I have validate zipcode. In my php code I have set billingAddress = true but still it is not verifying my billing address.
Upvotes: 3
Views: 11287
Reputation: 1501
I just want to add this for people wondering how to send the zip code in for validation.
var options = {
name: document.getElementById('name').value,
address_line1: document.getElementById('address-line1').value,
address_line2: document.getElementById('address-line2').value,
address_city: document.getElementById('address-city').value,
address_state: document.getElementById('address-state').value,
address_zip: document.getElementById('address-zip').value,
address_country: document.getElementById('address-country').value,
};
stripe.createToken(cardNumberElement, options).then(...);
Upvotes: 1
Reputation: 1
Block if :address_line1_check: = 'fail'
This will make sure that the bank verifies that address on the card is accurate.
Upvotes: 0
Reputation: 17503
Stripe itself cannot check the ZIP or billing address - only the bank that issued the card can do so. If you supply a ZIP and/or billing address, Stripe will forward that information to the bank, which might or might not use it. It varies by country and by bank.
If you supply the ZIP and address and the results of the address_zip_check
and address_line1_check
attributes is unavailable
, that means the bank did not use the information that was provided.
Upvotes: 3