We've recently been hit with a number of fraudulent transactions. We are being advised by Stripe to decline any order that fails the zip code verification.
But it would appear that the address information is never passed across to stripe when a charge is made. Would it be possible to enable this?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | uc_stripe.validate_address_zip_2723145_15.patch | 1.76 KB | rfay |
| #6 | Screen Shot 2016-05-12 at 9.32.27 a.m..png | 19.79 KB | sittard |
| #5 | uc_stripe.validate_address_zip_2723145_05.patch | 637 bytes | rfay |
Comments
Comment #2
sittard commentedComment #3
rfayIt seems to me the last time I checked this, there was *no* support in Stripe for verification based on address.
According to https://support.stripe.com/questions/what-is-avs it's still pretty mild. Only zipcode verification is provided, only if you have that configured in your Stripe account.
Since Zip code is not a universal concept (as the article says, "Address checks are primarily used in Canada, the UK, and the US".
So... I could see:
1. Making the postal code section of the Ubercart address somehow required. (I haven't looked to see whether this is possible, certainly not advisable for sites with international users.)
2. Advising site owners that they have the option of turning on AVS.
3. Collecting the address when so-configured
4. Delivering it in the charge.
Comment #4
rfayA problem with this approach is I don't know how to test it well with test charges. According to https://stripe.com/docs/testing there are card numbers that can explicitly fail address check, but not based on an actual address/zip, so it's a bit of a questionable technique.
@sittard, you're in the UK? Is the site with the problem accepting mostly payments in the UK? Is information available about whether a majority of UK banks will do postal code verification?
I'm fine with adding this feature, just not entirely sure it will help many people. But it might. I'm glad to see Stripe has at least added the option of verification.
Comment #5
rfayHere's a simple patch to accomplish what you want.
To use it successfully you must:
1. Add billing info to the Checkout Basic Settings (admin/store/settings/checkout)
2. Make Postal Code a required field in "Countries and Addresses" at admin/store/settings/countries/fields
3. In your Stripe account settings (on stripe.com) set it to decline cards that fail zip code verification. (https://www.evernote.com/l/AA_VuNnstW1H57k5F0TJxRyj1sZvlhyBa4UB/image.png)
You can test sort-of with the CC# 4000000000000036, but I wouldn't count on the results, since it's an automatic fail. Actual testing will require doing some testing with real credit card numbers, as far as I can tell, so this will need community review.
Comment #6
sittard commentedThank you for the quick and excellent response. I've applied the patch and it seems to work with the test cards. I do have a couple of suggestions:
If you have the Ubercart option 'Use the same address for billing and delivery by default.' or if the user has selected 'My billing information is the same as my delivery information'. Then I think an additional check is required to get the post code from the delivery pane rather than the billing pane. Testing if the checkbox 'edit-panes-billing-copy-address' is checked or not should work.
Also if the card fails verification then the error message is as follows:
I don't suppose it would be possible to show the Stripe log error message which is: "The zip code you supplied failed validation."
Will keep an eye out for any live orders.
Many Thanks
Comment #7
rfayThanks, those are good review points. (I won't be able to look at this again until next week.)
I recommend doing an actual charge attempt on your live site with a real card to see if the behavior is as expected. You can just refund with the stripe console.
Comment #8
ayesh commented@rfay's patch uses the billing address fields zip code field. Even for deliverable items, the billing address field is present, and I don't think it is correct to submit the deliver address for Stripe validation either.
Comment #9
sittard commentedSo we've had a few live orders over the last few days and I can confirm that the Zip Check appears to be working. We've had a 100% pass and a card from a country outside the UK which skipped the Zip check and payment was successful. Ideally would like to see a live card which fails the zip check. But on testing this looks OK.
@ayesh: I agree the billing postal code is correct. My comments relate to the fact that if you have the 'copy address' box checked then the 'billing post code' form element is removed from the markup. You would then have to obtain the post code from the delivery address (take a look at the form elements on checkout screen).
Comment #10
rfay@sittard, could you please try a purchase with your own credit card, and the wrong postal code? If it succeeds, just use Stripe to refund it. If it fails, that's good.
Comment #11
sittard commentedYeah - not sure about that. Bit worried it might adversely effect my own credit rating... I believe all these small triggers are linked to generate your credit score. But I'm not an expert in this area.
Comment #12
jamesoakleyI'm not sure it's necessary to do that.
From the Stripe dashboard, it's possible to see the Billing Address data (including postcode) being passed through from the website in the Charge API call.
As long as that data is coming through to Stripe correctly, this module is doing it's job. Whether Stripe then successfully block payment when the Zip doesn't match is up to them / up to the settings in the merchant's Stripe account.
I've not got time to run a test just at the moment, but presumably sittard could look at those payments that have gone through, and look at the full Stripe logs, to check that the Billing Address is coming through as it should.
Comment #13
rfayI tested (in test mode) that the billing zip is coming through to stripe, but there's no decent way in test mode to verify the actual behavior when the zip is wrong.
Comment #14
jamesoakley>> there's no decent way in test mode to verify the actual behavior when the zip is wrong
Again, I'd query whether that's an issue for this module.
If the module passes the billing information through to Stripe, then it's doing its job correctly.
Whether Stripe then react correctly to different scenarios is a matter for them, and any problems to be taken up with their support team.
If this patch gets billing data going through to Stripe, then IMO it's RTBC.
Comment #15
rfayThis patch tries to handle the various cases where billing and shipping addresses are present. It also adds the "name" field, since that shows up on the Stripe dashboard and is useful.
Comment #17
rfayCommitted #15 with minor change to README.txt.
Comment #19
sittard commentedThis is working great for us. Any chance we could now have this released. Thanks.
Comment #20
rfay7.x-2.1 should be there in a few minutes.
Thanks!
Comment #21
sittard commentedBrill - thanks.