React Native Payment WebView Component for Edviron Gateway
npm install ed-react-native-sdk-v2
curl --location 'https://dev-vanilla.edviron.in/erp/create-collect-request' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0cnVzdGVlSWQiOiJ4eHh4eHh4eHh4eHh4eCIsIkluZGV4T2ZBcGlLZXkiOjksImlhdCI6MTcxMjU1NzM3OSwiZXhwIjoxNzQ0MTE0OTc5fQ.pi6v80UtWFODc9EH1fh1z7evj7HpLgiMS_uc60EKSHc
' \
--data '{
"school_id":"xxxxxxxxxxxxx",
"amount":"1",
"callback_url":"https://google.com",
"student_id":"s123456",
"receipt":"r12",
"sign":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY2hvb2xfaWQiOiJ4eHh4eHh4eHh4eHh4IiwiYW1vdW50IjoiMSIsImNhbGxiYWNrX3VybCI6Imh0dHBzOi8vZ29vZ2xlLmNvbSJ9.HC_L8o-PY5ncRzdMT9nVXs6HG3qzl51WNKn2lG3g13s"
}'
`
For more information read the official documentation
View Docs
Step 2: Install the React-native-SDK from npm & install dependency
`
npm i ed-react-native-sdk-v2
`
Add Native-webview package using
`
npm i react-native-webview
`
Step 3: To open the upi app
For Android
$3
`
`
For IOS
$3
`
LSApplicationQueriesSchemes
tez
phonepe
paytm
gpay
`
Step 4: Pass the Collectid along with mode,onSuccess & OnFailure function.
`
import { Payment } from "ed-react-native-sdk-v2";
collectId={"xxxxxxxxxxxxxxxxxxxxxx"}
onSuccess={() => {
//success function
console.log('success');
}}
onFailure={() => {
//failure function
console.log('failure');
}}
//mode
// sandbox for development
//production for production
mode={'production'}
/>
``