It is forked from react-native-apay with extended by Payment Network (MIR) added russian payment network МИР.
Accept Payments with Apple Pay for React Native apps.
$ yarn add react-native-appay-mir
Autolinking will just do the job.
$ react-native link react-native-appay-mir
Link using Cocoapods by adding this to your Podfile
:
pod 'react-native-appay-mir', :path => '../node_modules/react-native-appay-mir'
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-appay-mir
and addAppayMir.xcodeproj
- In XCode, in the project navigator, select your project. Add
libAppayMir.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
import { ApplePay } from 'react-native-appay-mir';
const requestData = {
merchantIdentifier: 'merchant.com.example',
supportedNetworks: ['mastercard', 'visa', 'mir'],
countryCode: 'RU',
currencyCode: 'RUB',
paymentSummaryItems: [
{
label: 'Item label',
amount: '100.00',
},
],
}
// Check if ApplePay is available
if (ApplePay.canMakePayments) {
ApplePay.requestPayment(requestData)
.then((paymentData) => {
console.log(paymentData);
// Simulate a request to the gateway
setTimeout(() => {
// Show status to user ApplePay.SUCCESS || ApplePay.FAILURE
ApplePay.complete(ApplePay.SUCCESS)
.then(() => {
console.log('completed');
// do something
});
}, 1000);
});
};
You can run the demo by cloning the project and running:
$ yarn demo