expo-openpay
v0.1.23
Published
Expo module for Openpay integration
Maintainers
Readme
expo-openpay
Expo module for integrating Openpay payments in React Native / Expo projects.
Supports: iOS, Android, and Expo-managed workflow.
Installation
Managed Expo Projects
If you are using the Expo-managed workflow, you can install:
npm install expo-openpay react-native-svg
# or
yarn add expo-openpay react-native-svgreact-native-svg is required to display card logos.
No additional linking is required for Expo-managed projects.
Bare React Native Projects For bare React Native projects:
npm install expo-openpay react-native-svg
# or
yarn add expo-openpay react-native-svgAfter installing, run CocoaPods for iOS:
npx pod-installFollow any extra React Native setup for Expo modules if needed.
Usage Basic Example
import ExpoOpenpay, { ExpoOpenpayView } from "expo-openpay";
// Initialize Openpay (example)
ExpoOpenpay.initialize({
merchantId: "YOUR_MERCHANT_ID",
publicKey: "YOUR_PUBLIC_KEY",
production: false,
});
// Use the component in JSX
export default function PaymentScreen() {
return (
<ExpoOpenpayView
amount={100}
cardType="visa"
onPaymentSuccess={(response) => console.log("Success", response)}
onPaymentError={(error) => console.log("Error", error)}
/>
);
}Notes This module requires react-native-svg to render card logos.
Peer dependencies: react, react-native, expo, react-native-svg.
API ExpoOpenpay.initialize(config) – Initialize with your Openpay keys.
ExpoOpenpayView – React component for payment UI.
Other exports from ./components and ./ExpoOpenpayModule are also available for advanced usage.
Contributing Contributions are welcome! Please read the contributing guide.
License MIT
