Skip to content

Commit d1cdbce

Browse files
Merge pull request #308 from checkout/fix/apple-pay-mada-supportsEMV
Fix Apple Pay MADA supportsEMV
2 parents 23a850f + 14f66d3 commit d1cdbce

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

includes/class-wc-gateway-checkout-com-apple-pay.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,15 @@ public function payment_fields() {
9999
}
100100

101101
// get country of current user.
102-
$country_code = WC()->customer->get_billing_country();
103-
$supported_networks = [ 'amex', 'masterCard', 'visa' ];
102+
$country_code = WC()->customer->get_billing_country();
103+
$supported_networks = [ 'amex', 'masterCard', 'visa' ];
104+
$merchant_capabilities = [ 'supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit' ];
104105

105106
if ( $mada_enabled ) {
106107
array_push( $supported_networks, 'mada' );
107108
$country_code = 'SA';
109+
110+
$merchant_capabilities = array_values( array_diff( $merchant_capabilities, [ 'supportsEMV' ] ) );
108111
}
109112

110113
?>
@@ -172,11 +175,12 @@ public function payment_fields() {
172175
function getApplePayConfig() {
173176

174177
var networksSupported = <?php echo json_encode( $supported_networks ); ?>;
178+
var merchantCapabilities = <?php echo json_encode( $merchant_capabilities ); ?>;
175179

176180
return {
177181
currencyCode: "<?php echo get_woocommerce_currency(); ?>",
178182
countryCode: "<?php echo $country_code; ?>",
179-
merchantCapabilities: ['supports3DS', 'supportsEMV', 'supportsCredit', 'supportsDebit'],
183+
merchantCapabilities: merchantCapabilities,
180184
supportedNetworks: networksSupported,
181185
total: {
182186
label: window.location.host,

0 commit comments

Comments
 (0)