Incorrect validation logic for Apple / Google Pay

Created on 27 August 2024, 4 months ago

Problem/Motivation

After configuring Stripe with the test keys and correcty enabling domains in Stripe dashboard, the payment works fine with a test credit card, but when selecting either Apple Pay or Google Pay, a message "Another step will appear to securely submit your payment information." will appear but the submit button will stay disabled.

Steps to reproduce

Create a webform with a Stripe Payment element with Google/Apple Pay enabled and try to validate your form, the submit button will be disabled.

Proposed resolution

After digging in the code, we found this:

  paymentElement.on('change', event => payButton.disabled = event.empty || event.error);

This logic seems incorrect as event.empty refere to the fact that no payment information has been entered.
What we're looking for seems more likely to be that the information is complete hence checking event.complete.

Remaining tasks

MR to do

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France tostinni

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024