@patalink/node-api-client 1.0.5 → 1.0.6
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/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -132,7 +132,7 @@ var PataLinkClient = class {
|
|
|
132
132
|
paymentData.callbackUrl = request.callbackUrl;
|
|
133
133
|
}
|
|
134
134
|
const encryptedPayload = this.encrypt(paymentData);
|
|
135
|
-
const response = await this.request("/
|
|
135
|
+
const response = await this.request("/pay", {
|
|
136
136
|
method: "POST",
|
|
137
137
|
headers: {
|
|
138
138
|
"x-encrypted": "true"
|
|
@@ -146,7 +146,7 @@ var PataLinkClient = class {
|
|
|
146
146
|
*/
|
|
147
147
|
async getTransactionStatus(transactionId) {
|
|
148
148
|
if (!transactionId) throw new Error("transactionId is required");
|
|
149
|
-
return await this.request(`/
|
|
149
|
+
return await this.request(`/pay/${transactionId}`, {
|
|
150
150
|
method: "GET"
|
|
151
151
|
});
|
|
152
152
|
}
|
|
@@ -177,7 +177,7 @@ var PataLinkClient = class {
|
|
|
177
177
|
if (options?.offset) params.append("offset", options.offset.toString());
|
|
178
178
|
if (options?.status) params.append("status", options.status);
|
|
179
179
|
const query = params.toString();
|
|
180
|
-
const endpoint = `/
|
|
180
|
+
const endpoint = `/transactions${query ? `?${query}` : ""}`;
|
|
181
181
|
return this.request(endpoint, {
|
|
182
182
|
method: "GET"
|
|
183
183
|
});
|
|
@@ -186,7 +186,7 @@ var PataLinkClient = class {
|
|
|
186
186
|
* Rotate encryption key (generates new key, revokes old one after 24h)
|
|
187
187
|
*/
|
|
188
188
|
async rotateEncryptionKey() {
|
|
189
|
-
return this.request("/
|
|
189
|
+
return this.request("/keys/rotate", {
|
|
190
190
|
method: "POST"
|
|
191
191
|
});
|
|
192
192
|
}
|
|
@@ -194,7 +194,7 @@ var PataLinkClient = class {
|
|
|
194
194
|
* Get account information
|
|
195
195
|
*/
|
|
196
196
|
async getAccountInfo() {
|
|
197
|
-
return this.request("/
|
|
197
|
+
return this.request("/account", { method: "GET" });
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
200
|
* Initiate withdrawal
|
|
@@ -205,7 +205,7 @@ var PataLinkClient = class {
|
|
|
205
205
|
if (request.amount < 100) throw new Error("Minimum withdrawal is 100 RWF");
|
|
206
206
|
if (request.amount > 2e6) throw new Error("Maximum withdrawal is 2,000,000 RWF");
|
|
207
207
|
const encryptedPayload = this.encrypt(request);
|
|
208
|
-
return this.request("/
|
|
208
|
+
return this.request("/withdrawals", {
|
|
209
209
|
method: "POST",
|
|
210
210
|
headers: {
|
|
211
211
|
"x-encrypted": "true"
|
|
@@ -221,7 +221,7 @@ var PataLinkClient = class {
|
|
|
221
221
|
if (options?.limit) params.append("limit", options.limit.toString());
|
|
222
222
|
if (options?.offset) params.append("offset", options.offset.toString());
|
|
223
223
|
const query = params.toString();
|
|
224
|
-
const endpoint = `/
|
|
224
|
+
const endpoint = `/withdrawals${query ? `?${query}` : ""}`;
|
|
225
225
|
return this.request(endpoint, { method: "GET" });
|
|
226
226
|
}
|
|
227
227
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -97,7 +97,7 @@ var PataLinkClient = class {
|
|
|
97
97
|
paymentData.callbackUrl = request.callbackUrl;
|
|
98
98
|
}
|
|
99
99
|
const encryptedPayload = this.encrypt(paymentData);
|
|
100
|
-
const response = await this.request("/
|
|
100
|
+
const response = await this.request("/pay", {
|
|
101
101
|
method: "POST",
|
|
102
102
|
headers: {
|
|
103
103
|
"x-encrypted": "true"
|
|
@@ -111,7 +111,7 @@ var PataLinkClient = class {
|
|
|
111
111
|
*/
|
|
112
112
|
async getTransactionStatus(transactionId) {
|
|
113
113
|
if (!transactionId) throw new Error("transactionId is required");
|
|
114
|
-
return await this.request(`/
|
|
114
|
+
return await this.request(`/pay/${transactionId}`, {
|
|
115
115
|
method: "GET"
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -142,7 +142,7 @@ var PataLinkClient = class {
|
|
|
142
142
|
if (options?.offset) params.append("offset", options.offset.toString());
|
|
143
143
|
if (options?.status) params.append("status", options.status);
|
|
144
144
|
const query = params.toString();
|
|
145
|
-
const endpoint = `/
|
|
145
|
+
const endpoint = `/transactions${query ? `?${query}` : ""}`;
|
|
146
146
|
return this.request(endpoint, {
|
|
147
147
|
method: "GET"
|
|
148
148
|
});
|
|
@@ -151,7 +151,7 @@ var PataLinkClient = class {
|
|
|
151
151
|
* Rotate encryption key (generates new key, revokes old one after 24h)
|
|
152
152
|
*/
|
|
153
153
|
async rotateEncryptionKey() {
|
|
154
|
-
return this.request("/
|
|
154
|
+
return this.request("/keys/rotate", {
|
|
155
155
|
method: "POST"
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -159,7 +159,7 @@ var PataLinkClient = class {
|
|
|
159
159
|
* Get account information
|
|
160
160
|
*/
|
|
161
161
|
async getAccountInfo() {
|
|
162
|
-
return this.request("/
|
|
162
|
+
return this.request("/account", { method: "GET" });
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Initiate withdrawal
|
|
@@ -170,7 +170,7 @@ var PataLinkClient = class {
|
|
|
170
170
|
if (request.amount < 100) throw new Error("Minimum withdrawal is 100 RWF");
|
|
171
171
|
if (request.amount > 2e6) throw new Error("Maximum withdrawal is 2,000,000 RWF");
|
|
172
172
|
const encryptedPayload = this.encrypt(request);
|
|
173
|
-
return this.request("/
|
|
173
|
+
return this.request("/withdrawals", {
|
|
174
174
|
method: "POST",
|
|
175
175
|
headers: {
|
|
176
176
|
"x-encrypted": "true"
|
|
@@ -186,7 +186,7 @@ var PataLinkClient = class {
|
|
|
186
186
|
if (options?.limit) params.append("limit", options.limit.toString());
|
|
187
187
|
if (options?.offset) params.append("offset", options.offset.toString());
|
|
188
188
|
const query = params.toString();
|
|
189
|
-
const endpoint = `/
|
|
189
|
+
const endpoint = `/withdrawals${query ? `?${query}` : ""}`;
|
|
190
190
|
return this.request(endpoint, { method: "GET" });
|
|
191
191
|
}
|
|
192
192
|
};
|