File tree Expand file tree Collapse file tree
modules/ppcp-wc-payment-tokens/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,11 +95,12 @@ function ( $tokens ) use ( $container ) {
9595
9696 $ is_post = isset ( $ _SERVER ['REQUEST_METHOD ' ] ) && $ _SERVER ['REQUEST_METHOD ' ] === 'POST ' ;
9797
98- // Exclude ApplePay tokens from payment pages.
99- if (
100- ( is_checkout () || is_cart () || is_product () )
101- && ! $ is_post // Don't check on POST so we have all payment methods on form submissions.
102- ) {
98+ // Exclude ApplePay tokens from payment pages, regardless of request method.
99+ // Apple Pay tokens are only usable for merchant-initiated subscription renewals,
100+ // never buyer-selectable at checkout. The classic checkout re-renders its payment
101+ // fields via a POST `update_order_review` AJAX call, so a `! $is_post` guard would
102+ // let the token leak back into the selectable saved-methods list.
103+ if ( is_checkout () || is_cart () || is_product () ) {
103104 foreach ( $ tokens as $ index => $ token ) {
104105 if ( $ token instanceof PaymentTokenApplePay ) {
105106 unset( $ tokens [ $ index ] );
You can’t perform that action at this time.
0 commit comments