SkillAgentSearch skills...

Gmopg

:credit_card: Simple Nodejs wrapper for GMO Payment Gateway API.

Install / Use

/learn @pepabo/Gmopg
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GMO Payment Gateway API Client: Unofficial

Simple Nodejs wrapper for GMO Payment Gateway API.

<a href="https://www.npmjs.com/package/gmopg" title="npm"><img src="http://img.shields.io/npm/v/gmopg.svg?style=for-the-badge"></a> <a href="https://github.com/pepabo/gmopg/actions" title="actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/pepabo/gmopg/build.yml?branch=main&label=Test&style=for-the-badge"></a> <a href="https://codecov.io/gh/pepabo/gmopg" title="codecov.io"><img src="https://img.shields.io/codecov/c/gh/pepabo/gmopg.svg?style=for-the-badge"></a> <a href="https://github.com/pepabo/gmopg/blob/main/MIT-LICENSE" title="MIT License"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge"></a>

Installation

$ npm install gmopg

Usage

Purchase example

Node.js

const {default: GMOPG, ENUMS} = require('gmopg');

const gmopg = new GMOPG({
  baseUrl: 'https://p01.mul-pay.jp',
  SiteID: 'Your SiteID',
  SitePass: 'Your SitePass',
  ShopID: 'Your ShopID',
  ShopPass: 'Your SitePass',
})

const orderID = 'Order ID'
const amount  = 1234

gmopg.entryTran({
  OrderID: orderID,
  JobCd: ENUMS.JobCd.Auth,
  Amount: amount
}).then((entryRes) => {
  gmopg.execTran({
    AccessID: entryRes.AccessID,
    AccessPass: entryRes.AccessPass,
    OrderID: orderID,
    Method: ENUMS.Method.Lump,
    CardNo: '1234123412341234',
    Expire: '2024',
    SecurityCode: '123'
  }).then((execRes) => {
    gmopg.alterTran({
      AccessID: entryRes.AccessID,
      AccessPass: entryRes.AccessPass,
      JobCd: ENUMS.JobCd.Sales,
      Amount: amount
    }).then((alterRes) => {
      console.log(alterRes)
    })
  })
})

TypeScript

import GMOPG, {ENUMS} from 'gmopg'

const gmopg = new GMOPG({
  baseUrl: 'https://p01.mul-pay.jp',
  SiteID: 'Your SiteID',
  SitePass: 'Your SitePass',
  ShopID: 'Your ShopID',
  ShopPass: 'Your ShopPass'
})

const orderID = 'Order ID'
const amount = 1234

const entryRes = await gmopg.entryTran({
  OrderID: orderID,
  JobCd: ENUMS.JobCd.Auth,
  Amount: amount
})

const execRes = await gmopg.execTran({
  AccessID: entryRes.AccessID,
  AccessPass: entryRes.AccessPass,
  OrderID: orderID,
  Method: ENUMS.Method.Lump,
  CardNo: '1234123412341234',
  Expire: '2024',
  SecurityCode: '123'
})

const alterRes = await gmopg.alterTran({
  AccessID: entryRes.AccessID,
  AccessPass: entryRes.AccessPass,
  JobCd: ENUMS.JobCd.Sales,
  Amount: amount
})

Config

name | description | environ | default --- | --- | --- | --- baseUrl | baseurl for request | GMOPG_ENDPOINT | https://pt01.mul-pay.jp http.timeout | timeout for request | GMOPG_TIMEOUT | 180000 (ms) http.headers | headers for request | - | see code :eyes: SiteID | PG site id | GMOPG_SITEID | undefined SitePass | PG site pass | GMOPG_SITEPASS | undefined ShopID | PG shop id | GMOPG_SHOPID | undefined ShopPass | PG shop pass | GMOPG_SHOPPASS | undefined

Contribution

  1. Fork (https://github.com/pepabo/gmopg/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the main branch
  5. Run test suite with the npm ci command and confirm that it passes
  6. Create a new Pull Request

Author

linyows

View on GitHub
GitHub Stars36
CategoryDevelopment
Updated1y ago
Forks20

Languages

TypeScript

Security Score

75/100

Audited on Mar 30, 2025

No findings