Skip to content

Commit

Permalink
Merge pull request #13 from appfolio/applePayEnabled
Browse files Browse the repository at this point in the history
Add applePayEnabled static method to PaymentRequest. [MITM-866]
  • Loading branch information
trcoffman authored Nov 14, 2023
2 parents fe91b8c + 035a8e4 commit 9e30aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/NativeBridge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const IS_ANDROID = Platform.OS === 'android';

const NativePayments: {
canMakePayments: boolean,
applePayEnabled: () => boolean,
canMakePaymentsUsingNetworks: boolean,
openPaymentSetup: void,
supportedGateways: Array<string>,
Expand Down Expand Up @@ -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: []) {
Expand Down
1 change: 1 addition & 0 deletions js/PaymentRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export default class PaymentRequest {
);
}

static applePayEnabled = NativePayments.applePayEnabled;
static canMakePaymentsUsingNetworks = NativePayments.canMakePaymentsUsingNetworks;
static openPaymentSetup = NativePayments.openPaymentSetup;
}
Expand Down

0 comments on commit 9e30aa7

Please sign in to comment.