react-native-payumoney-getway
v1.0.6
Published
React Native Payumoney Getway
Downloads
17
Readme
react-native-payumoney-getway
Getting started
$ npm install react-native-payumoney-getway --save
Usage
import PayumoneyGetway from 'react-native-payumoney-getway';
// TODO: What to do with the module?
let sendData = {
key : "<your key>",
amount: "<pay amount>",
email : "<[email protected]>",
txnId: "<create rand id>",
productName: "<product Name>",
firstName: "<first Name>",
salt:"<go to developer console then put salt>",
debug: "<test mode is true and live is false boolean value>",
mobile: "<user mobile pls not use 1234567890>"
};
// url is hash Generation
let respons = await PayumoneyGetway.Pay(sendData, url = "https://example.com/payu.php");
console.log('respons', respons);
hash Generation php code
<?php
$key=""; //add key here from your credentials in payUMoney dashboard
$salt=""; // add salt here from your credentials in payUMoney dashboard
$txnId=$_POST["txnid"];
$amount=$_POST["amount"];
$productName=$_POST["productInfo"];
$firstName=$_POST["firstName"];
$email=$_POST["email"];
$udf1=$_POST["udf1"];
$udf2=$_POST["udf2"];
$udf3=$_POST["udf3"];
$udf4=$_POST["udf4"];
$udf5=$_POST["udf5"];
$payhash_str = $key . '|' . checkNull($txnId) . '|' .checkNull($amount) . '|' .checkNull($productName) . '|' . checkNull($firstName) . '|' . checkNull($email) . '|' . checkNull($udf1) . '|' . checkNull($udf2) . '|' . checkNull($udf3) . '|' . checkNull($udf4) . '|' . checkNull($udf5) . '||||||'. $salt;
function checkNull($value) {
if ($value == null) {
return '';
} else {
return $value;
}
}
$hash = strtolower(hash('sha512', $payhash_str));
$arr['result'] = $hash;
$arr['status']=0;
$arr['errorCode']=null;
$arr['responseCode']=null;
$output=$arr;
echo json_encode($output);
?>
Issues url
If your any problem create Issues
Android
- VERY IMPORTANT Edit the following to your
build.gradle
's repositories section. (android/build.gradle)
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 20 // <---- edit this line
compileSdkVersion = 29
targetSdkVersion = 29
}
...
}
- VERY IMPORTANT Add following this line In your
android/app/src/main/ AndroidManifest.xml
.....
<uses-permission android:name="android.permission.INTERNET" />
<application ....>
<activity android:name="com.payumoneygetwaymoney.PayAction" />
....
IF any issues like
Manifest merger failed : Attribute application@usesCleartextTraffic value=(true) from AndroidManifest.xml
Comment out this line
Supporting the project
Maintaining this project takes time. To help allocate time, you can Buy Me a Coffee :wink: