diff --git a/js/NativeBridge/index.js b/js/NativeBridge/index.js index 759b5bd9..6005548a 100644 --- a/js/NativeBridge/index.js +++ b/js/NativeBridge/index.js @@ -9,6 +9,7 @@ const IS_ANDROID = Platform.OS === 'android'; const NativePayments: { canMakePayments: boolean, + applePayEnabled: () => boolean, canMakePaymentsUsingNetworks: boolean, openPaymentSetup: void, supportedGateways: Array, @@ -40,6 +41,13 @@ const NativePayments: { }); }, + applePayEnabled() { + if (Platform.OS === 'ios') { + return ReactNativePayments.canMakePayments; + } + return false; + }, + // TODO based on Naoufal's talk on YouTube the intention of canMakePayments is for it to work like this, so I'm thinking we can integrate Yegor's code into canMakePayments. // NF 2020-11-18 canMakePaymentsUsingNetworks(usingNetworks: []) { diff --git a/js/PaymentRequest/index.js b/js/PaymentRequest/index.js index 040643d0..f4de9f7d 100644 --- a/js/PaymentRequest/index.js +++ b/js/PaymentRequest/index.js @@ -534,6 +534,7 @@ export default class PaymentRequest { ); } + static applePayEnabled = NativePayments.applePayEnabled; static canMakePaymentsUsingNetworks = NativePayments.canMakePaymentsUsingNetworks; static openPaymentSetup = NativePayments.openPaymentSetup; }