Stripe doesn't require full addresses by default, but many businesses choose to always submit payments with full addresses. The Stripe module should support this.

I am looking at a couple ways of implementing this feature. The most straightforward seems to be adding the address data to the call to Stripe.createToken(). These fields do not need to be prevented from submitting to Drupal, as they are not considered sensitive data.

EDIT: this turned out to be way simpler than i thought. Patch will be up shortly.

Comments

aviindub’s picture

Issue summary: View changes
aviindub’s picture

patch.

aviindub’s picture

Status: Active » Needs review
iler’s picture

Status: Needs review » Fixed

This is now fixed in RC6.

RaSpirit’s picture

This is wrong!

              if (optionalFields.hasOwnProperty(stripeName)) {
                var formInputElement = $('[id^=' + optionalFields[stripeName] + ']');
                if (formInputElement) {
                  cardValues[stripeName] = formInputElement.val();
                }

It causes send address values equal to "undefined" to stripe if no address elements found in dom and stripe does not accept any card. Use if (formInputElement.length) instead, since jQuery returns object even if no element was found by given selector. Also not sure about code added above that, please make sure it is correct.

aviindub’s picture

Status: Fixed » Needs work
aviindub’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

andyg5000’s picture

Note, this only works if you have the customer profile billing checkout pane on the same page as payment and doesn't not work with a multi-step checkout process. Perhaps we should add the address as js settings and use it if form elements aren't available on the payment page?

andyg5000’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.92 KB

Currently this only works when the customer billing pane is on the same checkout page as the payment pane. Here's a patch that exports the billing address to Drupal.settings.commerce_stripe_address and uses those values whenever the billing form fields are missing from the DOM.

pnigro’s picture

Exporting the billing address to the js settings also helps when the billing address is displayed with custom markup. I tested patch #10 with commerce_stripe-7.x-1.x-dev (2015-Jan-21) and I get the following:

checking file commerce_stripe.js
Hunk #2 FAILED at 103.
1 out of 2 hunks FAILED
checking file commerce_stripe.module

Thank you for the patch,

Paul

  • aviindub committed cd8d6e8 on 7.x-1.x authored by andyg5000
    Issue #2168339 by aviindub, andyg5000: Pass full address to stripe along...
aviindub’s picture

Status: Needs review » Closed (fixed)

code looks good. i dont have a multi-step checkout process set up to test with, but you seem trustworthy :)

aviindub’s picture

Status: Closed (fixed) » Fixed
aviindub’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc7

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

svouthi’s picture

I am interested in Stripe's processing controls for ZIP code and CVC verification. I am still using test mode at Stripe.com (but plan to go live soon), and haven't seen that Stripe receives billing address data (which includes the ZIP code.) I have a multi-step checkout process, and patched my setup with #10.

I now see in addition to POST/v1/charges, POST/v1/tokens at Stripe.com/test/payments/*. When I click on the latter, I now see my public key, payment_user_agent, the last four digits of the card number, the CVC (as asterisks), the card's expiration month and year, and the cardholder name. The address_zip_check still shows as null, as does the other address info.