JSPM

lianlianpay-thailand-sdk

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q55688F
  • License MIT

Node.js SDK for LianLian Pay (LLGP) payment gateway supporting all payment methods in Thailand

Package Exports

  • lianlianpay-thailand-sdk
  • lianlianpay-thailand-sdk/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lianlianpay-thailand-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LianLianPay Thailand SDK

Node.js SDK สำหรับ LianLian Pay (LLGP) payment gateway ที่รองรับวิธีการชำระเงินทั้งหมดในประเทศไทย

คุณสมบัติ

  • วิธีการชำระเงิน: Checkout, Bankcard, Alipay, WeChat Pay, QR PromptPay, Mobile Banking, Line Pay, Shopee Pay, TrueMoney, Counter Pay
  • Payout: โอนเงินผ่านธนาคารและ TrueMoney
  • Refund: การคืนเงิน
  • ความปลอดภัย: RSA-SHA1 signing และ verification
  • TypeScript: รองรับ TypeScript เต็มรูปแบบ

การติดตั้ง

npm install lianlianpay-thailand-sdk

การตั้งค่า

  1. รับข้อมูลประจำตัว LianLian Pay

    • สมัครสมาชิกที่ LianLian Pay Thailand
    • ทำการยืนยันตัวตนของพ่อค้า
    • รับข้อมูลประจำตัว API ของคุณ
  2. กำหนดค่าข้อมูลประจำตัวของคุณ

    const { LLPayClient, LLPayConstant, CheckoutPayRequest, Customer } = require('lianlianpay-thailand-sdk');
    
    // เริ่มต้น client
    const client = new LLPayClient(
      false, // true สำหรับ production
      'your-merchant-private-key',
      'lianlian-public-key'
    );

เริ่มต้นใช้งาน

const { LLPayClient, LLPayConstant, CheckoutPayRequest, Customer } = require('lianlianpay-thailand-sdk');

// เริ่มต้น client
const client = new LLPayClient(
  false, // production environment
  'your-merchant-private-key',
  'lianlian-public-key'
);

// สร้างการชำระเงิน checkout
const checkoutRequest = {
  merchant_id: 'your-merchant-id',
  service: LLPayConstant.CHECKOUT_PAY_SERVICE,
  version: LLPayConstant.SERVICE_VERSION,
  merchant_order_id: 'ORDER_' + Date.now(),
  order_currency: 'THB',
  order_amount: '100.00',
  order_desc: 'Test payment',
  notify_url: 'https://your-domain.com/notify',
  redirect_url: 'https://your-domain.com/redirect',
  customer: {
    full_name: 'John Doe',
    merchant_user_id: 'user123'
  }
};

// ดำเนินการชำระเงิน
client.execute(checkoutRequest)
  .then(result => {
    if (result.code === 200000 && result.sign_verify) {
      console.log('Payment successful:', result.data);
    } else {
      console.error('Payment failed:', result);
    }
  })
  .catch(error => {
    console.error('Error:', error);
  });

ตัวอย่าง

ดูตัวอย่างการใช้งานในโฟลเดอร์ example/:

cd example
npm install
npm start

วิธีการชำระเงิน

การชำระเงินออนไลน์

  • Checkout Pay - ประตูการชำระเงินสากล
  • Bankcard Pay - บัตรเครดิต/เดบิต
  • Alipay Online - การรวม Alipay
  • WeChat Pay - การรวม WeChat Pay
  • QR PromptPay - การชำระเงิน QR code ไทย
  • Mobile Banking - แอปมือถือธนาคารไทย (KBank, SCB, Krungsri)
  • Line Pay - การรวม Line Pay
  • Shopee Pay - การรวม Shopee Pay
  • TrueMoney - กระเป๋าเงิน TrueMoney

การชำระเงินออฟไลน์

  • Alipay Offline - การสร้าง QR code
  • Counter Pay - การชำระเงินที่ร้านสะดวกซื้อ

บริการเพิ่มเติม

  • Payment Query - ตรวจสอบสถานะการชำระเงิน
  • Payout - โอนเงินผ่านธนาคารและ TrueMoney
  • Refund - การประมวลผลคืนเงิน

การอ้างอิง API

LLPayClient

คลาสหลักสำหรับการดำเนินการ LLGP ทั้งหมด

Constructor

new LLPayClient(productionEnv, merchantPrivateKey, lianLianPublicKey)
  • productionEnv (boolean): true สำหรับ production, false สำหรับ sandbox
  • merchantPrivateKey (string): RSA private key ของพ่อค้า
  • lianLianPublicKey (string): Public key ของ LLGP สำหรับการตรวจสอบลายเซ็น

Methods

  • execute(request): ดำเนินการคำขอการชำระเงิน/payout/refund ใดๆ

การสนับสนุนและเอกสาร

ใบอนุญาต

MIT


LianLianPay Thailand SDK

Node.js SDK for LianLian Pay (LLGP) payment gateway supporting all payment methods in Thailand.

Features

  • Payment Methods: Checkout, Bankcard, Alipay, WeChat Pay, QR PromptPay, Mobile Banking, Line Pay, Shopee Pay, TrueMoney, Counter Pay
  • Payout: Bank transfer and TrueMoney payout
  • Refund: Payment refund processing
  • Security: RSA-SHA1 signing and verification
  • TypeScript: Full TypeScript support with type definitions

Installation

npm install lianlianpay-thailand-sdk

Setup

  1. Get LianLian Pay Credentials

  2. Configure Your Credentials

    const { LLPayClient, LLPayConstant, CheckoutPayRequest, Customer } = require('lianlianpay-thailand-sdk');
    
    // Initialize client
    const client = new LLPayClient(
      false, // true for production
      'your-merchant-private-key',
      'lianlian-public-key'
    );

Quick Start

const { LLPayClient, LLPayConstant, CheckoutPayRequest, Customer } = require('lianlianpay-thailand-sdk');

// Initialize client
const client = new LLPayClient(
  false, // production environment
  'your-merchant-private-key',
  'lianlian-public-key'
);

// Create checkout payment
const checkoutRequest = {
  merchant_id: 'your-merchant-id',
  service: LLPayConstant.CHECKOUT_PAY_SERVICE,
  version: LLPayConstant.SERVICE_VERSION,
  merchant_order_id: 'ORDER_' + Date.now(),
  order_currency: 'THB',
  order_amount: '100.00',
  order_desc: 'Test payment',
  notify_url: 'https://your-domain.com/notify',
  redirect_url: 'https://your-domain.com/redirect',
  customer: {
    full_name: 'John Doe',
    merchant_user_id: 'user123'
  }
};

// Execute payment
client.execute(checkoutRequest)
  .then(result => {
    if (result.code === 200000 && result.sign_verify) {
      console.log('Payment successful:', result.data);
    } else {
      console.error('Payment failed:', result);
    }
  })
  .catch(error => {
    console.error('Error:', error);
  });

Demo

Run the demo files to test different payment methods:

# Test payment methods
npm test

# Run example
npm run example

API Reference

LLPayClient

Main client class for all LLGP operations.

Constructor

new LLPayClient(productionEnv, merchantPrivateKey, lianLianPublicKey)
  • productionEnv (boolean): true for production, false for sandbox
  • merchantPrivateKey (string): Your merchant RSA private key
  • lianLianPublicKey (string): LLGP public key for signature verification

Methods

  • execute(request): Execute any payment/payout/refund request

Payment Methods

Checkout Pay

Universal payment gateway supporting multiple payment methods.

Bankcard Pay

Direct credit/debit card payments.

Alipay Online/Offline

Alipay integration for online and offline payments.

WeChat Pay

WeChat Pay integration.

QR PromptPay

Thai QR code payments.

Mobile Banking

Thai bank mobile app payments (KBank, SCB, Krungsri).

Line Pay

Line Pay integration.

Shopee Pay

Shopee Pay integration.

TrueMoney

TrueMoney wallet payments.

Counter Pay

Counter payment at convenience stores.

Support & Documentation

License

MIT