Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Pay "Payment not completed" when region value is not recognized #1534

Closed
lojel opened this issue Apr 19, 2021 · 3 comments
Closed

Apple Pay "Payment not completed" when region value is not recognized #1534

lojel opened this issue Apr 19, 2021 · 3 comments
Labels
component: payment request buttons Issues related to Payment Request Buttons - e.g. Apple Pay, Google Pay needs feedback The issue/PR needs a response from any of the parties involved in the issue. type: bug The issue is a confirmed bug.

Comments

@lojel
Copy link

lojel commented Apr 19, 2021

We have multiple online stores and and ship to multiple countries but for this case we will compare our US store to our Hong Kong store. The Apple Pay payments in the US never fail on the user side, however multiple users in Hong Kong reported that the Apple Pay payment failed repeatedly so we investigated and here is what we found:

1) PAYMENTS FAILS WHEN REGION VALUE IS NOT RECOGNIZED BY APPLE PAY

  • The Apple Pay form for billing/shipping in the US has a "state" field with a dropdown list that contains all the existing states. This ensure that Apple Pay always recognize the selected value.

  • However outside the US the state field is often replaced with "region" but this field is blank instead and needs to be manually filled by the customer.

  • A comparison the form in the US and in Hong Kong for instance:
    image
    image

  • Let's take Hong Kong as an example here to illustrate the issue cause this is where we debugged this. However it could be any other country or territory with a blank "Region" field in the Apple Pay form.

  • In Hong Kong there are 3 official regions: Hong Kong Island, Kowloon, and New Territories. When the region is filled with one of these value then the payment goes through however the issue happen cause in reality most people type these regions differently. It’s very common that people use "KL" instead of "Kowloon" or "HK" instead of "Hong Kong Island" which result in a payment failure cause the region doesn't match the one recognized by Apple Pay.

2) PAYMENT FAILURES FOR THE REASON DESCRIBED ABOVE ARE NOT LOGGED

Even more concerning, the payment failures for this specific issue are not logged by the plugin so it's very difficult to debug it or even acknowledge that the problem even exist. It is possible that at the moment multiple Woocommerce stores shipping outside the US have Apple Pay payment failures on a regular basis.

3) THE USER IS NOT INFORMED WHY THE PAYMENT IS FAILING

On the user-side, the Apple Pay flyout window just displays “Payment Not Completed” (see attached below) with no further information on the user level and no record of failed payment in Woocommerce. It's like the payment attempt never happened for Woocommerce.
image

4) HOW WE TEMPORARILY FIXED THAT

We have temporarily fixed that on our side by programmatically fixing the region name when it's incorrectly entered (e.g. "KL" is replace and fixe with the recognized regions "Kowloon") and default the region name to "New Territories" when the value entered is not recognized in our script. However this only fixes the issue in Hong Kong for us but every time we expend our shipping to a new country with the same issue we will need to deploy a similar fix.

5) THE NEXT STEPS FOR US

  • Display meaningful error messages to the customer for Apple Pay instead of “Payment not completed”. This way the customer himself will be able to take corrective actions and make his payment.

  • Notify our development team when Apple Pay payment failures occur so we can take preventive actions.


📝 That being said some stores might be loosing sales at the moment because of this issue so I think fixing this on the plugin level would be a major improvement for stores using Apple Pay but also for the users.

Please let us know what you can do. Thanks

@lojel lojel changed the title "Payment not completed" when region doesn't match existing value Apple Pay "Payment not completed" when region doesn't match existing value Apr 19, 2021
@lojel lojel changed the title Apple Pay "Payment not completed" when region doesn't match existing value Apple Pay "Payment not completed" when region value is not recognized Apr 19, 2021
@ricardo
Copy link
Member

ricardo commented Apr 19, 2021

@lojel thanks for reporting.

Are you using Stripe Gateway version 5.1.0?

We have fixed some state matching related issues in our latest release.

  1. PAYMENTS FAILS WHEN REGION VALUE IS NOT RECOGNIZED BY APPLE PAY

Unfortunately it's not possible for us to automatically detect and replace these types of inputs, since variations like these can be infinite, customers can use abbreviated values like KL, values without accents or some localized variation we cannot predict, but we need to make sure the expected values are properly stated.

  1. PAYMENT FAILURES FOR THE REASON DESCRIBED ABOVE ARE NOT LOGGED

I think this is a regular customer validation error. Much like if zip code is in invalid format. If we decide to log this error, it makes sense to apply the same logging for all customer validation errors. Although it might not be necessary if the issue is properly reported to the user (by closing the Apple Pay dialog automatically and displaying the specific error).

  1. THE USER IS NOT INFORMED WHY THE PAYMENT IS FAILING

The "Payment Not Completed" error message is default to Apple. A more specific error message is displayed to the user behind the Apple Pay dialog. For me (iPhone X, iOS 14.4.2), the Apple Pay dialog is closed automatically right after an error happens. Perhaps that's not the case for all iOS versions and device types.

As action steps, I think we need to make sure we can close the Apple Pay dialog automatically on all iOS devices, displaying the error message behind it.

@ricardo ricardo added needs feedback The issue/PR needs a response from any of the parties involved in the issue. type: bug The issue is a confirmed bug. component: payment request buttons Issues related to Payment Request Buttons - e.g. Apple Pay, Google Pay labels Apr 19, 2021
@lojel
Copy link
Author

lojel commented Apr 27, 2021

@ricardo thanks for the feedback. Here is further information:

  1. That makes sense. I guess there is nothing we can do for this specific reason but we can probably solve this on the user level by informing that the region is properly typed and not recognized.

  2. For this one we will try to add some frontend error handling that lets us know about users having problems with wallet payment methods. That's important for us to make sure we don't loose sales because of the payment method. If our code works well, we will open up a PR against the plugin repo so you can decide whether you want to add this feature or not.

  3. For this one we figured that it's our issue. We have a JS error that's preventing the Apple Pay validation messages from being displayed correctly. Sorry about the false alarm on this one we are going to fix that for ourselves.

@ricardo
Copy link
Member

ricardo commented Apr 27, 2021

That's important for us to make sure we don't loose sales because of the payment method. If our code works well, we will open up a PR against the plugin repo so you can decide whether you want to add this feature or not.

Sounds good. Feel free to open a PR if you come up with any improvements.

For this one we figured that it's our issue. We have a JS error that's preventing the Apple Pay validation messages from being displayed correctly. Sorry about the false alarm on this one we are going to fix that for ourselves.

Ok. I'll close this issue as this is not a problem with the plugin specifically.

@ricardo ricardo closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: payment request buttons Issues related to Payment Request Buttons - e.g. Apple Pay, Google Pay needs feedback The issue/PR needs a response from any of the parties involved in the issue. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants