Skip to content

Commit

Permalink
Add display conditions for applepay, googleplay and fastlane
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinamiko committed Jan 24, 2025
1 parent dde1a70 commit 8cba869
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/ppcp-settings/src/SettingsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,31 @@ function( array $payment_methods ) use ( $container ) : array {
$applepay_product_status = $container->get( 'applepay.apple-product-status' );
assert( $applepay_product_status instanceof AppleProductStatus );

// Unset BCDC if merchant is eligible for ACDC.
if ( $dcc_product_status->dcc_is_active() ) {
unset( $payment_methods['ppcp-card-button-gateway'] );
}

// Unset Venmo when store location is not United States.
if ( $container->get( 'api.shop.country' ) !== 'US' ) {
unset( $payment_methods['venmo'] );
}

// Unset if not eligible for Google Pay.
if ( ! $googlepay_product_status->is_active() ) {
unset( $payment_methods['ppcp-googlepay'] );
}

// Unset if not eligible for Apple Pay.
if ( ! $applepay_product_status->is_active() ) {
unset( $payment_methods['ppcp-applepay'] );
}

// Unset Fastlane if store location is not United States or merchant is not eligible for ACDC.
if ( $container->get( 'api.shop.country' ) !== 'US' || ! $dcc_product_status->dcc_is_active() ) {
unset( $payment_methods['ppcp-axo-gateway'] );
}

return $payment_methods;
}
);
Expand Down

0 comments on commit 8cba869

Please sign in to comment.