rn-ios-apple-pay
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

rn-ios-apple-pay

Welcome to the easiest way to add Apple Pay to your React Native iOS app for smooth, secure payments.

Installation

npm install rn-ios-apple-pay
yarn add rn-ios-apple-pay

Demo

demo-ios

Usage

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;

Payment Result

{
    "paymentData": {
        "data": "",
        "signature": "",
        "header": {
            "publicKeyHash": "",
            "ephemeralPublicKey": "",
            "transactionId": ""
        },
        "version": ""
    },
    "paymentMethod": {
        "displayName": "",
        "network": "",
        "type": ""
    },
    "transactionIdentifier": ""
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i rn-ios-apple-pay

Weekly Downloads

1

Version

0.8.0

License

MIT

Unpacked Size

25.7 kB

Total Files

23

Last publish

Collaborators

  • mhmdnofal