All Projects → Suraj-Tiwari → react-native-payumoney

Suraj-Tiwari / react-native-payumoney

Licence: MIT license
React Native Payumoney (Android/IOS)

Programming Languages

kotlin
9241 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
typescript
32286 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to react-native-payumoney

adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (+250%)
Mutual labels:  payment, payment-gateway, payment-integration, payment-module
cybersource-android-sdk
The CyberSource InApp SDK enables developers to simply and securely incorporate mobile payments into their Android applications.
Stars: ✭ 25 (+38.89%)
Mutual labels:  payment, payment-gateway, payment-integration, payment-module
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (+144.44%)
Mutual labels:  payment, payment-gateway, payment-integration, payment-module
Paynow-NodeJS-SDK
NodeJS SDK for Zimbabwe's leading payments gateway, Paynow
Stars: ✭ 23 (+27.78%)
Mutual labels:  payment, payment-gateway, payment-integration
adyen-node-api-library
Adyen API Library for Node.js
Stars: ✭ 82 (+355.56%)
Mutual labels:  payment, payment-gateway, payment-integration
omnipay-2checkout
2Checkout driver for the Omnipay PHP payment processing library
Stars: ✭ 25 (+38.89%)
Mutual labels:  payment, payment-gateway, payment-integration
nagadApi
This is Bangladeshi nagad payment gateway api development library. This library can be used in any php application.
Stars: ✭ 20 (+11.11%)
Mutual labels:  payment, payment-gateway, payment-integration
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (+127.78%)
Mutual labels:  payment, payment-gateway, payment-integration
EPAYMENT
EPayment - Multi Payment Provider for .Net Core
Stars: ✭ 43 (+138.89%)
Mutual labels:  payment, payment-integration, payment-module
adyen-hybris
Adyen Payment plugin for Hybris
Stars: ✭ 23 (+27.78%)
Mutual labels:  payment, payment-gateway, payment-integration
paymentgateway
Dokumentace ČSOB platební brány a jejího eAPI pro platby platebními kartami, Apple Pay, mallpay a platebními tlačítky ČSOB.
Stars: ✭ 104 (+477.78%)
Mutual labels:  payment, payment-gateway, payment-integration
ccashcow
💰 Accept cards & crypto. Payments so easy a cow could do it.
Stars: ✭ 40 (+122.22%)
Mutual labels:  payment, payment-gateway, payment-integration
midtrans-node
Unoffficial Midtrans Payment API Client for Node JS | Alternative for Midtrans Official Module | https://midtrans.com
Stars: ✭ 15 (-16.67%)
Mutual labels:  payment-gateway, payment-integration, payment-module
python-daraja
Python Wrapper for interacting with the MPESA Daraja API. More Features to be implemented
Stars: ✭ 20 (+11.11%)
Mutual labels:  payment, payment-gateway, payment-integration
stripe
Stripe integration with Magento 2
Stars: ✭ 58 (+222.22%)
Mutual labels:  payment-gateway, payment-integration, payment-module
adyen-dotnet-api-library
Adyen API Library for .NET
Stars: ✭ 69 (+283.33%)
Mutual labels:  payment, payment-gateway, payment-integration
awesome-payment
A curated list of payment services
Stars: ✭ 22 (+22.22%)
Mutual labels:  payment, payment-gateway, payment-integration
wc-moldovaagroindbank
WooCommerce maib Moldova Agroindbank Payment Gateway
Stars: ✭ 13 (-27.78%)
Mutual labels:  payment, payment-gateway, payment-integration
Gringotts
A complete payment library for Elixir and Phoenix Framework
Stars: ✭ 396 (+2100%)
Mutual labels:  payment, payment-gateway
Authnetjson
Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.
Stars: ✭ 14 (-22.22%)
Mutual labels:  payment, payment-gateway

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


react-native-payumoney

npm dowloads npm version Build Status Greenkeeper badge


Installation

If Upgrading from 0.0.3

Make sure to remove existing package first.

Install package:

$ npm i react-native-payumoney --save

Only For RN <= 0.59

$ react-native link 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].