Welcome to the easiest way to add Apple Pay to your React Native iOS app for smooth, secure payments.
npm install rn-ios-apple-pay
yarn add rn-ios-apple-pay
import React from 'react';
import { useApplePay } from 'rn-ios-apple-pay';
const App = () => {
const { initiateApplePayPayment, isApplePayAvailable } = useApplePay();
const available = isApplePayAvailable();
// Example usage:
const handlePayment = async () => {
const paymentResult = await initiateApplePayPayment();
/* provide amount, currencyCode, merchantId, countryCode */
// Handle payment result
};
return (
<>
<Button onPress={handlePayment} title="Make Payment" />
</>
);
};
export default App;
{
"paymentData": {
"data": "",
"signature": "",
"header": {
"publicKeyHash": "",
"ephemeralPublicKey": "",
"transactionId": ""
},
"version": ""
},
"paymentMethod": {
"displayName": "",
"network": "",
"type": ""
},
"transactionIdentifier": ""
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT