Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add zipcode and billing address to stripe payment form

I am trying to setup stripe payment on my website http://www.phpgang.com/how-to-integrate-stripe-payment-gateway-in-php-1_1027.html

i tested it with demo and live and it work perfect, But i am trying to add zip code in the form I want to send the user billing address and zip code to stripe to verify it

<form action="charge.php" method="POST">
  <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="pk_test_7JKeM9chawSzwFaDDJAxpa3K"
    data-image="http://www.phpgang.com/wp-content/themes/PHPGang_v2/img/logo.png"
    data-name="PHPGang.com"
    data-description="Download Script ($15.00)"
    data-amount="1500">
  </script>

</form>
like image 787
user3356619 Avatar asked Mar 11 '23 21:03

user3356619


1 Answers

Stripe's Checkout form has a number of configuration options. To collect ZIP/postal codes, simply add data-zip-code="true" to the list of attributes. Here's a basic example.

Note that the field for the ZIP/postal code will only appear if it is needed, as not all countries use it. Checkout uses the first 6 digits of the card number (the "BIN") to determine the card's country and show or hide the ZIP code field. In the example above, start typing 424242 for the card number and the field will appear.

like image 57
Ywain Avatar answered May 14 '23 14:05

Ywain