https://github.com/pepabo/gmopg
:credit_card: Simple Nodejs wrapper for GMO Payment Gateway API.
https://github.com/pepabo/gmopg
Last synced: about 1 month ago
JSON representation
:credit_card: Simple Nodejs wrapper for GMO Payment Gateway API.
- Host: GitHub
- URL: https://github.com/pepabo/gmopg
- Owner: pepabo
- License: mit
- Created: 2017-10-03T10:33:22.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2022-12-26T09:32:06.000Z (over 2 years ago)
- Last Synced: 2025-04-15T03:04:05.053Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://www.gmo-pg.com/
- Size: 307 KB
- Stars: 36
- Watchers: 22
- Forks: 21
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
GMO Payment Gateway API Client: Unofficial
==========================================Simple Nodejs wrapper for [GMO Payment Gateway][gmopg] API.
[gmopg]: https://www.gmo-pg.com/
Installation
------------```sh
$ npm install gmopg
```Usage
-----Purchase example
### Node.js
```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 = 1234gmopg.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
```ts
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 = 1234const 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 | undefinedContribution
------------1. Fork (https://github.com/pepabo/gmopg/fork)
1. Create a feature branch
1. Commit your changes
1. Rebase your local changes against the main branch
1. Run test suite with the `npm ci` command and confirm that it passes
1. Create a new Pull RequestAuthor
------[linyows](https://github.com/linyows)