telebirr-nodejs 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/README.md +27 -27
  2. 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 | Description |
25
- | ---------------------- | ---------------------------- |
26
- | `FABRIC_APP_ID` | Fabric application ID |
27
- | `FABRIC_APP_SECRET` | Fabric application secret |
28
- | `MERCHANT_APP_ID` | Merchant application ID |
29
- | `MERCHANT_CODE` | Merchant code |
30
- | `MERCHANT_PRIVATE_KEY` | RSA private key (PEM string) |
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
+ | `MERCHANT_PRIVATE_KEY` | RSA private key (PEM string) |
31
31
 
32
32
  ---
33
33
 
@@ -42,6 +42,8 @@ You should never hard-code secrets. Always load them from process.env.
42
42
 
43
43
  ### Basic Setup
44
44
 
45
+ ---
46
+
45
47
  ```bash
46
48
  import { TelebirrClient } from "telebirr-nodejs";
47
49
 
@@ -51,7 +53,7 @@ const client = new TelebirrClient({
51
53
  appSecret: process.env.FABRIC_APP_SECRET!,
52
54
  merchantAppId: process.env.MERCHANT_APP_ID!,
53
55
  merchantCode: process.env.MERCHANT_CODE!,
54
- privateKey: process.env.MERCHANT_PRIVATE_KEY!,
56
+ merchantPrivateKey: process.env.MERCHANT_PRIVATE_KEY!,
55
57
  notifyUrl: process.env.TELEBIRR_NOTIFY_URL!,
56
58
  redirectUrl: process.env.TELEBIRR_REDIRECT_URL!,
57
59
  http: true, // allow HTTP in simulator mode
@@ -75,15 +77,13 @@ MERCHANT_PRIVATE_KEY must be the full PEM string, including:
75
77
 
76
78
  ### Example API Routes
77
79
 
78
- Below is a complete demo using three routes:
79
-
80
80
  1. POST /payment/initiate
81
- 2. GET /payment/status/:merchOrderId
81
+ 2. GET /payment/status
82
82
  3. POST /payment/refund
83
83
 
84
84
  ---
85
85
 
86
- ### 1 Initiate Payment
86
+ ### 1. Initiate Payment
87
87
 
88
88
  Creates an order and redirects the user to the Telebirr checkout page.
89
89
 
@@ -104,7 +104,7 @@ If you are using a frontend framework (for example React) and do not want to los
104
104
 
105
105
  ---
106
106
 
107
- ### 2 Query Payment Status
107
+ ### 2. Query Payment Status
108
108
 
109
109
  Used to check the payment result using the merchant order ID.
110
110
 
@@ -123,7 +123,7 @@ https://developer.ethiotelecom.et/docs/H5%20C2B%20Web%20Payment%20Integration%20
123
123
 
124
124
  ---
125
125
 
126
- ### 3 Refund Payment
126
+ ### 3. Refund Payment
127
127
 
128
128
  Refunds a completed transaction.
129
129
 
@@ -154,13 +154,13 @@ To use the simulator provided by this package, set the mode to simulate.
154
154
  ```bash
155
155
  import { TelebirrClient } from "telebirr-nodejs";
156
156
 
157
- const client = new TelebirrClient({
158
- mode: "simulate",
159
- notifyUrl: "https://example.com/notify",
160
- redirectUrl: "https://example.com/redirect",
161
- http: true,
162
- IntegrationOption: "C2B",
163
- });
157
+ const client = new TelebirrClient({
158
+ mode: "simulate",
159
+ notifyUrl: "https://example.com/notify",
160
+ redirectUrl: "https://example.com/redirect",
161
+ http: true,
162
+ IntegrationOption: "C2B",
163
+ });
164
164
 
165
165
  ```
166
166
 
@@ -192,12 +192,12 @@ You can generate private and public keys instantly.
192
192
  ```bash
193
193
  import { generateKeys } from "telebirr-nodejs";
194
194
 
195
- generateKeys({
196
- dir: process.cwd(),
197
- privateKeyName: "telefy_private.pem",
198
- publicKeyName: "telefy_public.pem",
199
- overwrite: false,
200
- });
195
+ generateKeys({
196
+ dir: process.cwd(),
197
+ privateKeyName: "telefy_private.pem",
198
+ publicKeyName: "telefy_public.pem",
199
+ overwrite: false,
200
+ });
201
201
 
202
202
  ```
203
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telebirr-nodejs",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Unofficial Telebirr Node.js SDK.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",