Closed TandyCorp closed 6 years ago
I'm pretty sure that's an issue with the standard stripe card element that is being used, but I'll double check. Anyway... What are your thoughts on the postcode field within the card form? I think the postcode from the input billing address should be passed instead, but that probably means we can't keep using stripe's fancy input form :(
Thanks for replying, I thought that may be the case that the Stripe Javascript or stripe php library are where the problem occurs but wasn't sure if there was some way of stripping the whitespace somewhere before it is sent to their API.
Ideally it would be better to grab the postcode/zip from the billing address entered into the Magento checkout as a few people have been confused by being asked for their postcode again by the stripe form. The trouble is that not using their script means more to be maintained in the plug-in and I assume their javascript is required to support features such as Apple pay on an iPhone?
Stripes element documentation looks like it has been updated since I originally moved this module to the current version of stripejs. Looks like there is an option to hide the postcode field when creating the card element. Which would update the method renderer to something similar to this:
self.stripeCard = self.stripeCardElement.create('card', {
...
hidePostalCode: true,
...
});
In the createToken function, the billing address data can be added as the second argument in self.stripe.createToken(self.stripeCard)
.
I'm hoping to actually try that out and test it either tonight or tomorrow night(I'm UTC-05:00).
That sounds promising, by the way is there a reason why you have chosen to stay on stripe/stripe-php v5.2 as they are on 5.8.0 now. Perhaps worthwhile updating the composer.json require version if there are no issues.
None. They seem to iterate version numbers real quick. I pin to major.minor versions in composer.json to help prevent issues. I try to bump to the current version anytime I'm doing any meaningful testing. I'm probably being overly cautious since nothing used by this module has changed since v3.7.0.
When entering a card number the form then also asks for a postcode. The form allows the user to enter the postcode with a space, the stripe API also accepts it with the space. Verification fails as stripe store postcodes without a space. Seems the spaces need to be stripped from the postcode data sent to stripe.