telebirr-nodejs 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,13 +21,13 @@ You should never hard-code secrets. Always load them from process.env.
|
|
|
21
21
|
|
|
22
22
|
### Required Credentials
|
|
23
23
|
|
|
24
|
-
| Name
|
|
25
|
-
|
|
|
26
|
-
| `FABRIC_APP_ID`
|
|
27
|
-
| `FABRIC_APP_SECRET`
|
|
28
|
-
| `MERCHANT_APP_ID`
|
|
29
|
-
| `MERCHANT_CODE`
|
|
30
|
-
| `
|
|
24
|
+
| Name | Description |
|
|
25
|
+
| ------------------- | -------------------------------------------------------------------------------------- |
|
|
26
|
+
| `FABRIC_APP_ID` | Fabric application ID (c4182ef8-9249-458a-985e-06d191f4d505 uuid-v4 string) |
|
|
27
|
+
| `FABRIC_APP_SECRET` | Fabric application secret ("fad0f06383c6297f54rr78694b974599" 32 hex character string) |
|
|
28
|
+
| `MERCHANT_APP_ID` | Merchant application ID ("7606201678956824" 16 integer character string) |
|
|
29
|
+
| `MERCHANT_CODE` | Merchant code ("000000" 6 integer character string) |
|
|
30
|
+
| `PRIVATE_KEY` | RSA private key (PEM string) |
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -53,7 +53,7 @@ const c2bClient = new C2B({
|
|
|
53
53
|
appSecret: process.env.FABRIC_APP_SECRET,
|
|
54
54
|
merchantAppId: process.env.MERCHANT_APP_ID,
|
|
55
55
|
merchantCode: process.env.MERCHANT_CODE,
|
|
56
|
-
privateKey: process.env.
|
|
56
|
+
privateKey: process.env.PRIVATE_KEY,
|
|
57
57
|
notifyUrl: process.env.TELEBIRR_NOTIFY_URL,
|
|
58
58
|
redirectUrl: process.env.TELEBIRR_REDIRECT_URL,
|
|
59
59
|
http: true, // allow HTTP in simulator mode
|
|
@@ -130,9 +130,9 @@ Refunds a completed transaction.
|
|
|
130
130
|
app.post("/payment/refund", async (req, res) => {
|
|
131
131
|
const refundData = await c2bClient.refundOrder({
|
|
132
132
|
merchOrderId: "order123",
|
|
133
|
-
refundRequestNo: "
|
|
134
|
-
refundReason: "
|
|
135
|
-
amount: "
|
|
133
|
+
refundRequestNo: "CJD7GBPXIP", // unique Identifier of the request generated by the merchant app used for idempotency
|
|
134
|
+
refundReason: "The product is not as I expected",
|
|
135
|
+
amount: "1200",
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
res.json(refundData);
|
|
@@ -158,7 +158,7 @@ const c2bClient = new C2B({
|
|
|
158
158
|
appSecret: process.env.FABRIC_APP_SECRET,
|
|
159
159
|
merchantAppId: process.env.MERCHANT_APP_ID,
|
|
160
160
|
merchantCode: process.env.MERCHANT_CODE,
|
|
161
|
-
privateKey: process.env.
|
|
161
|
+
privateKey: process.env.PRIVATE_KEY,
|
|
162
162
|
notifyUrl: "https://example.com/notify",
|
|
163
163
|
redirectUrl: "https://example.com/redirect",
|
|
164
164
|
http: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telebirr-nodejs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Unofficial Node.js SDK for Telebirr C2B payments with automatic request signing, Fabric token handling, checkout URL generation, simulator support, and simplified refunds & payment status APIs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|