Stripe Should collect Full billling address - Country overwritten by s2member

If using the “Stripe should collect full billing address” option on Stripe pro-form -
s2member will overwrite the country by either US if no “default_country_code” is specified in the pro-form or by the default country if specified in the default_country_code

  • no matter what the payer chooses on checkout. (that means no matter what the payer chooses as address in the stripe address popup - it will be set to US or default country)

How to verify: Simply set the default country code to whatever country - then choose another country on checkout.
Or do not specify a country code - and end up with US as buyer country.

Therefore only credit card country and IP address are ending up with valid country information.
Note - this bug does not affect the old address information that can be gathered by setting a tax rate.

Note - there are to country fields in Stripe (or even three).
1 “country” - this is the country where the credit card used is issued
2. “address_country” - this is the country chosen for address
3. “billing_country” - this is the country chosen for billing address if different from 2.

  1. and 3. are overwritten by s2member after clicking on add payment (or maybe never recorded and never sent to Stripe?).

oh yeah - forgot to say. The exact same problem of course also happens with “full shipping address”. So shipping address right now is useless - if you don’t know whether or not the country is correct!
Of course with wrong country in billing address - also tax calculations run afterwards will end up wrong.

I’m kinda sure the bug is the same reason as this one:

s2member has some sort of hook that overwrites the country - if the country information is gathered before the credit card data has been gathered in the popup - thereby overwriting whatever information was given in the country field.

I guess this happens because of the old “taxes workaround” to get address and it’s default “US” or default whatever set - will overwrite the country after clicking on add XX $ in the popup.