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 🙏

© 2026 – Pkg Stats / Ryan Hefner

reactjs-payment-gateway

v1.0.4

Published

A React payment gateway component for Omniware payment processing

Readme

ReactJS Payment Gateway

A React component for integrating with Omniware payment gateway.

TypeScript Support

The package includes TypeScript definitions for all payment parameters matching the Swift SDK structure.

Installation

npm install reactjs-payment-gateway

Complete Integration Guide

Basic Setup

  1. Install the package:
npm install reactjs-payment-gateway
  1. Import the payment function in your component:
import PaymentGateway, { PaymentGatewayParams } from 'reactjs-payment-gateway';

Payment Initialization

Prepare the payment data object with all required parameters:

const paymentData: PaymentGatewayParams = {
  api_key: '<API_KEY>',
  return_url: '<RETURN_URL>',
  mode: '<LIVE || TEST>',
  name: '<NAME>',
  phone: '<PHONE>',
  city: '<CITY>',
  country: '<COUNTRY>',
  state: '<STATE>',
  email: '<EMAIL>',
  zip_code: '<ZIP_CODE>',
  description: '<DESCRIPTION>',
  currency: '<CURRENCY>',
  amount: '<AMOUNT>',
  address_line_1: '<ADDRESS_LINE_1>',
  address_line_2: '<ADDRESS_LINE_2>',
  order_id: '<ORDER_ID>'
};

Hash Generation

Please contact support for assistance with this particular query.

Payment Initialization

const handlePayment = async () => {
  // Use the SALT only for hash generation
  paymentData.hash = await generatehash(paymentData);
  
  // Remove the SALT from the paymentData object after generating the hash
  delete paymentData.salt;
  
  try {
    const result = await PaymentGateway.initiatePayment(<PAYMENT_URL: String>, <PAYMENT_PARAMS: PaymentGatewayParams>);
    console.log(result.success ? 'Payment successful!' : 'Payment failed');
  } catch (error) {
    console.error('Payment error:', error.message);
  }
};

Initiating Payment

Call the payment function with your payment data and gateway URL:

try {
  
  await PaymentGateway.initiatePayment(<PAYMENT_URL: String>, <PAYMENT_PARAMS: PaymentGatewayParams>);

} catch (error) {
  // Handle errors
  console.error('Payment error:', error);
}

Required Fields

  • api_key: Your merchant API key (from environment variables)
  • return_url: URL to redirect after payment
  • mode: 'LIVE' or 'TEST'
  • amount: Payment amount as string
  • currency: Currency code (e.g. 'INR')
  • order_id: Unique order ID
  • description: Payment description
  • address_line_1: Billing address line 1
  • address_line_2: Billing address line 2
  • city: Billing city
  • state: Billing state
  • country: Billing country code
  • zip_code: Billing zip code
  • name: Customer name
  • email: Customer email
  • phone: Customer phone number
  • hash: SHA-512 hash of sorted payment parameters

Return URL Endpoint Setup

To handle payment responses, you need to create an endpoint that can process POST requests and pass that url as return_url in the paymentData. Follow these general steps:

  1. Create a server-side endpoint that accepts POST requests
  2. Configure the endpoint to receive and parse form data
  3. Validate the payment status from the received data
  4. Store transaction details securely
  5. Implement appropriate response handling

Make sure your endpoint is accessible over HTTPS and can handle the expected request format from the payment gateway.

Security Measures

Protecting Sensitive Information

Always store sensitive data like API keys, salts, and payment URLs in environment variables. Never hardcode them in your source code. Follow these best practices:

  1. Create a .env file in your project root:
API_KEY=your_api_key
PAYMENT_URL=your_payment_url
SALT=your_salt_value
  1. Add .env to your .gitignore file to prevent accidental commits

  2. Access environment variables in your code:

const paymentData = {
  api_key: process.env.API_KEY,
  // ... other parameters
};
  1. Use secure environment variable management in production

  2. Regularly rotate your API keys and salts

  3. Implement proper access controls for sensitive data

License

MIT