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

Only display Apple Pay payment method if supported #10

Closed

Conversation

rvdsteege
Copy link
Member

@rvdsteege rvdsteege commented Jun 10, 2022

In pronamic/wp-pronamic-pay-adyen#11 it was discussed that Apple Pay is currently available at checkout, even though this might not be supported by the browser/device.

This PR makes sure to only displays Apple Pay if the device is capable of making Apple Pay payments by:

  • implementing canMakePayment in the WooCommerce checkout block;
  • using a hidden field to determine Apple Pay availability in legacy checkout.

Note: the changes do not verify if there is an active card through https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778000-canmakepaymentswithactivecard as this would require the merchantIdentifier, a customer might also want to set up Apple Pay on their device if Apple Pay is listed as an accepted payment method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only display Apple Pay payment method if supported
2 participants