-
Notifications
You must be signed in to change notification settings - Fork 43
Feature: Apple Pay #225
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
Feature: Apple Pay #225
Conversation
Apple Pay does not provide an expiry date
will be added to several plugins for WC 2.7 compat
…ment card This is per Apple’s UI guidelines
* Add calculation for cart and checkout * Add a Test Mode setting * Add SONP support * Clean up files * Simplify some logic
# Conflicts: # woocommerce/i18n/languages/woocommerce-plugin-framework.pot
|
@ChaseWiseman looks great, and SONP works well 🎉 really nice stuff here, the taxes and shipping handling in the Apple Pay modal is 💯 One fix: the accepted currencies is failing, I think perhaps due to the supported / enabled Apple Pay gateway check: As a final note, one thing we may want to disable Apple Pay on Membership-granting products like Subscriptions (not needed before deploy, we can follow with an update for AIM / CIM). The code here could likely benefit from a helper -- something like That way we could bail on the product / cart / checkout. We could also consider making that Memberships |
maxrice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 this looks awesome, great work @ChaseWiseman! Really well-organized and the CoffeeScript is aces.

This PR adds handlers to support Apple Pay on the checkout, cart, and single product pages.
Gateway Implementation
SV_WC_Payment_Gatewayby usingself::FEATURE_APPLE_PAYSV_WC_Payment_Gateway::get_order_for_apple_pay()method to add any data necessary for processing the transaction via the gateway's API. SeeSV_WC_Payment_Gateway_Apple_Pay_Payment_Responsefor returned data.By default, the feature is inactive and will need to be activated by a filter:
add_filter( 'wc_payment_gateway_{gateway_id}_activate_apple_pay', '__return_true' );This makes the WooCommerce -> Settings -> Checkout -> Apple Pay settings section available for configuration.
The classes and JS handle the entire Apple Pay flow, and when successful simply calls
SV_WC_Payment_Gateway::process_payment(). From there the gateway handles everything like a normal transaction, and it's up to the gateway to set the appropriate API params with the data it sets inSV_WC_Payment_Gateway::get_order_for_apple_pay().Limitations