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

react-phajay

v1.0.6

Published

πŸš€ Official React TypeScript SDK for PhaJay Payment Gateway πŸ’³ | Easy integration for QR Payments, Payment Links & Credit Cards in Laos πŸ‡±πŸ‡¦ | Support BCEL, JDB, LDB banks | Real-time WebSocket monitoring | Production-ready with TypeScript | react-phajay

Readme

React PhaJay

Official React TypeScript SDK for PhaJay Payment Gateway - Supporting Payment QR, Payment Link and Credit Card services in Lao PDR.

πŸ” NPM Package: react-phajay | πŸš€ Install: npm install react-phajay

npm version Downloads TypeScript License: MIT

Features

  • 🏦 Payment Links - Single integration for all major Lao banks
  • πŸ“± QR Code Payments - Bank-specific QR codes with real-time monitoring
  • πŸ’³ Credit Card Payments - Secure 3DS credit card processing
  • ⚑ React Components - Ready-to-use components with TypeScript support
  • 🎨 Customizable - Style with CSS classes, Tailwind CSS, or styled-components

Installation

Install the official react-phajay npm package:

npm install react-phajay

Or search for "react-phajay" on npmjs.com

Quick Start

1. Setup Provider

import { PhaJayProvider } from 'react-phajay';

function App() {
  return (
    <PhaJayProvider config={{ secretKey: "your-secret-key" }}>
      {/* Your payment components */}
    </PhaJayProvider>
  );
}

2. Payment Components

import { PaymentQR, PaymentLink, PaymentCreditCard } from 'react-phajay';

// QR Code Payment
<PaymentQR 
  amount={50000}
  description="Coffee Payment"
  bank="BCEL"
  onSuccess={(response) => {
    console.log('QR Code:', response.qrCode);
    // Display QR code in your UI
  }}
  onPaymentSuccess={(data) => {
    console.log('Payment completed!', data);
  }}
/>

// Payment Link (redirects to payment page)
<PaymentLink 
  amount={100000}
  description="Order Payment"
  onSuccess={(response) => {
    // Auto redirects to payment page
    console.log('Redirecting to:', response.redirectURL);
  }}
/>

// Credit Card Payment (redirects to card form)
<PaymentCreditCard 
  amount={100}  // Amount in USD
  description="Premium Service"
  onSuccess={(response) => {
    // Auto redirects to card payment
    console.log('Payment URL:', response.paymentUrl);
  }}
/>

3. Custom Styling

// Using CSS classes
<PaymentQR 
  amount={25000}
  bank="BCEL"
  className="bg-blue-500 text-white px-4 py-2 rounded"
  onSuccess={(response) => console.log(response.qrCode)}
>
  Generate QR Code
</PaymentQR>

// Using Tailwind CSS
<PaymentLink 
  amount={50000}
  className="bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white font-bold py-3 px-6 rounded-lg shadow-lg transform transition-all duration-200 hover:scale-105"
>
  Create Payment Link
</PaymentLink>

Configuration

Get your secret key from PhaJay Portal:

  1. Register and complete KYC verification
  2. Go to Key Management to get your secret key
  3. Configure callback URLs in Settings
// Basic configuration
const client = new PhaJayClient({
  secretKey: 'your-secret-key' // Required
});

Supported Banks

| Code | Bank Name | |------|-----------| | BCEL | Banque pour le Commerce ExtΓ©rieur Lao | | JDB | Joint Development Bank | | LDB | Lao Development Bank | | IB | Indochina Bank | | STB | ST Bank Laos |

Component Props Reference

PaymentQR

| Prop | Type | Required | Description | |------|------|----------|-------------| | amount | number | βœ… | Payment amount in LAK | | bank | string | βœ… | Bank code (BCEL, JDB, LDB, IB, STB) | | description | string | βœ… | Payment description | | onSuccess | (response) => void | βœ… | Required: Handle QR code data | | onPaymentSuccess | (data) => void | ❌ | Real-time payment callback | | className | string | ❌ | Custom CSS classes | | children | ReactNode | ❌ | Button text (default: "Generate QR Code") |

PaymentLink

| Prop | Type | Required | Description | |------|------|----------|-------------| | amount | number | βœ… | Payment amount in LAK | | description | string | βœ… | Payment description | | onSuccess | (response) => void | ❌ | Payment link created callback | | autoRedirect | boolean | ❌ | Auto redirect (default: true) | | className | string | ❌ | Custom CSS classes | | children | ReactNode | ❌ | Button text (default: "Create Payment Link") |

PaymentCreditCard

| Prop | Type | Required | Description | |------|------|----------|-------------| | amount | number | βœ… | Payment amount in USD | | description | string | βœ… | Payment description | | onSuccess | (response) => void | ❌ | Payment URL created callback | | autoRedirect | boolean | ❌ | Auto redirect (default: true) | | className | string | ❌ | Custom CSS classes | | children | ReactNode | ❌ | Button text (default: "Pay with Credit Card") |

Error Handling

import { PhaJayAPIError } from 'react-phajay';

try {
  const paymentLink = await client.paymentLink.createPaymentLink({
    amount: 50000,
    description: 'Test payment'
  });
} catch (error) {
  if (error instanceof PhaJayAPIError) {
    console.error('API Error:', error.code, error.message);
  }
}

Support & Documentation

License

MIT License - see the LICENSE file for details.


πŸ” Search & Discovery

NPM Package: react-phajay

Search Terms: react-phajay npm, phajay react sdk, react payment gateway laos, npm react payment, phajay typescript

Made with ❀️ by PhaJay Payment Gateway