Skip to content

0xanonymeow/react-native-omise-payment-gateway

Repository files navigation

react-native-omise-payment-gateway

This React Native app demonstrates how to integrate with the Omise payment gateway.



Installation

Install dependencies

npm install

Run patch-package to apply patches to omise-react-native SDK

npx patch-package  

Specify Omise API Keys

You will need to obtain a public and secret key from the Omise dashboard to use this app.

  1. Sign up for an Omise account and login
  2. Go to Dashboard > Settings > Keys
  3. Copy your Public and Secret keys
  4. 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 a simulator

Run on an iOS simulator

npm run ios

Run on an Android simulator

npm run android

Run on a device

Download Expo Go

Download the Expo Go app on your iOS or Android device. https://expo.dev/client


Run the server

This will start a development server for you.

npm start

Connect to your server

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.


How to use

Add a card

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


Charge a card

You can charge a card by tapping the card added to the list.



Remove a card

If you press and hold a card, you can remove it from the list.



References

Omise React Native

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published