This React Native app demonstrates how to integrate with the Omise payment gateway.
npm install
npx patch-package
You will need to obtain a public and secret key from the Omise dashboard to use this app.
- Sign up for an Omise account and login
- Go to Dashboard > Settings > Keys
- Copy your Public and Secret keys
- Create a
.env
file in the root of the project and add the keys:
OMISE_PUBLIC_KEY=your_public_key
OMISE_SECRET_KEY=your_secret_key
For more details on obtaining and using Omise keys, see https://www.omise.co/how-to-access-omise-api-keys
Run on an iOS simulator
npm run ios
Run on an Android simulator
npm run android
Download the Expo Go app on your iOS or Android device. https://expo.dev/client
This will start a development server for you.
npm start
Open the Expo Go app on your device and scan the QR code in your terminal to open your project.
Your app will reload if you save edits to your files, and you will see build errors and logs in the terminal.
Sometimes you may need to rebuild or restart the development server to see changes in the app.
You can add a credit card by specifying the card details. The information needs to be in the correct pattern. This app is connected to the Omise payment gateway in a testing environment. Do not specify real credit card data!
Example card data:
Visa
Card Number: 4249 2577 8082 2614
Holder Name: John Doe
Card Expiry: 11/2026
CVV/CVV2: 731
You can charge a card by tapping the card added to the list.
If you press and hold a card, you can remove it from the list.
source: https://github.com/tnylee/omise-react-native
The omise-react-native
SDK is incomplete. I have updated some parts to allow the app to create charges.
The change is made and updated here https://github.com/0xanonymeow/react-native-omise-payment-gateway/blob/main/patches/omise-react-native%2B0.1.0.patch