TBC Payment Gateway for Node.js
Table of Contents
Installation
Get started by installing the package:
npm install --save node-tbc-payment-gateway
Usage
- Setup
- Create Transaction (SMS/DMS)
- Commit DMS Transaction
- Transaction Status
- Reverse Transaction
- Refund Transaction
- Close Day
- Card Registration
- Regular Payments
- Regular Payment Authorization
Setup
First, require the package in your file:
const TBC = ;
Then, instantiate the class providing the cert file and passphrase:
const tbc = 'cert_file' 'cert_passphrase';
You can now start working with the payment gateway.
Create Transaction
const result = await tbc // Georgian Lari ; console;/*{ TRANSACTION_ID: 'TRANSACTION_ID_HERE'}*/
Commit DMS Transaction
const result = await tbc // Georgian Lari ; console;/*{ RESULT: '...', RESULT_CODE: '...', RRN: '...', APPROVAL_CODE: '...', CARD_NUMBER: '...'}*/
If transaction has been created with registered card, use commitTransaction('TRANSACTION_ID_HERE', true)
.
Transaction Status
const result = await tbc; console;/*{ RESULT: '...', RESULT_CODE: '...', 3DSECURE: '...', RRN: '...', APPROVAL_CODE: '...', CARD_NUMBER: '...' RECC_PMNT_ID: '...' RECC_PMNT_EXPIRY: '...' MRCH_TRANSACTION_ID: '...'}*/
Reverse Transaction
const result = await tbc; console;/*{ RESULT: '...', RESULT_CODE: '...',}*/
Refund Transaction
const result = await tbc; console;/*{ RESULT: '...', RESULT_CODE: '...', REFUND_TRANS_ID: '...',}*/
Close Day
const result = await tbc; console;/*{ RESULT: '...', RESULT_CODE: '...', FLD_074: '...', FLD_075: '...', FLD_076: '...', FLD_077: '...', FLD_086: '...', FLD_087: '...', FLD_088: '...', FLD_089: '...',}*/
Card Registration
const result = await tbc ; console;/*{ TRANSACTION_ID: '...',}*/
If you would like to make DMS transactions with registered cards, use registerCard('CARD_ID', true)
.
Regular Payments
const result = await tbc ; console;/*{ TRANSACTION_ID: '...', RESULT: '...', RESULT_CODE: '...', RRN: '...', APPROVAL_CODE: '...',}*/
Regular Payment Authorization
const result = await tbc ; console;/*{ TRANSACTION_ID: '...', RESULT: '...', RESULT_CODE: '...', RRN: '...', APPROVAL_CODE: '...',}*/
License
shota-mentesh/node-tbc-payment-gateway is licensed under a ISC License.