|
1 | | -# paystack-transaction-charges-to-cus-js |
2 | | -Pass Paystack Transaction Charges To Customers JS Library |
| 1 | +# PASS PAYSTACK TRANSACTION CHARGE TO CUSTOMER |
| 2 | + |
| 3 | +PaystackTransactionChargeToCustomer provides the implementation to the formula provided by the Paystack support team as regards passing the Paystack transaction charge to customers [Here's the article](https://support.paystack.com/hc/en-us/articles/360009973579-Can-I-pass-the-transaction-charges-to-my-customers-) . |
| 4 | + |
| 5 | +## Before getting started |
| 6 | +This library currently only works with the Nigerian Paystack Charges |
| 7 | + |
| 8 | +**Flat Fee - 100 Naira** |
| 9 | + | |
| 10 | +**Decimal Fee - 1.5%** |
| 11 | + |
| 12 | +### Get Started |
| 13 | +This library would help you calculate the total amount to charge the customer including the Paystack charges. All you need to do is ... |
| 14 | + |
| 15 | +[](https://www.npmjs.com/package/paystack-transaction-charges-to-cus) |
| 16 | +[](https://www.npmjs.com/package/mathjs) |
| 17 | +[](https://github.com/josdejong/mathjs/actions) |
| 18 | +[](https://github.com/josdejong/mathjs/graphs/commit-activity) |
| 19 | + |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +paystack-transaction-charges-to-cus.js can be used in both node.js and in the browser. |
| 24 | + |
| 25 | +Install paystack-transaction-charges-to-cus.js using [npm](https://www.npmjs.com/package/paystack-transaction-charges-to-cus): |
| 26 | + |
| 27 | + npm install paystack-transaction-charges-to-cus |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +```js |
| 32 | +import { |
| 33 | + calculateTotalPrice |
| 34 | +} from 'paystack-transaction-charges-to-cus' |
| 35 | + |
| 36 | +// functions and constants |
| 37 | +calculateTotalPrice(100) // 101 |
| 38 | + |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | +#### Constants |
| 43 | + |
| 44 | +|Name | Type | Required | Default Value | Description | |
| 45 | +|-----------------------|----------------|---------------------|---------------------|---------------------| |
| 46 | +| `DECIMAL_FEE ` | `Double` | true | 0.0150 | |
| 47 | +| `FEE_CAP ` | `int` | true | 2000 | |
| 48 | +| `FLAT_FEE` | `int` | true | 100 | |
| 49 | + |
| 50 | + |
| 51 | +## Done |
| 52 | +Checkout Paystack [API](https://paystack.com/docs/) |
0 commit comments