npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mogi/react-native-payumoney

v0.0.2

Published

React native wrapper for payumoney sdk

Downloads

6

Readme

[Note]: Archiving in favour of official sdk and lack of time to maintain, see #63


react-native-payumoney

Build Status Greenkeeper badge


Installation

If Upgrading from 0.0.3

Make sure to remove existing package first.

Install package:

$ npm i @mogi/react-native-payumoney --save

Only For RN <= 0.59

$ react-native link @mogi/react-native-payumoney

Add following line in Podfile

pod 'PayUmoney_PnP'

Then, run the following command:

$ pod install

RN >= 0.60

No need to do anything

Making Payment Request

  1. Import PayuMoney module to your component:

    import PayuMoney from 'react-native-payumoney';
  2. Call PayuMoney() method with the payment options. Method returns a Promise

const payData = {
    amount: '10.0',
    txnId: '1594976828726',
    productName: 'product_info',
    firstName: 'firstname',
    email: '[email protected]',
    phone: '9639999999',
    merchantId: '5960507',
    key: 'QylhKRVd',
    successUrl: 'https://www.payumoney.com/mobileapp/payumoney/success.php',
    failedUrl: 'https://www.payumoney.com/mobileapp/payumoney/failure.php',
    isDebug: true,
    hash:
        '461d4002c1432b3393cf2bfaae7acc4c50601c66568fb49a4a125e060c3bfc0e489290e7c902750d5db3fc8be2f180daf4d534d7b9bef46fa0158a4c8a057b61',
}

Payumoney(payData).then((data) => {
    // Payment Success
    console.log(data)
}).catch((e) => {
    // Payment Failed
    console.log(e)
})

Validating Hash

Don't use in production just for testing purpose

import {HashGenerator} from 'react-native-payumoney';

HashGenerator({
    key: "QylhKRVd",
    amount: "10.0",
    email: "[email protected]",
    txnId: "1594976828726",
    productName: "product_info",
    firstName: "firstname",
    salt: "seVTUgzrgE",
})

// output: 461d4002c1432b3393cf2bfaae7acc4c50601c66568fb49a4a125e060c3bfc0e489290e7c902750d5db3fc8be2f180daf4d534d7b9bef46fa0158a4c8a057b61

Server side function to get Hash Key

function makeHash($key, $txnid, $amount, $productinfo, $firstname, $email){
    $salt = "XXXXXX"; //Please change the value with the live salt for production environment

    $payhash_str = $key . '|' . checkNull($txnid) . '|' . checkNull($amount) . '|' . checkNull($productinfo) . '|' . checkNull($firstname) . '|' . checkNull($email) . '|||||||||||' . $salt;

    $hash = strtolower(hash('sha512', $payhash_str));
    return $hash;
}

function checkNull($value)
{
    if ($value == null) {
        return '';
    } else {
        return $value;
    }
}

Troubleshooting

{ success: 0 } or { success: false }

This is very common error, when your server side hash is calculated in-correctly or when trying to use Web Merchant KEY + SALT on sandbox in Android
Please use Following KEY, SALT, MERCHANT ID generated by PayU for sandbox usage
Or you can always ask them for new pair of KEY & SLAT for Android usage

  MID : 5960507
  Key : QylhKRVd
  Salt : seVTUgzrgE

Below is the test card details for doing a test transaction in the testing mode.

  Card No - 4242 4242 4242 4242
  Expiry - 22/2222 // any date in future
  CVV - 999 // any 3 digits
  Name - Test // anything

Merchant Key missing in release mode

Edit android/app/proguard-rules.pro and add

-keep class com.surajtiwari.reactnativepayumoney.** { *; }

see issue #43

Could not find com.payumoney.sdkui:plug-n-play:1.6.1.

Add jcenter() in your android/build.gradle

see example

Running example

1. Install dependencies

$ cd ./example && npm install

2. Run it on Android

$ cd ./example && npm run android