-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e17baaa
commit f0e11de
Showing
1 changed file
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,142 @@ | ||
# Tripay SDK | ||
# Tripay Client Library | ||
|
||
## TODO: | ||
- [ ] Documentation | ||
- [ ] Callback | ||
## Installation | ||
|
||
```sh | ||
pnpm add tripay-sdk | ||
# or | ||
npm install tripay-sdk | ||
# or | ||
yarn add tripay-sdk | ||
``` | ||
|
||
## API | ||
|
||
### Create Tripay Config | ||
```js | ||
import createTripayConfig from "tripay-sdk" | ||
|
||
const tripay = createTripayConfig({ | ||
apiKey: [your tripay api key], | ||
privateKey: [your tripay private api key] | ||
merchant_code: [your tripay merchant code] | ||
isProduction: [boolean default false] | ||
}) | ||
``` | ||
|
||
#### Instruction | ||
```js | ||
const instruction = await tripay.instruction({ | ||
code: 'pay code', | ||
amount: 'amount', | ||
allow_html: '' | ||
}); | ||
``` | ||
|
||
#### Payment Channel | ||
```js | ||
const paymentChannel = await tripay.paymentChannel(); | ||
``` | ||
|
||
#### Fee Calculator | ||
```js | ||
const feeCalculator = await tripay.feeCalculator({ | ||
code: 'payment code', | ||
amount: 'amount' | ||
}); | ||
``` | ||
|
||
#### Get Transaction List | ||
|
||
##### Closed Transactions | ||
```js | ||
const transactions = await tripay.transactions({ | ||
page: 'page' | ||
per_page: 'per page data' | ||
}); | ||
``` | ||
|
||
##### Open Transactions | ||
```js | ||
const openTransaction = await tripay.openTransactions({ | ||
uuid: 'uuid' | ||
}); | ||
``` | ||
|
||
#### Create Transaction | ||
|
||
##### Create Closed Transaction | ||
```js | ||
const closedTransaction = await tripay.createClosedTransaction({ | ||
method: 'payment method' | ||
merchant_ref: 'merchant_ref', | ||
amount: 'amount Transaction', | ||
customer_name: 'customer name', | ||
customer_phone: 'customer phone', | ||
order_items: 'array of item ordered', | ||
callback_url: 'callback url', | ||
return_url: 'return_url', | ||
expired_time: by default 1 hour | ||
}); | ||
``` | ||
|
||
##### Create Open Transaction | ||
|
||
```js | ||
const openTransaction = await tripay.createOpenTransaction({ | ||
method: 'payment method' | ||
merchant_ref: 'merchant_ref', | ||
customer_name: 'customer name' | ||
}); | ||
``` | ||
|
||
#### Get Transaction Detail | ||
|
||
##### Get Closed Transaction Detail | ||
```js | ||
const closedTransactionDetail = await tripay.closedTransactionDetail({ | ||
reference: 'reference number' | ||
}); | ||
``` | ||
|
||
##### Get Open Transaction Detail | ||
```js | ||
const openTransactionDetail = await tripay.openTransactionDetail({ | ||
uuid: 'uuid' | ||
}); | ||
``` | ||
|
||
NODE: | ||
* Closed Transaction Payment Method List: | ||
- MYBVA | ||
- PERMATAVA | ||
- BNIVA | ||
- BRIVA | ||
- MANDIRIVA | ||
- BCAVA | ||
- SMSVA | ||
- MUAMALATVA | ||
- CIMBVA | ||
- SAMPOERNAVA | ||
- BSIVA | ||
- DANAMONVA | ||
- ALFAMART | ||
- INDOMARET | ||
- ALFAMIDI | ||
- OVO | ||
- QRIS | ||
- QRIS2 | ||
- QRISC | ||
- QRISD | ||
- SHOPEEPAY | ||
* Open Transaction Payment Method List: | ||
- BNIVAOP | ||
- HANAVAOP | ||
- DANAMONOP | ||
- CIMBVAOP | ||
- BRIVAOP | ||
- QRISOP | ||
- QRISCOP | ||
- BSIVAOP | ||
|
||
### Webhook (Coming Soon) |