1.9.1 • Published 2 years ago

razer-sdk v1.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Description

This is a Razer SDK that allows developers to integrate their application or website with a payment gateway. A payment gateway is a service that authorizes and processes payments between customers and merchants.

Razer Merchant Services can simplify the process of integrating payment processing into your application or website. It provides pre-built functions and tools that allow you to handle payment transactions, securely manage customer information, and receive payments from various sources such as credit cards, debit cards, and digital wallets.

By integrating a payment gateway SDK like Razer Merchant Services, merchants can provide their customers with a convenient and secure way to make payments, while developers can focus on building the core features of their application or website without having to worry about the complexities of payment processing.

Installation

# using npm
npm i razer-sdk
# using yarn
yarn add razer-sdk

Prerequisites

Razer Verify Key & Secret Key 1. Login from Razer Portal 2. Transaction 3. Settings

Usage

Create SDK with Credential

import { offlineInstance, onlineInstance } from '..'

// StoreId === MerchantId <-- Follow Documentation Naming // Online SDK const razerOnlineSdk = onlineInstance({ merchantId: '', verifyKey: "", secretKey: "", callbackUrl: '' }) // Offline SDK const razerOfflineSDK = offlineInstance({ storeId: '', applicationCode: "", secretKey: "", terminalId: '' })

#### Online
> Online Payment Channel
```js
await razerOnlineSdk.getChannels()

Read Payment Transactions By Date

await razerOnlineSdk.getTransactionsByDate({start: new Date('2022-01-01T16:00:00.000Z'), end: new Date()})

Read Payment Transaction By Order Id

await razerOnlineSdk.getTransactionByOrderId({ orderId: 'ORDER123', amount: '5.00' })

Read Payment Transaction By Transaction Id

await razerOnlineSdk.getTransactionByTransactionId({ transactionId: 'TRANSACTION123', amount: '5.00' })

Request Refund

await razerOnlineSdk.requestRefund({ orderId: 'ORDER123', transactionId: "TRANSACTION123", amount: '5.00' })

Check Transaction Refund Status

await razerOnlineSdk.checkRefundStatusByOrderId({ orderId: 'ORDER123' })

Read Settlement

await razerOnlineSdk.getSettlements({ date: new Date('2023-03-17') })

Online Payment Notify (Callback) skey Verify

razerOnlineSdk.generateNotifyKey({
  nbcb: '',
  amount: '',
  orderid: '',
  tranID: '',
  domain: '',
  status: '',
  appcode: '',
  error_code: '',
  error_desc: '',
  skey: '',
  currency: '',
  channel: '',
  extraP: '',
  paydate: '',
})

Request Refund Notify (Callback) skey Verify

razerOnlineSdk.generateRefundNotifyKey({
  RefundType: '',
  MerchantID: '',
  RefID: '',
  RefundID: '',
  TxnID: '',
  Amount: '',
  Status: '',
  Signature: '',
  reason: '',
})

Offline

Pay by QR Code

await razerOfflineSDK.scanPay({
  referenceId: 'REFERENCE123',
  authorizationCode: '', // QR Scan Result
  currencyCode: 'MYR',
  amount: '5.00',
})

Request Refund

await razerOfflineSDK.refund({
  amount: '5.00',
  currencyCode: 'MYR',
  // New Reference Id
  referenceId: 'REFUND123',
  // Original Payment Reference ID
  paymentReferenceId: "REFERENCE123",
})

Inquiry - Check Status

await razerOfflineSDK.inquire({
  referenceId: 'REFERENCE123',
})

Inquiry - Check Status

await razerOfflineSDK.inquire({
  referenceId: 'REFERENCE123',
})

Reversal - Void Payment Within Same Day

await razerOfflineSDK.reversal({
  referenceId: 'REVERSAL123',
  paymentReferenceId: 'REFERENCE123'
})

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.9.1

2 years ago

1.2.8

2 years ago

1.9.0

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.2.6

2 years ago

1.3.4

2 years ago

1.2.5

2 years ago

1.3.3

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

1.3.8

2 years ago

1.2.9

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago