pi-spi-sdk 0.1.3 → 0.2.0
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/CHANGELOG.md +39 -0
- package/README.md +23 -1
- package/dist/chunk-7W56NW2S.mjs +2066 -0
- package/dist/generated-FM5EVVHH.mjs +84 -0
- package/dist/index.cjs +4754 -0
- package/dist/index.d.cts +4940 -0
- package/dist/index.d.ts +4937 -12
- package/dist/index.mjs +2359 -0
- package/dist/index.umd.js +2 -0
- package/dist/qrcode/index.cjs +757 -0
- package/dist/qrcode/index.d.cts +68 -0
- package/dist/qrcode/index.d.ts +20 -14
- package/dist/qrcode/index.mjs +712 -0
- package/package.json +24 -8
- package/dist/config.d.ts +0 -35
- package/dist/config.js +0 -5
- package/dist/error-handler.d.ts +0 -7
- package/dist/error-handler.js +0 -55
- package/dist/errors.d.ts +0 -25
- package/dist/errors.js +0 -48
- package/dist/examples.d.ts +0 -8
- package/dist/examples.js +0 -93
- package/dist/generated/core/ApiError.d.ts +0 -10
- package/dist/generated/core/ApiError.js +0 -15
- package/dist/generated/core/ApiRequestOptions.d.ts +0 -13
- package/dist/generated/core/ApiRequestOptions.js +0 -2
- package/dist/generated/core/ApiResult.d.ts +0 -7
- package/dist/generated/core/ApiResult.js +0 -2
- package/dist/generated/core/CancelablePromise.d.ts +0 -20
- package/dist/generated/core/CancelablePromise.js +0 -116
- package/dist/generated/core/OpenAPI.d.ts +0 -16
- package/dist/generated/core/OpenAPI.js +0 -14
- package/dist/generated/core/request.d.ts +0 -34
- package/dist/generated/core/request.js +0 -292
- package/dist/generated/index.d.ts +0 -78
- package/dist/generated/index.js +0 -86
- package/dist/generated/models/AliasCreationReponse.d.ts +0 -22
- package/dist/generated/models/AliasCreationReponse.js +0 -2
- package/dist/generated/models/AliasCreationRequest.d.ts +0 -11
- package/dist/generated/models/AliasCreationRequest.js +0 -2
- package/dist/generated/models/AliasReponseListe.d.ts +0 -26
- package/dist/generated/models/AliasReponseListe.js +0 -2
- package/dist/generated/models/AnnulationStatut.d.ts +0 -13
- package/dist/generated/models/AnnulationStatut.js +0 -21
- package/dist/generated/models/Champs.d.ts +0 -1
- package/dist/generated/models/Champs.js +0 -2
- package/dist/generated/models/CompteOperation.d.ts +0 -72
- package/dist/generated/models/CompteOperation.js +0 -27
- package/dist/generated/models/CompteOperationListe.d.ts +0 -18
- package/dist/generated/models/CompteOperationListe.js +0 -2
- package/dist/generated/models/CompteSolde.d.ts +0 -129
- package/dist/generated/models/CompteSolde.js +0 -74
- package/dist/generated/models/CompteTransfertIntraReponse.d.ts +0 -33
- package/dist/generated/models/CompteTransfertIntraReponse.js +0 -15
- package/dist/generated/models/CompteTransfertIntraRequest.d.ts +0 -9
- package/dist/generated/models/CompteTransfertIntraRequest.js +0 -2
- package/dist/generated/models/DemandePaiementConfirmationAnnulationRaison.d.ts +0 -14
- package/dist/generated/models/DemandePaiementConfirmationAnnulationRaison.js +0 -22
- package/dist/generated/models/DemandePaiementConfirmationReponse.d.ts +0 -41
- package/dist/generated/models/DemandePaiementConfirmationReponse.js +0 -16
- package/dist/generated/models/DemandePaiementConfirmationRequest.d.ts +0 -3
- package/dist/generated/models/DemandePaiementConfirmationRequest.js +0 -2
- package/dist/generated/models/DemandePaiementConfirmationRequestAccepter.d.ts +0 -9
- package/dist/generated/models/DemandePaiementConfirmationRequestAccepter.js +0 -2
- package/dist/generated/models/DemandePaiementConfirmationRequestRejeter.d.ts +0 -9
- package/dist/generated/models/DemandePaiementConfirmationRequestRejeter.js +0 -2
- package/dist/generated/models/DemandePaiementConsultationReponse.d.ts +0 -151
- package/dist/generated/models/DemandePaiementConsultationReponse.js +0 -30
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequest.d.ts +0 -3
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequest.js +0 -2
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequestAccepter.d.ts +0 -9
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequestAccepter.js +0 -2
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequestRejeter.d.ts +0 -9
- package/dist/generated/models/DemandePaiementEnMasseConfirmationRequestRejeter.js +0 -2
- package/dist/generated/models/DemandePaiementEnMasseRequest.d.ts +0 -74
- package/dist/generated/models/DemandePaiementEnMasseRequest.js +0 -2
- package/dist/generated/models/DemandePaiementEnMasseStatutReponse.d.ts +0 -98
- package/dist/generated/models/DemandePaiementEnMasseStatutReponse.js +0 -23
- package/dist/generated/models/DemandePaiementListe.d.ts +0 -26
- package/dist/generated/models/DemandePaiementListe.js +0 -2
- package/dist/generated/models/DemandePaiementListeItem.d.ts +0 -163
- package/dist/generated/models/DemandePaiementListeItem.js +0 -30
- package/dist/generated/models/DemandePaiementReponse.d.ts +0 -129
- package/dist/generated/models/DemandePaiementReponse.js +0 -2
- package/dist/generated/models/DemandePaiementReponseRequest.d.ts +0 -21
- package/dist/generated/models/DemandePaiementReponseRequest.js +0 -14
- package/dist/generated/models/DemandePaiementRequest.d.ts +0 -98
- package/dist/generated/models/DemandePaiementRequest.js +0 -10
- package/dist/generated/models/DemandePaiementRequestBase.d.ts +0 -42
- package/dist/generated/models/DemandePaiementRequestBase.js +0 -2
- package/dist/generated/models/DemandePaiementRequestCategorie.d.ts +0 -12
- package/dist/generated/models/DemandePaiementRequestCategorie.js +0 -20
- package/dist/generated/models/DemandePaiementStatut.d.ts +0 -13
- package/dist/generated/models/DemandePaiementStatut.js +0 -21
- package/dist/generated/models/DemandePaiementStatutRaison.d.ts +0 -46
- package/dist/generated/models/DemandePaiementStatutRaison.js +0 -54
- package/dist/generated/models/ListeMeta.d.ts +0 -14
- package/dist/generated/models/ListeMeta.js +0 -2
- package/dist/generated/models/Paiement.d.ts +0 -156
- package/dist/generated/models/Paiement.js +0 -31
- package/dist/generated/models/PaiementAnnulationMotif.d.ts +0 -17
- package/dist/generated/models/PaiementAnnulationMotif.js +0 -25
- package/dist/generated/models/PaiementAnnulationReponseRequest.d.ts +0 -11
- package/dist/generated/models/PaiementAnnulationReponseRequest.js +0 -2
- package/dist/generated/models/PaiementAnnulationReponseRequestAccepter.d.ts +0 -9
- package/dist/generated/models/PaiementAnnulationReponseRequestAccepter.js +0 -2
- package/dist/generated/models/PaiementAnnulationReponseRequestRejeter.d.ts +0 -9
- package/dist/generated/models/PaiementAnnulationReponseRequestRejeter.js +0 -2
- package/dist/generated/models/PaiementAnnulationRequest.d.ts +0 -4
- package/dist/generated/models/PaiementAnnulationRequest.js +0 -2
- package/dist/generated/models/PaiementAnnulationStatutRaison.d.ts +0 -21
- package/dist/generated/models/PaiementAnnulationStatutRaison.js +0 -29
- package/dist/generated/models/PaiementEnMasseConfirmationRequest.d.ts +0 -3
- package/dist/generated/models/PaiementEnMasseConfirmationRequest.js +0 -2
- package/dist/generated/models/PaiementEnMasseConfirmationRequestAccepter.d.ts +0 -9
- package/dist/generated/models/PaiementEnMasseConfirmationRequestAccepter.js +0 -2
- package/dist/generated/models/PaiementEnMasseConfirmationRequestRejeter.d.ts +0 -9
- package/dist/generated/models/PaiementEnMasseConfirmationRequestRejeter.js +0 -2
- package/dist/generated/models/PaiementEnMasseReponseStatut.d.ts +0 -97
- package/dist/generated/models/PaiementEnMasseReponseStatut.js +0 -23
- package/dist/generated/models/PaiementEnMasseRequest.d.ts +0 -54
- package/dist/generated/models/PaiementEnMasseRequest.js +0 -2
- package/dist/generated/models/PaiementImmediatConfirmationReponse.d.ts +0 -31
- package/dist/generated/models/PaiementImmediatConfirmationReponse.js +0 -10
- package/dist/generated/models/PaiementImmediatConfirmationRequest.d.ts +0 -3
- package/dist/generated/models/PaiementImmediatConfirmationRequest.js +0 -2
- package/dist/generated/models/PaiementImmediatConfirmationRequestAccepter.d.ts +0 -9
- package/dist/generated/models/PaiementImmediatConfirmationRequestAccepter.js +0 -2
- package/dist/generated/models/PaiementImmediatConfirmationRequestRejeter.d.ts +0 -9
- package/dist/generated/models/PaiementImmediatConfirmationRequestRejeter.js +0 -2
- package/dist/generated/models/PaiementImmediatReponse.d.ts +0 -98
- package/dist/generated/models/PaiementImmediatReponse.js +0 -10
- package/dist/generated/models/PaiementImmediatRequest.d.ts +0 -13
- package/dist/generated/models/PaiementImmediatRequest.js +0 -2
- package/dist/generated/models/PaiementListe.d.ts +0 -6
- package/dist/generated/models/PaiementListe.js +0 -2
- package/dist/generated/models/PaiementRequest.d.ts +0 -33
- package/dist/generated/models/PaiementRequest.js +0 -2
- package/dist/generated/models/PaiementStatut.d.ts +0 -13
- package/dist/generated/models/PaiementStatut.js +0 -21
- package/dist/generated/models/PaiementStatutRaison.d.ts +0 -56
- package/dist/generated/models/PaiementStatutRaison.js +0 -64
- package/dist/generated/models/Problem7807.d.ts +0 -31
- package/dist/generated/models/Problem7807.js +0 -2
- package/dist/generated/models/RefDocType.d.ts +0 -38
- package/dist/generated/models/RefDocType.js +0 -46
- package/dist/generated/models/RetourStatut.d.ts +0 -13
- package/dist/generated/models/RetourStatut.js +0 -21
- package/dist/generated/models/RetourStatutRaison.d.ts +0 -25
- package/dist/generated/models/RetourStatutRaison.js +0 -33
- package/dist/generated/models/WebhookCreationRequest.d.ts +0 -14
- package/dist/generated/models/WebhookCreationRequest.js +0 -2
- package/dist/generated/models/WebhookCreationResponse.d.ts +0 -12
- package/dist/generated/models/WebhookCreationResponse.js +0 -2
- package/dist/generated/models/WebhookData.d.ts +0 -8
- package/dist/generated/models/WebhookData.js +0 -2
- package/dist/generated/models/WebhookEvent.d.ts +0 -191
- package/dist/generated/models/WebhookEvent.js +0 -45
- package/dist/generated/models/WebhookEventsList.d.ts +0 -13
- package/dist/generated/models/WebhookEventsList.js +0 -2
- package/dist/generated/models/WebhookList.d.ts +0 -13
- package/dist/generated/models/WebhookList.js +0 -2
- package/dist/generated/models/WebhookModificationRequest.d.ts +0 -4
- package/dist/generated/models/WebhookModificationRequest.js +0 -2
- package/dist/generated/models/WebhooksEvents.d.ts +0 -12
- package/dist/generated/models/WebhooksEvents.js +0 -20
- package/dist/generated/services/AliasService.d.ts +0 -63
- package/dist/generated/services/AliasService.js +0 -88
- package/dist/generated/services/ComptesService.d.ts +0 -64
- package/dist/generated/services/ComptesService.js +0 -90
- package/dist/generated/services/DemandeAnnulationService.d.ts +0 -84
- package/dist/generated/services/DemandeAnnulationService.js +0 -103
- package/dist/generated/services/DemandesDePaiementEnMasseService.d.ts +0 -161
- package/dist/generated/services/DemandesDePaiementEnMasseService.js +0 -193
- package/dist/generated/services/DemandesDePaiementService.d.ts +0 -123
- package/dist/generated/services/DemandesDePaiementService.js +0 -165
- package/dist/generated/services/NotificationService.d.ts +0 -80
- package/dist/generated/services/NotificationService.js +0 -136
- package/dist/generated/services/PaiementEnMasseService.d.ts +0 -159
- package/dist/generated/services/PaiementEnMasseService.js +0 -191
- package/dist/generated/services/PaiementImmediatService.d.ts +0 -135
- package/dist/generated/services/PaiementImmediatService.js +0 -180
- package/dist/generated/services/RetoursdeFondsService.d.ts +0 -28
- package/dist/generated/services/RetoursdeFondsService.js +0 -41
- package/dist/index.js +0 -72
- package/dist/qrcode/index.js +0 -541
- package/dist/qrcode/logo.d.ts +0 -3
- package/dist/qrcode/logo.js +0 -142
- package/dist/query-builder.d.ts +0 -91
- package/dist/query-builder.js +0 -191
- package/dist/sdk.d.ts +0 -104
- package/dist/sdk.js +0 -147
- package/dist/services/alias.d.ts +0 -76
- package/dist/services/alias.js +0 -80
- package/dist/services/base.d.ts +0 -20
- package/dist/services/base.js +0 -67
- package/dist/services/comptes.d.ts +0 -149
- package/dist/services/comptes.js +0 -162
- package/dist/services/demandes-annulation.d.ts +0 -97
- package/dist/services/demandes-annulation.js +0 -108
- package/dist/services/demandes-paiement-en-masse.d.ts +0 -33
- package/dist/services/demandes-paiement-en-masse.js +0 -44
- package/dist/services/demandes-paiement.d.ts +0 -148
- package/dist/services/demandes-paiement.js +0 -153
- package/dist/services/paiements-en-masse.d.ts +0 -152
- package/dist/services/paiements-en-masse.js +0 -157
- package/dist/services/paiements.d.ts +0 -135
- package/dist/services/paiements.js +0 -139
- package/dist/services/retours-fonds.d.ts +0 -94
- package/dist/services/retours-fonds.js +0 -104
- package/dist/services/webhooks.d.ts +0 -131
- package/dist/services/webhooks.js +0 -146
- package/dist/types/alias.d.ts +0 -64
- package/dist/types/alias.js +0 -78
- package/dist/utils/constants.d.ts +0 -93
- package/dist/utils/constants.js +0 -96
- package/dist/utils/index.d.ts +0 -60
- package/dist/utils/index.js +0 -126
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,4754 @@
|
|
|
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 __typeError = (msg) => {
|
|
9
|
+
throw TypeError(msg);
|
|
10
|
+
};
|
|
11
|
+
var __esm = (fn, res) => function __init() {
|
|
12
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
|
+
};
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
36
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
37
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
38
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
39
|
+
|
|
40
|
+
// src/generated/core/ApiError.ts
|
|
41
|
+
var ApiError;
|
|
42
|
+
var init_ApiError = __esm({
|
|
43
|
+
"src/generated/core/ApiError.ts"() {
|
|
44
|
+
"use strict";
|
|
45
|
+
ApiError = class extends Error {
|
|
46
|
+
constructor(request2, response, message) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = "ApiError";
|
|
49
|
+
this.url = response.url;
|
|
50
|
+
this.status = response.status;
|
|
51
|
+
this.statusText = response.statusText;
|
|
52
|
+
this.body = response.body;
|
|
53
|
+
this.request = request2;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// src/generated/core/CancelablePromise.ts
|
|
60
|
+
var CancelError, _isResolved, _isRejected, _isCancelled, _cancelHandlers, _promise, _resolve, _reject, CancelablePromise;
|
|
61
|
+
var init_CancelablePromise = __esm({
|
|
62
|
+
"src/generated/core/CancelablePromise.ts"() {
|
|
63
|
+
"use strict";
|
|
64
|
+
CancelError = class extends Error {
|
|
65
|
+
constructor(message) {
|
|
66
|
+
super(message);
|
|
67
|
+
this.name = "CancelError";
|
|
68
|
+
}
|
|
69
|
+
get isCancelled() {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
CancelablePromise = class {
|
|
74
|
+
constructor(executor) {
|
|
75
|
+
__privateAdd(this, _isResolved);
|
|
76
|
+
__privateAdd(this, _isRejected);
|
|
77
|
+
__privateAdd(this, _isCancelled);
|
|
78
|
+
__privateAdd(this, _cancelHandlers);
|
|
79
|
+
__privateAdd(this, _promise);
|
|
80
|
+
__privateAdd(this, _resolve);
|
|
81
|
+
__privateAdd(this, _reject);
|
|
82
|
+
__privateSet(this, _isResolved, false);
|
|
83
|
+
__privateSet(this, _isRejected, false);
|
|
84
|
+
__privateSet(this, _isCancelled, false);
|
|
85
|
+
__privateSet(this, _cancelHandlers, []);
|
|
86
|
+
__privateSet(this, _promise, new Promise((resolve2, reject) => {
|
|
87
|
+
__privateSet(this, _resolve, resolve2);
|
|
88
|
+
__privateSet(this, _reject, reject);
|
|
89
|
+
const onResolve = (value) => {
|
|
90
|
+
if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
__privateSet(this, _isResolved, true);
|
|
94
|
+
if (__privateGet(this, _resolve)) __privateGet(this, _resolve).call(this, value);
|
|
95
|
+
};
|
|
96
|
+
const onReject = (reason) => {
|
|
97
|
+
if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
__privateSet(this, _isRejected, true);
|
|
101
|
+
if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, reason);
|
|
102
|
+
};
|
|
103
|
+
const onCancel = (cancelHandler) => {
|
|
104
|
+
if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
__privateGet(this, _cancelHandlers).push(cancelHandler);
|
|
108
|
+
};
|
|
109
|
+
Object.defineProperty(onCancel, "isResolved", {
|
|
110
|
+
get: () => __privateGet(this, _isResolved)
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(onCancel, "isRejected", {
|
|
113
|
+
get: () => __privateGet(this, _isRejected)
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(onCancel, "isCancelled", {
|
|
116
|
+
get: () => __privateGet(this, _isCancelled)
|
|
117
|
+
});
|
|
118
|
+
return executor(onResolve, onReject, onCancel);
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
get [Symbol.toStringTag]() {
|
|
122
|
+
return "Cancellable Promise";
|
|
123
|
+
}
|
|
124
|
+
then(onFulfilled, onRejected) {
|
|
125
|
+
return __privateGet(this, _promise).then(onFulfilled, onRejected);
|
|
126
|
+
}
|
|
127
|
+
catch(onRejected) {
|
|
128
|
+
return __privateGet(this, _promise).catch(onRejected);
|
|
129
|
+
}
|
|
130
|
+
finally(onFinally) {
|
|
131
|
+
return __privateGet(this, _promise).finally(onFinally);
|
|
132
|
+
}
|
|
133
|
+
cancel() {
|
|
134
|
+
if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
__privateSet(this, _isCancelled, true);
|
|
138
|
+
if (__privateGet(this, _cancelHandlers).length) {
|
|
139
|
+
try {
|
|
140
|
+
for (const cancelHandler of __privateGet(this, _cancelHandlers)) {
|
|
141
|
+
cancelHandler();
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.warn("Cancellation threw an error", error);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
__privateGet(this, _cancelHandlers).length = 0;
|
|
149
|
+
if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, new CancelError("Request aborted"));
|
|
150
|
+
}
|
|
151
|
+
get isCancelled() {
|
|
152
|
+
return __privateGet(this, _isCancelled);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
_isResolved = new WeakMap();
|
|
156
|
+
_isRejected = new WeakMap();
|
|
157
|
+
_isCancelled = new WeakMap();
|
|
158
|
+
_cancelHandlers = new WeakMap();
|
|
159
|
+
_promise = new WeakMap();
|
|
160
|
+
_resolve = new WeakMap();
|
|
161
|
+
_reject = new WeakMap();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// src/generated/core/OpenAPI.ts
|
|
166
|
+
var OpenAPI2;
|
|
167
|
+
var init_OpenAPI = __esm({
|
|
168
|
+
"src/generated/core/OpenAPI.ts"() {
|
|
169
|
+
"use strict";
|
|
170
|
+
OpenAPI2 = {
|
|
171
|
+
BASE: "https://sandbox.api.pi-bceao.com/piz/v1",
|
|
172
|
+
VERSION: "1.0.0",
|
|
173
|
+
WITH_CREDENTIALS: false,
|
|
174
|
+
CREDENTIALS: "include",
|
|
175
|
+
TOKEN: void 0,
|
|
176
|
+
USERNAME: void 0,
|
|
177
|
+
PASSWORD: void 0,
|
|
178
|
+
HEADERS: void 0,
|
|
179
|
+
ENCODE_PATH: void 0
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// src/generated/models/AnnulationStatut.ts
|
|
185
|
+
var AnnulationStatut;
|
|
186
|
+
var init_AnnulationStatut = __esm({
|
|
187
|
+
"src/generated/models/AnnulationStatut.ts"() {
|
|
188
|
+
"use strict";
|
|
189
|
+
AnnulationStatut = /* @__PURE__ */ ((AnnulationStatut2) => {
|
|
190
|
+
AnnulationStatut2["INITIE"] = "INITIE";
|
|
191
|
+
AnnulationStatut2["ENVOYE"] = "ENVOYE";
|
|
192
|
+
AnnulationStatut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
193
|
+
AnnulationStatut2["REJETE"] = "REJETE";
|
|
194
|
+
return AnnulationStatut2;
|
|
195
|
+
})(AnnulationStatut || {});
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// src/generated/models/CompteOperation.ts
|
|
200
|
+
var CompteOperation;
|
|
201
|
+
var init_CompteOperation = __esm({
|
|
202
|
+
"src/generated/models/CompteOperation.ts"() {
|
|
203
|
+
"use strict";
|
|
204
|
+
((CompteOperation2) => {
|
|
205
|
+
let statut;
|
|
206
|
+
((statut2) => {
|
|
207
|
+
statut2["INITIE"] = "INITIE";
|
|
208
|
+
})(statut = CompteOperation2.statut || (CompteOperation2.statut = {}));
|
|
209
|
+
let statutRaison;
|
|
210
|
+
((statutRaison2) => {
|
|
211
|
+
statutRaison2["SOLDE_INSUFFISANT"] = "SOLDE_INSUFFISANT";
|
|
212
|
+
})(statutRaison = CompteOperation2.statutRaison || (CompteOperation2.statutRaison = {}));
|
|
213
|
+
})(CompteOperation || (CompteOperation = {}));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// src/generated/models/CompteSolde.ts
|
|
218
|
+
var CompteSolde;
|
|
219
|
+
var init_CompteSolde = __esm({
|
|
220
|
+
"src/generated/models/CompteSolde.ts"() {
|
|
221
|
+
"use strict";
|
|
222
|
+
((CompteSolde2) => {
|
|
223
|
+
let type;
|
|
224
|
+
((type2) => {
|
|
225
|
+
type2["CACC"] = "CACC";
|
|
226
|
+
type2["CARD"] = "CARD";
|
|
227
|
+
type2["CASH"] = "CASH";
|
|
228
|
+
type2["CHAR"] = "CHAR";
|
|
229
|
+
type2["CISH"] = "CISH";
|
|
230
|
+
type2["COMM"] = "COMM";
|
|
231
|
+
type2["CPAC"] = "CPAC";
|
|
232
|
+
type2["LLSV"] = "LLSV";
|
|
233
|
+
type2["LOAN"] = "LOAN";
|
|
234
|
+
type2["MGLD"] = "MGLD";
|
|
235
|
+
type2["MOMA"] = "MOMA";
|
|
236
|
+
type2["NREX"] = "NREX";
|
|
237
|
+
type2["ODFT"] = "ODFT";
|
|
238
|
+
type2["ONDP"] = "ONDP";
|
|
239
|
+
type2["OTHR"] = "OTHR";
|
|
240
|
+
type2["SACC"] = "SACC";
|
|
241
|
+
type2["SLRY"] = "SLRY";
|
|
242
|
+
type2["SVGS"] = "SVGS";
|
|
243
|
+
type2["TAXE"] = "TAXE";
|
|
244
|
+
type2["TRAN"] = "TRAN";
|
|
245
|
+
type2["TRAS"] = "TRAS";
|
|
246
|
+
type2["VACC"] = "VACC";
|
|
247
|
+
})(type = CompteSolde2.type || (CompteSolde2.type = {}));
|
|
248
|
+
let statut;
|
|
249
|
+
((statut2) => {
|
|
250
|
+
statut2["OUVERT"] = "OUVERT";
|
|
251
|
+
statut2["BLOQUE"] = "BLOQUE";
|
|
252
|
+
statut2["CLOTURE"] = "CLOTURE";
|
|
253
|
+
})(statut = CompteSolde2.statut || (CompteSolde2.statut = {}));
|
|
254
|
+
})(CompteSolde || (CompteSolde = {}));
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// src/generated/models/CompteTransfertIntraReponse.ts
|
|
259
|
+
var CompteTransfertIntraReponse;
|
|
260
|
+
var init_CompteTransfertIntraReponse = __esm({
|
|
261
|
+
"src/generated/models/CompteTransfertIntraReponse.ts"() {
|
|
262
|
+
"use strict";
|
|
263
|
+
((CompteTransfertIntraReponse2) => {
|
|
264
|
+
let statut;
|
|
265
|
+
((statut2) => {
|
|
266
|
+
statut2["INITIE"] = "INITIE";
|
|
267
|
+
})(statut = CompteTransfertIntraReponse2.statut || (CompteTransfertIntraReponse2.statut = {}));
|
|
268
|
+
})(CompteTransfertIntraReponse || (CompteTransfertIntraReponse = {}));
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// src/generated/models/DemandePaiementConfirmationAnnulationRaison.ts
|
|
273
|
+
var DemandePaiementConfirmationAnnulationRaison;
|
|
274
|
+
var init_DemandePaiementConfirmationAnnulationRaison = __esm({
|
|
275
|
+
"src/generated/models/DemandePaiementConfirmationAnnulationRaison.ts"() {
|
|
276
|
+
"use strict";
|
|
277
|
+
DemandePaiementConfirmationAnnulationRaison = /* @__PURE__ */ ((DemandePaiementConfirmationAnnulationRaison2) => {
|
|
278
|
+
DemandePaiementConfirmationAnnulationRaison2["ERREUR_ALIAS"] = "ERREUR_ALIAS";
|
|
279
|
+
DemandePaiementConfirmationAnnulationRaison2["ERREUR_MONTANT"] = "ERREUR_MONTANT";
|
|
280
|
+
DemandePaiementConfirmationAnnulationRaison2["ERREUR_TXID"] = "ERREUR_TXID";
|
|
281
|
+
DemandePaiementConfirmationAnnulationRaison2["PAYEUR_INCONNU"] = "PAYEUR_INCONNU";
|
|
282
|
+
return DemandePaiementConfirmationAnnulationRaison2;
|
|
283
|
+
})(DemandePaiementConfirmationAnnulationRaison || {});
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// src/generated/models/DemandePaiementConfirmationReponse.ts
|
|
288
|
+
var DemandePaiementConfirmationReponse;
|
|
289
|
+
var init_DemandePaiementConfirmationReponse = __esm({
|
|
290
|
+
"src/generated/models/DemandePaiementConfirmationReponse.ts"() {
|
|
291
|
+
"use strict";
|
|
292
|
+
((DemandePaiementConfirmationReponse2) => {
|
|
293
|
+
let statut;
|
|
294
|
+
((statut2) => {
|
|
295
|
+
statut2["ENVOYE"] = "ENVOYE";
|
|
296
|
+
statut2["ANNULE"] = "ANNULE";
|
|
297
|
+
})(statut = DemandePaiementConfirmationReponse2.statut || (DemandePaiementConfirmationReponse2.statut = {}));
|
|
298
|
+
})(DemandePaiementConfirmationReponse || (DemandePaiementConfirmationReponse = {}));
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// src/generated/models/DemandePaiementConsultationReponse.ts
|
|
303
|
+
var DemandePaiementConsultationReponse;
|
|
304
|
+
var init_DemandePaiementConsultationReponse = __esm({
|
|
305
|
+
"src/generated/models/DemandePaiementConsultationReponse.ts"() {
|
|
306
|
+
"use strict";
|
|
307
|
+
((DemandePaiementConsultationReponse2) => {
|
|
308
|
+
let categorie;
|
|
309
|
+
((categorie2) => {
|
|
310
|
+
categorie2["_631"] = "631";
|
|
311
|
+
categorie2["_500"] = "500";
|
|
312
|
+
categorie2["_521"] = "521";
|
|
313
|
+
categorie2["_401"] = "401";
|
|
314
|
+
})(categorie = DemandePaiementConsultationReponse2.categorie || (DemandePaiementConsultationReponse2.categorie = {}));
|
|
315
|
+
let statut;
|
|
316
|
+
((statut2) => {
|
|
317
|
+
statut2["INITIE"] = "INITIE";
|
|
318
|
+
statut2["ENVOYE"] = "ENVOYE";
|
|
319
|
+
statut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
320
|
+
statut2["REJETE"] = "REJETE";
|
|
321
|
+
})(statut = DemandePaiementConsultationReponse2.statut || (DemandePaiementConsultationReponse2.statut = {}));
|
|
322
|
+
})(DemandePaiementConsultationReponse || (DemandePaiementConsultationReponse = {}));
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// src/generated/models/DemandePaiementEnMasseStatutReponse.ts
|
|
327
|
+
var DemandePaiementEnMasseStatutReponse;
|
|
328
|
+
var init_DemandePaiementEnMasseStatutReponse = __esm({
|
|
329
|
+
"src/generated/models/DemandePaiementEnMasseStatutReponse.ts"() {
|
|
330
|
+
"use strict";
|
|
331
|
+
((DemandePaiementEnMasseStatutReponse2) => {
|
|
332
|
+
let statut;
|
|
333
|
+
((statut2) => {
|
|
334
|
+
statut2["INITIE"] = "INITIE";
|
|
335
|
+
statut2["CONFIRME"] = "CONFIRME";
|
|
336
|
+
statut2["ANNULE"] = "ANNULE";
|
|
337
|
+
})(statut = DemandePaiementEnMasseStatutReponse2.statut || (DemandePaiementEnMasseStatutReponse2.statut = {}));
|
|
338
|
+
})(DemandePaiementEnMasseStatutReponse || (DemandePaiementEnMasseStatutReponse = {}));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
// src/generated/models/DemandePaiementListeItem.ts
|
|
343
|
+
var DemandePaiementListeItem;
|
|
344
|
+
var init_DemandePaiementListeItem = __esm({
|
|
345
|
+
"src/generated/models/DemandePaiementListeItem.ts"() {
|
|
346
|
+
"use strict";
|
|
347
|
+
((DemandePaiementListeItem2) => {
|
|
348
|
+
let categorie;
|
|
349
|
+
((categorie2) => {
|
|
350
|
+
categorie2["_631"] = "631";
|
|
351
|
+
categorie2["_500"] = "500";
|
|
352
|
+
categorie2["_521"] = "521";
|
|
353
|
+
categorie2["_401"] = "401";
|
|
354
|
+
})(categorie = DemandePaiementListeItem2.categorie || (DemandePaiementListeItem2.categorie = {}));
|
|
355
|
+
let statut;
|
|
356
|
+
((statut2) => {
|
|
357
|
+
statut2["INITIE"] = "INITIE";
|
|
358
|
+
statut2["ENVOYE"] = "ENVOYE";
|
|
359
|
+
statut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
360
|
+
statut2["REJETE"] = "REJETE";
|
|
361
|
+
})(statut = DemandePaiementListeItem2.statut || (DemandePaiementListeItem2.statut = {}));
|
|
362
|
+
})(DemandePaiementListeItem || (DemandePaiementListeItem = {}));
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// src/generated/models/DemandePaiementReponseRequest.ts
|
|
367
|
+
var DemandePaiementReponseRequest;
|
|
368
|
+
var init_DemandePaiementReponseRequest = __esm({
|
|
369
|
+
"src/generated/models/DemandePaiementReponseRequest.ts"() {
|
|
370
|
+
"use strict";
|
|
371
|
+
((DemandePaiementReponseRequest2) => {
|
|
372
|
+
let raison;
|
|
373
|
+
((raison2) => {
|
|
374
|
+
raison2["BE05"] = "BE05";
|
|
375
|
+
raison2["AM09"] = "AM09";
|
|
376
|
+
raison2["APAR"] = "APAR";
|
|
377
|
+
raison2["RR07"] = "RR07";
|
|
378
|
+
raison2["FR01"] = "FR01";
|
|
379
|
+
})(raison = DemandePaiementReponseRequest2.raison || (DemandePaiementReponseRequest2.raison = {}));
|
|
380
|
+
})(DemandePaiementReponseRequest || (DemandePaiementReponseRequest = {}));
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
// src/generated/models/DemandePaiementRequest.ts
|
|
385
|
+
var DemandePaiementRequest;
|
|
386
|
+
var init_DemandePaiementRequest = __esm({
|
|
387
|
+
"src/generated/models/DemandePaiementRequest.ts"() {
|
|
388
|
+
"use strict";
|
|
389
|
+
((DemandePaiementRequest2) => {
|
|
390
|
+
let categorie;
|
|
391
|
+
((categorie2) => {
|
|
392
|
+
categorie2["_500"] = "500";
|
|
393
|
+
})(categorie = DemandePaiementRequest2.categorie || (DemandePaiementRequest2.categorie = {}));
|
|
394
|
+
})(DemandePaiementRequest || (DemandePaiementRequest = {}));
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
// src/generated/models/DemandePaiementRequestCategorie.ts
|
|
399
|
+
var DemandePaiementRequestCategorie;
|
|
400
|
+
var init_DemandePaiementRequestCategorie = __esm({
|
|
401
|
+
"src/generated/models/DemandePaiementRequestCategorie.ts"() {
|
|
402
|
+
"use strict";
|
|
403
|
+
DemandePaiementRequestCategorie = /* @__PURE__ */ ((DemandePaiementRequestCategorie2) => {
|
|
404
|
+
DemandePaiementRequestCategorie2["_500"] = "500";
|
|
405
|
+
DemandePaiementRequestCategorie2["_521"] = "521";
|
|
406
|
+
DemandePaiementRequestCategorie2["_401"] = "401";
|
|
407
|
+
return DemandePaiementRequestCategorie2;
|
|
408
|
+
})(DemandePaiementRequestCategorie || {});
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
// src/generated/models/DemandePaiementStatut.ts
|
|
413
|
+
var DemandePaiementStatut;
|
|
414
|
+
var init_DemandePaiementStatut = __esm({
|
|
415
|
+
"src/generated/models/DemandePaiementStatut.ts"() {
|
|
416
|
+
"use strict";
|
|
417
|
+
DemandePaiementStatut = /* @__PURE__ */ ((DemandePaiementStatut2) => {
|
|
418
|
+
DemandePaiementStatut2["INITIE"] = "INITIE";
|
|
419
|
+
DemandePaiementStatut2["ENVOYE"] = "ENVOYE";
|
|
420
|
+
DemandePaiementStatut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
421
|
+
DemandePaiementStatut2["REJETE"] = "REJETE";
|
|
422
|
+
return DemandePaiementStatut2;
|
|
423
|
+
})(DemandePaiementStatut || {});
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// src/generated/models/DemandePaiementStatutRaison.ts
|
|
428
|
+
var DemandePaiementStatutRaison;
|
|
429
|
+
var init_DemandePaiementStatutRaison = __esm({
|
|
430
|
+
"src/generated/models/DemandePaiementStatutRaison.ts"() {
|
|
431
|
+
"use strict";
|
|
432
|
+
DemandePaiementStatutRaison = /* @__PURE__ */ ((DemandePaiementStatutRaison2) => {
|
|
433
|
+
DemandePaiementStatutRaison2["BE23"] = "BE23";
|
|
434
|
+
DemandePaiementStatutRaison2["DU03"] = "DU03";
|
|
435
|
+
DemandePaiementStatutRaison2["AC04"] = "AC04";
|
|
436
|
+
DemandePaiementStatutRaison2["AC06"] = "AC06";
|
|
437
|
+
DemandePaiementStatutRaison2["AEXR"] = "AEXR";
|
|
438
|
+
DemandePaiementStatutRaison2["AG03"] = "AG03";
|
|
439
|
+
DemandePaiementStatutRaison2["AG10"] = "AG10";
|
|
440
|
+
DemandePaiementStatutRaison2["AG11"] = "AG11";
|
|
441
|
+
DemandePaiementStatutRaison2["ALAC"] = "ALAC";
|
|
442
|
+
DemandePaiementStatutRaison2["AM02"] = "AM02";
|
|
443
|
+
DemandePaiementStatutRaison2["AM09"] = "AM09";
|
|
444
|
+
DemandePaiementStatutRaison2["AM14"] = "AM14";
|
|
445
|
+
DemandePaiementStatutRaison2["APAR"] = "APAR";
|
|
446
|
+
DemandePaiementStatutRaison2["ARFR"] = "ARFR";
|
|
447
|
+
DemandePaiementStatutRaison2["ARJR"] = "ARJR";
|
|
448
|
+
DemandePaiementStatutRaison2["BE01"] = "BE01";
|
|
449
|
+
DemandePaiementStatutRaison2["BE05"] = "BE05";
|
|
450
|
+
DemandePaiementStatutRaison2["FR01"] = "FR01";
|
|
451
|
+
DemandePaiementStatutRaison2["RR07"] = "RR07";
|
|
452
|
+
return DemandePaiementStatutRaison2;
|
|
453
|
+
})(DemandePaiementStatutRaison || {});
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
// src/generated/models/Paiement.ts
|
|
458
|
+
var Paiement;
|
|
459
|
+
var init_Paiement = __esm({
|
|
460
|
+
"src/generated/models/Paiement.ts"() {
|
|
461
|
+
"use strict";
|
|
462
|
+
((Paiement2) => {
|
|
463
|
+
let categorie;
|
|
464
|
+
((categorie2) => {
|
|
465
|
+
categorie2["_631"] = "631";
|
|
466
|
+
categorie2["_000"] = "000";
|
|
467
|
+
categorie2["_400"] = "400";
|
|
468
|
+
categorie2["_733"] = "733";
|
|
469
|
+
categorie2["_300"] = "300";
|
|
470
|
+
categorie2["_999"] = "999";
|
|
471
|
+
categorie2["_500"] = "500";
|
|
472
|
+
categorie2["_521"] = "521";
|
|
473
|
+
categorie2["_401"] = "401";
|
|
474
|
+
})(categorie = Paiement2.categorie || (Paiement2.categorie = {}));
|
|
475
|
+
})(Paiement || (Paiement = {}));
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// src/generated/models/PaiementAnnulationMotif.ts
|
|
480
|
+
var PaiementAnnulationMotif;
|
|
481
|
+
var init_PaiementAnnulationMotif = __esm({
|
|
482
|
+
"src/generated/models/PaiementAnnulationMotif.ts"() {
|
|
483
|
+
"use strict";
|
|
484
|
+
PaiementAnnulationMotif = /* @__PURE__ */ ((PaiementAnnulationMotif2) => {
|
|
485
|
+
PaiementAnnulationMotif2["AC03"] = "AC03";
|
|
486
|
+
PaiementAnnulationMotif2["AM09"] = "AM09";
|
|
487
|
+
PaiementAnnulationMotif2["SVNR"] = "SVNR";
|
|
488
|
+
PaiementAnnulationMotif2["DUPL"] = "DUPL";
|
|
489
|
+
PaiementAnnulationMotif2["FRAD"] = "FRAD";
|
|
490
|
+
return PaiementAnnulationMotif2;
|
|
491
|
+
})(PaiementAnnulationMotif || {});
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
// src/generated/models/PaiementAnnulationStatutRaison.ts
|
|
496
|
+
var PaiementAnnulationStatutRaison;
|
|
497
|
+
var init_PaiementAnnulationStatutRaison = __esm({
|
|
498
|
+
"src/generated/models/PaiementAnnulationStatutRaison.ts"() {
|
|
499
|
+
"use strict";
|
|
500
|
+
PaiementAnnulationStatutRaison = /* @__PURE__ */ ((PaiementAnnulationStatutRaison2) => {
|
|
501
|
+
PaiementAnnulationStatutRaison2["CUST"] = "CUST";
|
|
502
|
+
PaiementAnnulationStatutRaison2["AC04"] = "AC04";
|
|
503
|
+
PaiementAnnulationStatutRaison2["ARDT"] = "ARDT";
|
|
504
|
+
PaiementAnnulationStatutRaison2["AG10"] = "AG10";
|
|
505
|
+
PaiementAnnulationStatutRaison2["AG11"] = "AG11";
|
|
506
|
+
PaiementAnnulationStatutRaison2["FR01"] = "FR01";
|
|
507
|
+
PaiementAnnulationStatutRaison2["RR04"] = "RR04";
|
|
508
|
+
return PaiementAnnulationStatutRaison2;
|
|
509
|
+
})(PaiementAnnulationStatutRaison || {});
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
// src/generated/models/PaiementEnMasseReponseStatut.ts
|
|
514
|
+
var PaiementEnMasseReponseStatut;
|
|
515
|
+
var init_PaiementEnMasseReponseStatut = __esm({
|
|
516
|
+
"src/generated/models/PaiementEnMasseReponseStatut.ts"() {
|
|
517
|
+
"use strict";
|
|
518
|
+
((PaiementEnMasseReponseStatut2) => {
|
|
519
|
+
let statut;
|
|
520
|
+
((statut2) => {
|
|
521
|
+
statut2["INITIE"] = "INITIE";
|
|
522
|
+
statut2["CONFIRME"] = "CONFIRME";
|
|
523
|
+
statut2["ANNULE"] = "ANNULE";
|
|
524
|
+
})(statut = PaiementEnMasseReponseStatut2.statut || (PaiementEnMasseReponseStatut2.statut = {}));
|
|
525
|
+
})(PaiementEnMasseReponseStatut || (PaiementEnMasseReponseStatut = {}));
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
// src/generated/models/PaiementImmediatConfirmationReponse.ts
|
|
530
|
+
var PaiementImmediatConfirmationReponse;
|
|
531
|
+
var init_PaiementImmediatConfirmationReponse = __esm({
|
|
532
|
+
"src/generated/models/PaiementImmediatConfirmationReponse.ts"() {
|
|
533
|
+
"use strict";
|
|
534
|
+
((PaiementImmediatConfirmationReponse2) => {
|
|
535
|
+
let statut;
|
|
536
|
+
((statut2) => {
|
|
537
|
+
statut2["ENVOYE"] = "ENVOYE";
|
|
538
|
+
})(statut = PaiementImmediatConfirmationReponse2.statut || (PaiementImmediatConfirmationReponse2.statut = {}));
|
|
539
|
+
})(PaiementImmediatConfirmationReponse || (PaiementImmediatConfirmationReponse = {}));
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
// src/generated/models/PaiementImmediatReponse.ts
|
|
544
|
+
var PaiementImmediatReponse;
|
|
545
|
+
var init_PaiementImmediatReponse = __esm({
|
|
546
|
+
"src/generated/models/PaiementImmediatReponse.ts"() {
|
|
547
|
+
"use strict";
|
|
548
|
+
((PaiementImmediatReponse2) => {
|
|
549
|
+
let statut;
|
|
550
|
+
((statut2) => {
|
|
551
|
+
statut2["INITIE"] = "INITIE";
|
|
552
|
+
})(statut = PaiementImmediatReponse2.statut || (PaiementImmediatReponse2.statut = {}));
|
|
553
|
+
})(PaiementImmediatReponse || (PaiementImmediatReponse = {}));
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// src/generated/models/PaiementStatut.ts
|
|
558
|
+
var PaiementStatut;
|
|
559
|
+
var init_PaiementStatut = __esm({
|
|
560
|
+
"src/generated/models/PaiementStatut.ts"() {
|
|
561
|
+
"use strict";
|
|
562
|
+
PaiementStatut = /* @__PURE__ */ ((PaiementStatut2) => {
|
|
563
|
+
PaiementStatut2["INITIE"] = "INITIE";
|
|
564
|
+
PaiementStatut2["ENVOYE"] = "ENVOYE";
|
|
565
|
+
PaiementStatut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
566
|
+
PaiementStatut2["REJETE"] = "REJETE";
|
|
567
|
+
return PaiementStatut2;
|
|
568
|
+
})(PaiementStatut || {});
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// src/generated/models/PaiementStatutRaison.ts
|
|
573
|
+
var PaiementStatutRaison;
|
|
574
|
+
var init_PaiementStatutRaison = __esm({
|
|
575
|
+
"src/generated/models/PaiementStatutRaison.ts"() {
|
|
576
|
+
"use strict";
|
|
577
|
+
PaiementStatutRaison = /* @__PURE__ */ ((PaiementStatutRaison2) => {
|
|
578
|
+
PaiementStatutRaison2["BE23"] = "BE23";
|
|
579
|
+
PaiementStatutRaison2["DU03"] = "DU03";
|
|
580
|
+
PaiementStatutRaison2["AB03"] = "AB03";
|
|
581
|
+
PaiementStatutRaison2["AB04"] = "AB04";
|
|
582
|
+
PaiementStatutRaison2["AB08"] = "AB08";
|
|
583
|
+
PaiementStatutRaison2["AB09"] = "AB09";
|
|
584
|
+
PaiementStatutRaison2["AC03"] = "AC03";
|
|
585
|
+
PaiementStatutRaison2["AC06"] = "AC06";
|
|
586
|
+
PaiementStatutRaison2["AC07"] = "AC07";
|
|
587
|
+
PaiementStatutRaison2["AG01"] = "AG01";
|
|
588
|
+
PaiementStatutRaison2["AG10"] = "AG10";
|
|
589
|
+
PaiementStatutRaison2["AG11"] = "AG11";
|
|
590
|
+
PaiementStatutRaison2["AEXR"] = "AEXR";
|
|
591
|
+
PaiementStatutRaison2["ALAC"] = "ALAC";
|
|
592
|
+
PaiementStatutRaison2["AM02"] = "AM02";
|
|
593
|
+
PaiementStatutRaison2["AM04"] = "AM04";
|
|
594
|
+
PaiementStatutRaison2["AM09"] = "AM09";
|
|
595
|
+
PaiementStatutRaison2["AM21"] = "AM21";
|
|
596
|
+
PaiementStatutRaison2["ARFR"] = "ARFR";
|
|
597
|
+
PaiementStatutRaison2["ARJR"] = "ARJR";
|
|
598
|
+
PaiementStatutRaison2["BE01"] = "BE01";
|
|
599
|
+
PaiementStatutRaison2["FR01"] = "FR01";
|
|
600
|
+
PaiementStatutRaison2["IRNR"] = "IRNR";
|
|
601
|
+
PaiementStatutRaison2["RR04"] = "RR04";
|
|
602
|
+
return PaiementStatutRaison2;
|
|
603
|
+
})(PaiementStatutRaison || {});
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
// src/generated/models/RefDocType.ts
|
|
608
|
+
var RefDocType;
|
|
609
|
+
var init_RefDocType = __esm({
|
|
610
|
+
"src/generated/models/RefDocType.ts"() {
|
|
611
|
+
"use strict";
|
|
612
|
+
RefDocType = /* @__PURE__ */ ((RefDocType2) => {
|
|
613
|
+
RefDocType2["CINV"] = "CINV";
|
|
614
|
+
RefDocType2["CMCN"] = "CMCN";
|
|
615
|
+
RefDocType2["DISP"] = "DISP";
|
|
616
|
+
RefDocType2["PUOR"] = "PUOR";
|
|
617
|
+
RefDocType2["CONT"] = "CONT";
|
|
618
|
+
RefDocType2["HIRI"] = "HIRI";
|
|
619
|
+
RefDocType2["INVS"] = "INVS";
|
|
620
|
+
RefDocType2["MSIN"] = "MSIN";
|
|
621
|
+
RefDocType2["PROF"] = "PROF";
|
|
622
|
+
RefDocType2["QUOT"] = "QUOT";
|
|
623
|
+
RefDocType2["SPRR"] = "SPRR";
|
|
624
|
+
RefDocType2["TISH"] = "TISH";
|
|
625
|
+
RefDocType2["USAR"] = "USAR";
|
|
626
|
+
RefDocType2["BOLD"] = "BOLD";
|
|
627
|
+
RefDocType2["SOAC"] = "SOAC";
|
|
628
|
+
RefDocType2["VCHR"] = "VCHR";
|
|
629
|
+
return RefDocType2;
|
|
630
|
+
})(RefDocType || {});
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
// src/generated/models/RetourStatut.ts
|
|
635
|
+
var RetourStatut;
|
|
636
|
+
var init_RetourStatut = __esm({
|
|
637
|
+
"src/generated/models/RetourStatut.ts"() {
|
|
638
|
+
"use strict";
|
|
639
|
+
RetourStatut = /* @__PURE__ */ ((RetourStatut2) => {
|
|
640
|
+
RetourStatut2["INITIE"] = "INITIE";
|
|
641
|
+
RetourStatut2["ENVOYE"] = "ENVOYE";
|
|
642
|
+
RetourStatut2["IRREVOCABLE"] = "IRREVOCABLE";
|
|
643
|
+
RetourStatut2["REJETE"] = "REJETE";
|
|
644
|
+
return RetourStatut2;
|
|
645
|
+
})(RetourStatut || {});
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
// src/generated/models/RetourStatutRaison.ts
|
|
650
|
+
var RetourStatutRaison;
|
|
651
|
+
var init_RetourStatutRaison = __esm({
|
|
652
|
+
"src/generated/models/RetourStatutRaison.ts"() {
|
|
653
|
+
"use strict";
|
|
654
|
+
RetourStatutRaison = /* @__PURE__ */ ((RetourStatutRaison2) => {
|
|
655
|
+
RetourStatutRaison2["AB03"] = "AB03";
|
|
656
|
+
RetourStatutRaison2["AB04"] = "AB04";
|
|
657
|
+
RetourStatutRaison2["AC06"] = "AC06";
|
|
658
|
+
RetourStatutRaison2["AG10"] = "AG10";
|
|
659
|
+
RetourStatutRaison2["AG11"] = "AG11";
|
|
660
|
+
RetourStatutRaison2["AM04"] = "AM04";
|
|
661
|
+
RetourStatutRaison2["AM09"] = "AM09";
|
|
662
|
+
RetourStatutRaison2["FR01"] = "FR01";
|
|
663
|
+
RetourStatutRaison2["RR04"] = "RR04";
|
|
664
|
+
return RetourStatutRaison2;
|
|
665
|
+
})(RetourStatutRaison || {});
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// src/generated/models/WebhookEvent.ts
|
|
670
|
+
var WebhookEvent;
|
|
671
|
+
var init_WebhookEvent = __esm({
|
|
672
|
+
"src/generated/models/WebhookEvent.ts"() {
|
|
673
|
+
"use strict";
|
|
674
|
+
((WebhookEvent2) => {
|
|
675
|
+
let refDocType;
|
|
676
|
+
((refDocType2) => {
|
|
677
|
+
refDocType2["CINV"] = "CINV";
|
|
678
|
+
refDocType2["CMCN"] = "CMCN";
|
|
679
|
+
refDocType2["DISP"] = "DISP";
|
|
680
|
+
refDocType2["PUOR"] = "PUOR";
|
|
681
|
+
refDocType2["CONT"] = "CONT";
|
|
682
|
+
refDocType2["HIRI"] = "HIRI";
|
|
683
|
+
refDocType2["INVS"] = "INVS";
|
|
684
|
+
refDocType2["MSIN"] = "MSIN";
|
|
685
|
+
refDocType2["PROF"] = "PROF";
|
|
686
|
+
refDocType2["QUOT"] = "QUOT";
|
|
687
|
+
refDocType2["SPRR"] = "SPRR";
|
|
688
|
+
refDocType2["TISH"] = "TISH";
|
|
689
|
+
refDocType2["USAR"] = "USAR";
|
|
690
|
+
refDocType2["BOLD"] = "BOLD";
|
|
691
|
+
refDocType2["SOAC"] = "SOAC";
|
|
692
|
+
refDocType2["VCHR"] = "VCHR";
|
|
693
|
+
})(refDocType = WebhookEvent2.refDocType || (WebhookEvent2.refDocType = {}));
|
|
694
|
+
})(WebhookEvent || (WebhookEvent = {}));
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// src/generated/models/WebhooksEvents.ts
|
|
699
|
+
var WebhooksEvents;
|
|
700
|
+
var init_WebhooksEvents = __esm({
|
|
701
|
+
"src/generated/models/WebhooksEvents.ts"() {
|
|
702
|
+
"use strict";
|
|
703
|
+
WebhooksEvents = /* @__PURE__ */ ((WebhooksEvents2) => {
|
|
704
|
+
WebhooksEvents2["PAIEMENT_RECU"] = "PAIEMENT_RECU";
|
|
705
|
+
WebhooksEvents2["PAIEMENT_ENVOYE"] = "PAIEMENT_ENVOYE";
|
|
706
|
+
WebhooksEvents2["PAIEMENT_REJETE"] = "PAIEMENT_REJETE";
|
|
707
|
+
WebhooksEvents2["RTP_RECU"] = "RTP_RECU";
|
|
708
|
+
WebhooksEvents2["RTP_REJETE"] = "RTP_REJETE";
|
|
709
|
+
WebhooksEvents2["ANNULATION_DEMANDE"] = "ANNULATION_DEMANDE";
|
|
710
|
+
WebhooksEvents2["ANNULATION_REJETE"] = "ANNULATION_REJETE";
|
|
711
|
+
WebhooksEvents2["RETOUR_ENVOYE"] = "RETOUR_ENVOYE";
|
|
712
|
+
WebhooksEvents2["RETOUR_REJETE"] = "RETOUR_REJETE";
|
|
713
|
+
WebhooksEvents2["RETOUR_RECU"] = "RETOUR_RECU";
|
|
714
|
+
return WebhooksEvents2;
|
|
715
|
+
})(WebhooksEvents || {});
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
// src/generated/core/request.ts
|
|
720
|
+
var import_axios, import_form_data, isDefined, isString, isStringWithValue, isBlob, isFormData, isSuccess, base64, getQueryString, getUrl, getFormData, resolve, getHeaders, getRequestBody, sendRequest, getResponseHeader, getResponseBody, catchErrorCodes, request;
|
|
721
|
+
var init_request = __esm({
|
|
722
|
+
"src/generated/core/request.ts"() {
|
|
723
|
+
"use strict";
|
|
724
|
+
import_axios = __toESM(require("axios"), 1);
|
|
725
|
+
import_form_data = __toESM(require("form-data"), 1);
|
|
726
|
+
init_ApiError();
|
|
727
|
+
init_CancelablePromise();
|
|
728
|
+
isDefined = (value) => {
|
|
729
|
+
return value !== void 0 && value !== null;
|
|
730
|
+
};
|
|
731
|
+
isString = (value) => {
|
|
732
|
+
return typeof value === "string";
|
|
733
|
+
};
|
|
734
|
+
isStringWithValue = (value) => {
|
|
735
|
+
return isString(value) && value !== "";
|
|
736
|
+
};
|
|
737
|
+
isBlob = (value) => {
|
|
738
|
+
return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
|
|
739
|
+
};
|
|
740
|
+
isFormData = (value) => {
|
|
741
|
+
return value instanceof import_form_data.default;
|
|
742
|
+
};
|
|
743
|
+
isSuccess = (status) => {
|
|
744
|
+
return status >= 200 && status < 300;
|
|
745
|
+
};
|
|
746
|
+
base64 = (str) => {
|
|
747
|
+
try {
|
|
748
|
+
return btoa(str);
|
|
749
|
+
} catch (err) {
|
|
750
|
+
return Buffer.from(str).toString("base64");
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
getQueryString = (params) => {
|
|
754
|
+
const qs = [];
|
|
755
|
+
const append = (key, value) => {
|
|
756
|
+
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
|
757
|
+
};
|
|
758
|
+
const process = (key, value) => {
|
|
759
|
+
if (isDefined(value)) {
|
|
760
|
+
if (Array.isArray(value)) {
|
|
761
|
+
value.forEach((v) => {
|
|
762
|
+
process(key, v);
|
|
763
|
+
});
|
|
764
|
+
} else if (typeof value === "object") {
|
|
765
|
+
Object.entries(value).forEach(([k, v]) => {
|
|
766
|
+
process(`${key}[${k}]`, v);
|
|
767
|
+
});
|
|
768
|
+
} else {
|
|
769
|
+
append(key, value);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
774
|
+
process(key, value);
|
|
775
|
+
});
|
|
776
|
+
if (qs.length > 0) {
|
|
777
|
+
return `?${qs.join("&")}`;
|
|
778
|
+
}
|
|
779
|
+
return "";
|
|
780
|
+
};
|
|
781
|
+
getUrl = (config, options) => {
|
|
782
|
+
const encoder = config.ENCODE_PATH || encodeURI;
|
|
783
|
+
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
784
|
+
if (options.path?.hasOwnProperty(group)) {
|
|
785
|
+
return encoder(String(options.path[group]));
|
|
786
|
+
}
|
|
787
|
+
return substring;
|
|
788
|
+
});
|
|
789
|
+
const url = `${config.BASE}${path}`;
|
|
790
|
+
if (options.query) {
|
|
791
|
+
return `${url}${getQueryString(options.query)}`;
|
|
792
|
+
}
|
|
793
|
+
return url;
|
|
794
|
+
};
|
|
795
|
+
getFormData = (options) => {
|
|
796
|
+
if (options.formData) {
|
|
797
|
+
const formData = new import_form_data.default();
|
|
798
|
+
const process = (key, value) => {
|
|
799
|
+
if (isString(value) || isBlob(value)) {
|
|
800
|
+
formData.append(key, value);
|
|
801
|
+
} else {
|
|
802
|
+
formData.append(key, JSON.stringify(value));
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
|
|
806
|
+
if (Array.isArray(value)) {
|
|
807
|
+
value.forEach((v) => process(key, v));
|
|
808
|
+
} else {
|
|
809
|
+
process(key, value);
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
return formData;
|
|
813
|
+
}
|
|
814
|
+
return void 0;
|
|
815
|
+
};
|
|
816
|
+
resolve = async (options, resolver) => {
|
|
817
|
+
if (typeof resolver === "function") {
|
|
818
|
+
return resolver(options);
|
|
819
|
+
}
|
|
820
|
+
return resolver;
|
|
821
|
+
};
|
|
822
|
+
getHeaders = async (config, options, formData) => {
|
|
823
|
+
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
824
|
+
resolve(options, config.TOKEN),
|
|
825
|
+
resolve(options, config.USERNAME),
|
|
826
|
+
resolve(options, config.PASSWORD),
|
|
827
|
+
resolve(options, config.HEADERS)
|
|
828
|
+
]);
|
|
829
|
+
const formHeaders = typeof formData?.getHeaders === "function" && formData?.getHeaders() || {};
|
|
830
|
+
const headers = Object.entries({
|
|
831
|
+
Accept: "application/json",
|
|
832
|
+
...additionalHeaders,
|
|
833
|
+
...options.headers,
|
|
834
|
+
...formHeaders
|
|
835
|
+
}).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
|
|
836
|
+
...headers2,
|
|
837
|
+
[key]: String(value)
|
|
838
|
+
}), {});
|
|
839
|
+
if (isStringWithValue(token)) {
|
|
840
|
+
headers["Authorization"] = `Bearer ${token}`;
|
|
841
|
+
}
|
|
842
|
+
if (isStringWithValue(username) && isStringWithValue(password)) {
|
|
843
|
+
const credentials = base64(`${username}:${password}`);
|
|
844
|
+
headers["Authorization"] = `Basic ${credentials}`;
|
|
845
|
+
}
|
|
846
|
+
if (options.body !== void 0) {
|
|
847
|
+
if (options.mediaType) {
|
|
848
|
+
headers["Content-Type"] = options.mediaType;
|
|
849
|
+
} else if (isBlob(options.body)) {
|
|
850
|
+
headers["Content-Type"] = options.body.type || "application/octet-stream";
|
|
851
|
+
} else if (isString(options.body)) {
|
|
852
|
+
headers["Content-Type"] = "text/plain";
|
|
853
|
+
} else if (!isFormData(options.body)) {
|
|
854
|
+
headers["Content-Type"] = "application/json";
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
return headers;
|
|
858
|
+
};
|
|
859
|
+
getRequestBody = (options) => {
|
|
860
|
+
if (options.body) {
|
|
861
|
+
return options.body;
|
|
862
|
+
}
|
|
863
|
+
return void 0;
|
|
864
|
+
};
|
|
865
|
+
sendRequest = async (config, options, url, body, formData, headers, onCancel, axiosClient) => {
|
|
866
|
+
const source = import_axios.default.CancelToken.source();
|
|
867
|
+
const requestConfig = {
|
|
868
|
+
url,
|
|
869
|
+
headers,
|
|
870
|
+
data: body ?? formData,
|
|
871
|
+
method: options.method,
|
|
872
|
+
withCredentials: config.WITH_CREDENTIALS,
|
|
873
|
+
withXSRFToken: config.CREDENTIALS === "include" ? config.WITH_CREDENTIALS : false,
|
|
874
|
+
cancelToken: source.token
|
|
875
|
+
};
|
|
876
|
+
onCancel(() => source.cancel("The user aborted a request."));
|
|
877
|
+
try {
|
|
878
|
+
return await axiosClient.request(requestConfig);
|
|
879
|
+
} catch (error) {
|
|
880
|
+
const axiosError = error;
|
|
881
|
+
if (axiosError.response) {
|
|
882
|
+
return axiosError.response;
|
|
883
|
+
}
|
|
884
|
+
throw error;
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
getResponseHeader = (response, responseHeader) => {
|
|
888
|
+
if (responseHeader) {
|
|
889
|
+
const content = response.headers[responseHeader];
|
|
890
|
+
if (isString(content)) {
|
|
891
|
+
return content;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
return void 0;
|
|
895
|
+
};
|
|
896
|
+
getResponseBody = (response) => {
|
|
897
|
+
if (response.status !== 204) {
|
|
898
|
+
return response.data;
|
|
899
|
+
}
|
|
900
|
+
return void 0;
|
|
901
|
+
};
|
|
902
|
+
catchErrorCodes = (options, result) => {
|
|
903
|
+
const errors = {
|
|
904
|
+
400: "Bad Request",
|
|
905
|
+
401: "Unauthorized",
|
|
906
|
+
403: "Forbidden",
|
|
907
|
+
404: "Not Found",
|
|
908
|
+
500: "Internal Server Error",
|
|
909
|
+
502: "Bad Gateway",
|
|
910
|
+
503: "Service Unavailable",
|
|
911
|
+
...options.errors
|
|
912
|
+
};
|
|
913
|
+
const error = errors[result.status];
|
|
914
|
+
if (error) {
|
|
915
|
+
throw new ApiError(options, result, error);
|
|
916
|
+
}
|
|
917
|
+
if (!result.ok) {
|
|
918
|
+
const errorStatus = result.status ?? "unknown";
|
|
919
|
+
const errorStatusText = result.statusText ?? "unknown";
|
|
920
|
+
const errorBody = (() => {
|
|
921
|
+
try {
|
|
922
|
+
return JSON.stringify(result.body, null, 2);
|
|
923
|
+
} catch (e) {
|
|
924
|
+
return void 0;
|
|
925
|
+
}
|
|
926
|
+
})();
|
|
927
|
+
throw new ApiError(
|
|
928
|
+
options,
|
|
929
|
+
result,
|
|
930
|
+
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
request = (config, options, axiosClient = import_axios.default) => {
|
|
935
|
+
return new CancelablePromise(async (resolve2, reject, onCancel) => {
|
|
936
|
+
try {
|
|
937
|
+
const url = getUrl(config, options);
|
|
938
|
+
const formData = getFormData(options);
|
|
939
|
+
const body = getRequestBody(options);
|
|
940
|
+
const headers = await getHeaders(config, options, formData);
|
|
941
|
+
if (!onCancel.isCancelled) {
|
|
942
|
+
const response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient);
|
|
943
|
+
const responseBody = getResponseBody(response);
|
|
944
|
+
const responseHeader = getResponseHeader(response, options.responseHeader);
|
|
945
|
+
const result = {
|
|
946
|
+
url,
|
|
947
|
+
ok: isSuccess(response.status),
|
|
948
|
+
status: response.status,
|
|
949
|
+
statusText: response.statusText,
|
|
950
|
+
body: responseHeader ?? responseBody
|
|
951
|
+
};
|
|
952
|
+
catchErrorCodes(options, result);
|
|
953
|
+
resolve2(result.body);
|
|
954
|
+
}
|
|
955
|
+
} catch (error) {
|
|
956
|
+
reject(error);
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// src/generated/services/AliasService.ts
|
|
964
|
+
var AliasService2;
|
|
965
|
+
var init_AliasService = __esm({
|
|
966
|
+
"src/generated/services/AliasService.ts"() {
|
|
967
|
+
"use strict";
|
|
968
|
+
init_OpenAPI();
|
|
969
|
+
init_request();
|
|
970
|
+
AliasService2 = class {
|
|
971
|
+
/**
|
|
972
|
+
* Créer un alias
|
|
973
|
+
* Le répertoire des alias de compte permet de créer les types d'alias suivants :
|
|
974
|
+
* - Une adresse de paiement, codifiée par SHID: cet alias est obtenu par génération d'une clé aléatoire unique sur 36 positions par le système.
|
|
975
|
+
* - Un identifiant de compte marchand, codifié par MCOD: ce type d'alias est prévu pour supporter les paiements par code USSD.
|
|
976
|
+
* - Un numéro de téléphone mobile, codifié par MBNO.
|
|
977
|
+
*
|
|
978
|
+
* Les types d'alias qu'on peut créer dépendent du type de client.
|
|
979
|
+
* Les clients de type P (particuliers, personnes physiques) peuvent créer des alias de types MBNO et SHID.
|
|
980
|
+
* Les clients de types C, B, et G (commerçants ou entreprises individuelles, entreprises, entités gouvernementales) peuvent créer des alias de types SHID et MCOD.
|
|
981
|
+
*
|
|
982
|
+
* Un client business peut créer plusieurs alias pour un compte donné.
|
|
983
|
+
* Une limite de 20 alias par compte est fixée par défaut. Cette limite peut être augmentée selon les besoins du client.
|
|
984
|
+
*
|
|
985
|
+
* @returns AliasCreationReponse Opération effectuée avec succès
|
|
986
|
+
* @throws ApiError
|
|
987
|
+
*/
|
|
988
|
+
static aliasCreer({
|
|
989
|
+
numero,
|
|
990
|
+
requestBody
|
|
991
|
+
}) {
|
|
992
|
+
return request(OpenAPI2, {
|
|
993
|
+
method: "POST",
|
|
994
|
+
url: "/comptes/{numero}/alias",
|
|
995
|
+
path: {
|
|
996
|
+
"numero": numero
|
|
997
|
+
},
|
|
998
|
+
body: requestBody,
|
|
999
|
+
mediaType: "application/json",
|
|
1000
|
+
errors: {
|
|
1001
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1002
|
+
401: `Autorisations manquantes`,
|
|
1003
|
+
403: `Op\xE9ration interdite`,
|
|
1004
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1005
|
+
429: `Erreur inattendue`,
|
|
1006
|
+
503: `Erreur inattendue du serveur`
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Lister les alias
|
|
1012
|
+
* Ce point de terminaison permet de consulter la liste des alias d'un compte.
|
|
1013
|
+
*
|
|
1014
|
+
* @returns AliasReponseListe Succès de l'opération
|
|
1015
|
+
* @throws ApiError
|
|
1016
|
+
*/
|
|
1017
|
+
static aliasLister({
|
|
1018
|
+
numero
|
|
1019
|
+
}) {
|
|
1020
|
+
return request(OpenAPI2, {
|
|
1021
|
+
method: "GET",
|
|
1022
|
+
url: "/comptes/{numero}/alias",
|
|
1023
|
+
path: {
|
|
1024
|
+
"numero": numero
|
|
1025
|
+
},
|
|
1026
|
+
errors: {
|
|
1027
|
+
401: `Autorisations manquantes`,
|
|
1028
|
+
429: `Erreur inattendue`,
|
|
1029
|
+
503: `Erreur inattendue du serveur`
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Supprimer un alias
|
|
1035
|
+
* Le client peut supprimer à tout moment un alias de compte.
|
|
1036
|
+
*
|
|
1037
|
+
* @returns void
|
|
1038
|
+
* @throws ApiError
|
|
1039
|
+
*/
|
|
1040
|
+
static aliasSupprimer({
|
|
1041
|
+
numero,
|
|
1042
|
+
cle
|
|
1043
|
+
}) {
|
|
1044
|
+
return request(OpenAPI2, {
|
|
1045
|
+
method: "DELETE",
|
|
1046
|
+
url: "/comptes/{numero}/alias/{cle}",
|
|
1047
|
+
path: {
|
|
1048
|
+
"numero": numero,
|
|
1049
|
+
"cle": cle
|
|
1050
|
+
},
|
|
1051
|
+
errors: {
|
|
1052
|
+
401: `Autorisations manquantes`,
|
|
1053
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1054
|
+
429: `Erreur inattendue`,
|
|
1055
|
+
503: `Erreur inattendue du serveur`
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
// src/generated/services/ComptesService.ts
|
|
1064
|
+
var ComptesService2;
|
|
1065
|
+
var init_ComptesService = __esm({
|
|
1066
|
+
"src/generated/services/ComptesService.ts"() {
|
|
1067
|
+
"use strict";
|
|
1068
|
+
init_OpenAPI();
|
|
1069
|
+
init_request();
|
|
1070
|
+
ComptesService2 = class {
|
|
1071
|
+
/**
|
|
1072
|
+
* Détails d'un compte
|
|
1073
|
+
* Cet endpoint permet au client de consulter à tout moment les informations détaillées relatives à un compte spécifique.
|
|
1074
|
+
*
|
|
1075
|
+
* Les informations retournées incluent :
|
|
1076
|
+
* - Le type de compte (compte courant, épargne, etc.)
|
|
1077
|
+
* - Le numéro du compte
|
|
1078
|
+
* - La date d'ouverture du compte
|
|
1079
|
+
* - Le solde actuel du compte
|
|
1080
|
+
* - Le statut du compte (ouvert, bloqué ou clôturé)
|
|
1081
|
+
* - L'indicateur de pré-confirmation pour les opérations
|
|
1082
|
+
*
|
|
1083
|
+
* Cette consultation permet au client business de surveiller l'état de ses comptes en temps réel et de prendre des décisions éclairées concernant ses opérations financières.
|
|
1084
|
+
*
|
|
1085
|
+
* @returns CompteSolde Succès de l'opération
|
|
1086
|
+
* @throws ApiError
|
|
1087
|
+
*/
|
|
1088
|
+
static compteSoldeConsulter({
|
|
1089
|
+
numero
|
|
1090
|
+
}) {
|
|
1091
|
+
return request(OpenAPI2, {
|
|
1092
|
+
method: "GET",
|
|
1093
|
+
url: "/comptes/{numero}",
|
|
1094
|
+
path: {
|
|
1095
|
+
"numero": numero
|
|
1096
|
+
},
|
|
1097
|
+
errors: {
|
|
1098
|
+
401: `Autorisations manquantes`,
|
|
1099
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1100
|
+
429: `Erreur inattendue`,
|
|
1101
|
+
503: `Erreur inattendue du serveur`
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Transfert intra-comptes
|
|
1107
|
+
* Le transfert intra-comptes est un transfert de fonds entre deux comptes détenus par la même entité juridique et domiciliés au sein de la même institution financière. Le compte source (débiteur/payeur) et le compte destination (créditeur/bénéficiaire) appartiennent donc au même client.
|
|
1108
|
+
*
|
|
1109
|
+
* @returns CompteTransfertIntraReponse Transfert initié avec succès.
|
|
1110
|
+
* @throws ApiError
|
|
1111
|
+
*/
|
|
1112
|
+
static compteTransfertIntraCreer({
|
|
1113
|
+
requestBody
|
|
1114
|
+
}) {
|
|
1115
|
+
return request(OpenAPI2, {
|
|
1116
|
+
method: "POST",
|
|
1117
|
+
url: "/comptes/transactions",
|
|
1118
|
+
body: requestBody,
|
|
1119
|
+
mediaType: "application/json",
|
|
1120
|
+
errors: {
|
|
1121
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1122
|
+
401: `Autorisations manquantes`,
|
|
1123
|
+
403: `Interdiction d'effectuer le paiement`,
|
|
1124
|
+
429: `Erreur inattendue`,
|
|
1125
|
+
503: `Erreur inattendue du serveur`
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Lister les transferts intra-comptes
|
|
1131
|
+
* @returns CompteOperationListe Succès de l'opération
|
|
1132
|
+
* @throws ApiError
|
|
1133
|
+
*/
|
|
1134
|
+
static compteTransfertIntraLister({
|
|
1135
|
+
statut,
|
|
1136
|
+
comptePayeur,
|
|
1137
|
+
comptePaye,
|
|
1138
|
+
dateEnvoi,
|
|
1139
|
+
dateIrrevocabilite,
|
|
1140
|
+
motif,
|
|
1141
|
+
page,
|
|
1142
|
+
size,
|
|
1143
|
+
sort,
|
|
1144
|
+
fields
|
|
1145
|
+
}) {
|
|
1146
|
+
return request(OpenAPI2, {
|
|
1147
|
+
method: "GET",
|
|
1148
|
+
url: "/comptes/transactions",
|
|
1149
|
+
query: {
|
|
1150
|
+
"statut": statut,
|
|
1151
|
+
"comptePayeur": comptePayeur,
|
|
1152
|
+
"comptePaye": comptePaye,
|
|
1153
|
+
"dateEnvoi": dateEnvoi,
|
|
1154
|
+
"dateIrrevocabilite": dateIrrevocabilite,
|
|
1155
|
+
"motif": motif,
|
|
1156
|
+
"page": page,
|
|
1157
|
+
"size": size,
|
|
1158
|
+
"sort": sort,
|
|
1159
|
+
"fields": fields
|
|
1160
|
+
},
|
|
1161
|
+
errors: {
|
|
1162
|
+
401: `Autorisations manquantes`,
|
|
1163
|
+
429: `Erreur inattendue`,
|
|
1164
|
+
503: `Erreur inattendue du serveur`
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
|
|
1172
|
+
// src/generated/services/DemandeAnnulationService.ts
|
|
1173
|
+
var DemandeAnnulationService;
|
|
1174
|
+
var init_DemandeAnnulationService = __esm({
|
|
1175
|
+
"src/generated/services/DemandeAnnulationService.ts"() {
|
|
1176
|
+
"use strict";
|
|
1177
|
+
init_OpenAPI();
|
|
1178
|
+
init_request();
|
|
1179
|
+
DemandeAnnulationService = class {
|
|
1180
|
+
/**
|
|
1181
|
+
* Demander l'annulation d'un paiement
|
|
1182
|
+
* Ce point de terminaison permet de demander l'annulation d'un paiement envoyé.
|
|
1183
|
+
*
|
|
1184
|
+
* À l'acceptation de la demande d'annulation, le payé effectue un retour de fonds et le business recevra une notification `RETOUR_RECU` s'il a souscrit au service de webhook.
|
|
1185
|
+
*
|
|
1186
|
+
* Si le payé refuse la demande d'annulation, le business recevra une notification `ANNULATION_REJETE`.
|
|
1187
|
+
*
|
|
1188
|
+
* **Note importante sur l'idempotence :**
|
|
1189
|
+
*
|
|
1190
|
+
* Cet endpoint utilise **POST (pas PUT)** car chaque appel envoie une **nouvelle demande d'annulation** au PSP bénéficiaire.
|
|
1191
|
+
*
|
|
1192
|
+
* **Comportement :**
|
|
1193
|
+
* - Premier appel → Nouvelle demande d'annulation envoyée
|
|
1194
|
+
* - Deuxième appel → **Nouvelle demande d'annulation envoyée** (pas idempotent)
|
|
1195
|
+
* - Troisième appel → **Nouvelle demande d'annulation envoyée**
|
|
1196
|
+
*
|
|
1197
|
+
* **Cas d'usage :**
|
|
1198
|
+
* - La première demande a été refusée, vous réessayez
|
|
1199
|
+
* - Vous voulez relancer une demande en attente
|
|
1200
|
+
* - Vous avez de nouvelles informations justifiant l'annulation
|
|
1201
|
+
*
|
|
1202
|
+
* @returns Paiement Demande d'annulation envoyée
|
|
1203
|
+
* @throws ApiError
|
|
1204
|
+
*/
|
|
1205
|
+
static demandeAnnulationEnvoyer({
|
|
1206
|
+
end2EndId,
|
|
1207
|
+
requestBody
|
|
1208
|
+
}) {
|
|
1209
|
+
return request(OpenAPI2, {
|
|
1210
|
+
method: "POST",
|
|
1211
|
+
url: "/paiements/{end2endId}/annulations",
|
|
1212
|
+
path: {
|
|
1213
|
+
"end2endId": end2EndId
|
|
1214
|
+
},
|
|
1215
|
+
body: requestBody,
|
|
1216
|
+
mediaType: "application/json",
|
|
1217
|
+
errors: {
|
|
1218
|
+
401: `Autorisations manquantes`,
|
|
1219
|
+
403: `Interdiction d'effectuer la demande d'annulation`,
|
|
1220
|
+
429: `Erreur inattendue`,
|
|
1221
|
+
503: `Erreur inattendue du serveur`
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Répondre à une demande d'annulation
|
|
1227
|
+
* Ce point de terminaison permet au business de répondre à une demande d'annulation de paiement.
|
|
1228
|
+
*
|
|
1229
|
+
* Le business peut accepter ou refuser la demande d'annulation :
|
|
1230
|
+
* - `decision: true` : Accepte la demande d'annulation (le business effectuera un retour de fonds)
|
|
1231
|
+
* - `decision: false` : Refuse la demande d'annulation
|
|
1232
|
+
*
|
|
1233
|
+
* **Idempotence** : Cet endpoint est idempotent.
|
|
1234
|
+
* - Premier appel avec `decision: true` → Accepte la demande, retourne `200 OK {statut: "ACCEPTEE"}`
|
|
1235
|
+
* - Appels suivants avec `decision: true` → Retourne `200 OK` avec l'état actuel - idempotent
|
|
1236
|
+
* - Premier appel avec `decision: false` → Refuse la demande, retourne `200 OK {statut: "REJETEE"}`
|
|
1237
|
+
* - Appels suivants avec `decision: false` → Retourne `200 OK {statut: "REJETEE"}` (idempotent)
|
|
1238
|
+
* - `decision: true` après `decision: false` → Retourne `403 Forbidden` (déjà refusée)
|
|
1239
|
+
* - `decision: false` après `decision: true` → Retourne `403 Forbidden` (déjà acceptée)
|
|
1240
|
+
*
|
|
1241
|
+
* @returns Paiement Réponse à la demande d'annulation enregistrée.
|
|
1242
|
+
*
|
|
1243
|
+
* La réponse retourne l'objet `Paiement` complet avec les champs mis à jour selon la décision :
|
|
1244
|
+
*
|
|
1245
|
+
* **En cas d'acceptation (`decision: true`)** :
|
|
1246
|
+
* - `annulationStatut` : Mis à jour pour indiquer l'acceptation
|
|
1247
|
+
* - `annulationDateReponse` : Date et heure de la réponse à la demande d'annulation
|
|
1248
|
+
* - Un retour de fonds est automatiquement initié par le participant, donc les champs suivants sont également renseignés :
|
|
1249
|
+
* - `retourStatut` : Statut du retour de fonds (ex: `INITIE`, `ENVOYE`, `IRREVOCABLE`)
|
|
1250
|
+
* - `retourStatutRaison` : Raison du statut du retour de fonds
|
|
1251
|
+
* - `retourDateDemande` : Date de création du retour de fonds
|
|
1252
|
+
* - `retourDateIrrevocabilite` : Date à laquelle le retour de fonds est irrévocable (si applicable)
|
|
1253
|
+
*
|
|
1254
|
+
* **En cas de rejet (`decision: false`)** :
|
|
1255
|
+
* - `annulationStatut` : Mis à jour pour indiquer le rejet (ex: `REJETE`)
|
|
1256
|
+
* - `annulationDateReponse` : Date et heure de la réponse à la demande d'annulation
|
|
1257
|
+
* - Les champs `retour*` ne sont **pas** renseignés car aucun retour de fonds n'est effectué
|
|
1258
|
+
*
|
|
1259
|
+
* @throws ApiError
|
|
1260
|
+
*/
|
|
1261
|
+
static demandeAnnulationRepondre({
|
|
1262
|
+
end2EndId,
|
|
1263
|
+
requestBody
|
|
1264
|
+
}) {
|
|
1265
|
+
return request(OpenAPI2, {
|
|
1266
|
+
method: "PUT",
|
|
1267
|
+
url: "/paiements/{end2endId}/annulations/reponses",
|
|
1268
|
+
path: {
|
|
1269
|
+
"end2endId": end2EndId
|
|
1270
|
+
},
|
|
1271
|
+
body: requestBody,
|
|
1272
|
+
mediaType: "application/json",
|
|
1273
|
+
errors: {
|
|
1274
|
+
401: `Autorisations manquantes`,
|
|
1275
|
+
403: `Op\xE9ration interdite`,
|
|
1276
|
+
429: `Erreur inattendue`,
|
|
1277
|
+
503: `Erreur inattendue du serveur`
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
// src/generated/services/DemandesDePaiementService.ts
|
|
1286
|
+
var DemandesDePaiementService;
|
|
1287
|
+
var init_DemandesDePaiementService = __esm({
|
|
1288
|
+
"src/generated/services/DemandesDePaiementService.ts"() {
|
|
1289
|
+
"use strict";
|
|
1290
|
+
init_OpenAPI();
|
|
1291
|
+
init_request();
|
|
1292
|
+
DemandesDePaiementService = class {
|
|
1293
|
+
/**
|
|
1294
|
+
* Envoyer une demande
|
|
1295
|
+
* Ce point de terminaison permet d'envoyer une demande de paiement.
|
|
1296
|
+
*
|
|
1297
|
+
* Le business peut définir le champ `confirmation` à `true` pour demander une validation en deux étapes : le PSP retournera d'abord le résultat de la recherche d'alias (avec le nom et le pays du payeur), puis attendra une confirmation explicite avant d'envoyer la demande de paiement au payeur via l'endpoint `PUT /demandes-paiements/{txId}/confirmations`.
|
|
1298
|
+
*
|
|
1299
|
+
* Si le champ `confirmation` n'est pas défini ou est à `false`, le système envoie directement la demande de paiement au payeur.
|
|
1300
|
+
*
|
|
1301
|
+
* **Timeout de confirmation** : Si le business demande une validation en deux étapes , il dispose de **24 heures** pour confirmer ou annuler. Passé ce délai, la demande expire automatiquement.
|
|
1302
|
+
*
|
|
1303
|
+
* @returns DemandePaiementReponse Demande de paiement traitée. Le champ `statut` indique le résultat :
|
|
1304
|
+
* - `INITIE` : En attente de confirmation (si `confirmation: true`)
|
|
1305
|
+
* - `ENVOYE` : Demande envoyée au payeur avec succès (si `confirmation: false`)
|
|
1306
|
+
* - `REJETE` : Demande rejetée. Le champ `statutRaison` contient le code d'erreur :
|
|
1307
|
+
* - `DU03` : txId dupliqué (déjà utilisé)
|
|
1308
|
+
* - `BE23` : Alias payeur invalide
|
|
1309
|
+
* - Autres codes ISO 20022
|
|
1310
|
+
*
|
|
1311
|
+
* @throws ApiError
|
|
1312
|
+
*/
|
|
1313
|
+
static demandePaiementCreer({
|
|
1314
|
+
requestBody
|
|
1315
|
+
}) {
|
|
1316
|
+
return request(OpenAPI2, {
|
|
1317
|
+
method: "POST",
|
|
1318
|
+
url: "/demandes-paiements",
|
|
1319
|
+
body: requestBody,
|
|
1320
|
+
mediaType: "application/json",
|
|
1321
|
+
errors: {
|
|
1322
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1323
|
+
401: `Autorisations manquantes`,
|
|
1324
|
+
429: `Erreur inattendue`,
|
|
1325
|
+
503: `Erreur inattendue du serveur`
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Lister les demandes
|
|
1331
|
+
* Ce point de terminaison permet de lister les demandes de paiements effectuées par le client.
|
|
1332
|
+
* @returns DemandePaiementListe Succès de l'opération
|
|
1333
|
+
* @throws ApiError
|
|
1334
|
+
*/
|
|
1335
|
+
static demandePaiementLister({
|
|
1336
|
+
payeAlias,
|
|
1337
|
+
payeCompte,
|
|
1338
|
+
dateEnvoi,
|
|
1339
|
+
dateLimitePaiement,
|
|
1340
|
+
statut,
|
|
1341
|
+
categorie,
|
|
1342
|
+
payeurAlias,
|
|
1343
|
+
payeurCompte,
|
|
1344
|
+
montantAchat,
|
|
1345
|
+
montantRetrait,
|
|
1346
|
+
debitDiffere,
|
|
1347
|
+
remise,
|
|
1348
|
+
motif,
|
|
1349
|
+
refDocType,
|
|
1350
|
+
instructionId,
|
|
1351
|
+
page,
|
|
1352
|
+
size,
|
|
1353
|
+
sort,
|
|
1354
|
+
fields
|
|
1355
|
+
}) {
|
|
1356
|
+
return request(OpenAPI2, {
|
|
1357
|
+
method: "GET",
|
|
1358
|
+
url: "/demandes-paiements",
|
|
1359
|
+
query: {
|
|
1360
|
+
"payeAlias": payeAlias,
|
|
1361
|
+
"payeCompte": payeCompte,
|
|
1362
|
+
"dateEnvoi": dateEnvoi,
|
|
1363
|
+
"dateLimitePaiement": dateLimitePaiement,
|
|
1364
|
+
"statut": statut,
|
|
1365
|
+
"categorie": categorie,
|
|
1366
|
+
"payeurAlias": payeurAlias,
|
|
1367
|
+
"payeurCompte": payeurCompte,
|
|
1368
|
+
"montantAchat": montantAchat,
|
|
1369
|
+
"montantRetrait": montantRetrait,
|
|
1370
|
+
"debitDiffere": debitDiffere,
|
|
1371
|
+
"remise": remise,
|
|
1372
|
+
"motif": motif,
|
|
1373
|
+
"refDocType": refDocType,
|
|
1374
|
+
"instructionId": instructionId,
|
|
1375
|
+
"page": page,
|
|
1376
|
+
"size": size,
|
|
1377
|
+
"sort": sort,
|
|
1378
|
+
"fields": fields
|
|
1379
|
+
},
|
|
1380
|
+
errors: {
|
|
1381
|
+
401: `Autorisations manquantes`,
|
|
1382
|
+
429: `Erreur inattendue`,
|
|
1383
|
+
503: `Erreur inattendue du serveur`
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Consulter une demande
|
|
1389
|
+
* Cet point de terminaison permet de consulter les details d'une demande de paiement.
|
|
1390
|
+
*
|
|
1391
|
+
* @returns DemandePaiementConsultationReponse Opération effectuée avec succès
|
|
1392
|
+
* @throws ApiError
|
|
1393
|
+
*/
|
|
1394
|
+
static demandePaiementRecuperer({
|
|
1395
|
+
txId
|
|
1396
|
+
}) {
|
|
1397
|
+
return request(OpenAPI2, {
|
|
1398
|
+
method: "GET",
|
|
1399
|
+
url: "/demandes-paiements/{txId}",
|
|
1400
|
+
path: {
|
|
1401
|
+
"txId": txId
|
|
1402
|
+
},
|
|
1403
|
+
errors: {
|
|
1404
|
+
401: `Autorisations manquantes`,
|
|
1405
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1406
|
+
429: `Erreur inattendue`,
|
|
1407
|
+
503: `Erreur inattendue du serveur`
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Confirmer la demande
|
|
1413
|
+
* Ce point de terminaison permet d'envoyer la confirmation de l'envoi d'une demande de paiement.
|
|
1414
|
+
*
|
|
1415
|
+
* Le client business confirme oui ou non si le PSP peut envoyer la demande au payeur après vérification des informations d'identification (nom et pays du payeur).
|
|
1416
|
+
*
|
|
1417
|
+
* **Idempotence** : Cet endpoint est idempotent.
|
|
1418
|
+
* - Premier appel avec `decision: true` → Envoie la demande, retourne `200 OK {statut: "ENVOYE"}`
|
|
1419
|
+
* - Appels suivants avec `decision: true` → Retourne `200 OK` avec l'état actuel (ENVOYE, IRREVOCABLE, ou REJETE) - idempotent
|
|
1420
|
+
* - Premier appel avec `decision: false` → Annule, retourne `200 OK {statut: "ANNULE"}`
|
|
1421
|
+
* - Appels suivants avec `decision: false` → Retourne `200 OK {statut: "ANNULE"}` (idempotent)
|
|
1422
|
+
* - `decision: true` après `decision: false` → Retourne `403 Forbidden` (déjà annulé)
|
|
1423
|
+
* - `decision: false` après `decision: true` → Retourne `403 Forbidden` (déjà confirmé)
|
|
1424
|
+
*
|
|
1425
|
+
* **Timeout** : La confirmation doit être envoyée dans les **24 heures** suivant la création de la demande. Passé ce délai, la demande expire automatiquement et ne peut plus être confirmée.
|
|
1426
|
+
*
|
|
1427
|
+
* **Changement de décision** : Une fois une décision prise, elle est définitive. Impossible de confirmer après avoir annulé, et vice-versa.
|
|
1428
|
+
*
|
|
1429
|
+
* @returns DemandePaiementConfirmationReponse Opération effectuée avec succès
|
|
1430
|
+
* @throws ApiError
|
|
1431
|
+
*/
|
|
1432
|
+
static demandePaiementConfirmer({
|
|
1433
|
+
txId,
|
|
1434
|
+
requestBody
|
|
1435
|
+
}) {
|
|
1436
|
+
return request(OpenAPI2, {
|
|
1437
|
+
method: "PUT",
|
|
1438
|
+
url: "/demandes-paiements/{txId}/confirmations",
|
|
1439
|
+
path: {
|
|
1440
|
+
"txId": txId
|
|
1441
|
+
},
|
|
1442
|
+
body: requestBody,
|
|
1443
|
+
mediaType: "application/json",
|
|
1444
|
+
errors: {
|
|
1445
|
+
401: `Autorisations manquantes`,
|
|
1446
|
+
403: `Op\xE9ration interdite`,
|
|
1447
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1448
|
+
429: `Erreur inattendue`,
|
|
1449
|
+
503: `Erreur inattendue du serveur`
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Accepter ou rejeter la demande
|
|
1455
|
+
* Ce point de terminaison permet au client d'accepter ou de rejeter une demande de paiement reçue.
|
|
1456
|
+
* @returns any Opération effectuée avec succès
|
|
1457
|
+
* @throws ApiError
|
|
1458
|
+
*/
|
|
1459
|
+
static demandePaiementRepondre({
|
|
1460
|
+
txId,
|
|
1461
|
+
requestBody
|
|
1462
|
+
}) {
|
|
1463
|
+
return request(OpenAPI2, {
|
|
1464
|
+
method: "POST",
|
|
1465
|
+
url: "/demandes-paiements/{txId}/reponses",
|
|
1466
|
+
path: {
|
|
1467
|
+
"txId": txId
|
|
1468
|
+
},
|
|
1469
|
+
body: requestBody,
|
|
1470
|
+
mediaType: "application/json",
|
|
1471
|
+
errors: {
|
|
1472
|
+
401: `Autorisations manquantes`,
|
|
1473
|
+
403: `Interdiction d'effectuer le paiement`,
|
|
1474
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1475
|
+
429: `Erreur inattendue`,
|
|
1476
|
+
503: `Erreur inattendue du serveur`
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1484
|
+
// src/generated/services/DemandesDePaiementEnMasseService.ts
|
|
1485
|
+
var DemandesDePaiementEnMasseService;
|
|
1486
|
+
var init_DemandesDePaiementEnMasseService = __esm({
|
|
1487
|
+
"src/generated/services/DemandesDePaiementEnMasseService.ts"() {
|
|
1488
|
+
"use strict";
|
|
1489
|
+
init_OpenAPI();
|
|
1490
|
+
init_request();
|
|
1491
|
+
DemandesDePaiementEnMasseService = class {
|
|
1492
|
+
/**
|
|
1493
|
+
* Envoyer une demande de paiement en masse
|
|
1494
|
+
* Ce point de terminaison permet au client business d'envoyer plusieurs demandes de paiement à la fois.
|
|
1495
|
+
*
|
|
1496
|
+
* La catégorie des demandes de paiement en masse est toujours `401` (Autres demandes de paiement de facture).
|
|
1497
|
+
*
|
|
1498
|
+
* **Traitement asynchrone :** La création retourne immédiatement `202 Accepted`. Le traitement des transactions se fait de manière asynchrone.
|
|
1499
|
+
*
|
|
1500
|
+
* **Sans confirmation (`confirmation: false` ou non spécifié) :**
|
|
1501
|
+
* - Les transactions sont créées et validées (unicité des txId)
|
|
1502
|
+
* - Les demandes de paiement sont envoyées directement aux payeurs
|
|
1503
|
+
* - Les transactions avec txId dupliqué sont automatiquement rejetées avec le code `DU03`
|
|
1504
|
+
* - Les transactions avec alias de payeur invalide sont automatiquement rejetées avec le code `BE23`
|
|
1505
|
+
*
|
|
1506
|
+
* **Avec confirmation (`confirmation: true`) :**
|
|
1507
|
+
* - Les transactions sont créées et validées (unicité des txId + recherche d'alias des payeurs)
|
|
1508
|
+
* - Les transactions avec alias de payeur invalide sont rejetées avec le code `BE23`
|
|
1509
|
+
* - Les transactions avec txId dupliqué sont rejetées avec le code `DU03`
|
|
1510
|
+
* - Les transactions valides passent à l'état `INITIE` avec les noms et pays des payeurs
|
|
1511
|
+
* - Le business dispose d'un **délai adaptatif** pour confirmer ou annuler via `PUT /demandes-paiements-groupes/{instructionId}/confirmations` :
|
|
1512
|
+
* - **1 à 500 transactions** : 24 heures
|
|
1513
|
+
* - **501 à 1000 transactions** : 48 heures
|
|
1514
|
+
* - **Plus de 1000 transactions** : 72 heures
|
|
1515
|
+
* - Lors de la confirmation, seules les transactions `INITIE` sont envoyées (les transactions `REJETE` sont automatiquement exclues)
|
|
1516
|
+
* - Passé le délai, la demande expire automatiquement
|
|
1517
|
+
*
|
|
1518
|
+
* **Consultation des détails :**
|
|
1519
|
+
* - Statut global du bulk : `GET /demandes-paiements-groupes/{instructionId}`
|
|
1520
|
+
* - Liste de toutes les transactions : `GET /demandes-paiements?instructionId={instructionId}`
|
|
1521
|
+
* - Seulement les rejetées (validation) : `GET /demandes-paiements?instructionId={instructionId}&statut=REJETE`
|
|
1522
|
+
* - Seulement les valides (avec noms/pays des payeurs) : `GET /demandes-paiements?instructionId={instructionId}&statut=INITIE`
|
|
1523
|
+
*
|
|
1524
|
+
* **Convention de nommage des instructionId (important) :**
|
|
1525
|
+
*
|
|
1526
|
+
* L'`instructionId` doit être **unique** pour chaque création de bulk. Pour faciliter le suivi métier, nous recommandons la convention suivante :
|
|
1527
|
+
*
|
|
1528
|
+
* ```
|
|
1529
|
+
* <IDENTIFIANT_METIER>-<NUMERO_TENTATIVE>
|
|
1530
|
+
* ```
|
|
1531
|
+
*
|
|
1532
|
+
* **Exemples :**
|
|
1533
|
+
* - Première tentative : `FACTURES-2025-01-1` (factures de janvier 2025, tentative 1)
|
|
1534
|
+
* - Deuxième tentative : `FACTURES-2025-01-2` (corrections après échecs)
|
|
1535
|
+
* - Troisième tentative : `FACTURES-2025-01-3` (nouvelles corrections)
|
|
1536
|
+
*
|
|
1537
|
+
* **Avantages :**
|
|
1538
|
+
* - ✅ Chaque bulk a un statut indépendant (INITIE, CONFIRME, ANNULE)
|
|
1539
|
+
* - ✅ Traçabilité claire des tentatives successives
|
|
1540
|
+
* - ✅ Possibilité de filtrer par identifiant métier : `GET /demandes-paiements?instructionId[beginsWith]=FACTURES-2025-01`
|
|
1541
|
+
* - ✅ Respect de l'unicité de l'instructionId
|
|
1542
|
+
*
|
|
1543
|
+
* @returns string La demande a été acceptée et est en cours de traitement.
|
|
1544
|
+
*
|
|
1545
|
+
* Consultez le statut via `GET /demandes-paiements-groupes/{instructionId}`.
|
|
1546
|
+
*
|
|
1547
|
+
* @throws ApiError
|
|
1548
|
+
*/
|
|
1549
|
+
static demandePaiementGroupeCreer({
|
|
1550
|
+
requestBody
|
|
1551
|
+
}) {
|
|
1552
|
+
return request(OpenAPI2, {
|
|
1553
|
+
method: "POST",
|
|
1554
|
+
url: "/demandes-paiements-groupes",
|
|
1555
|
+
body: requestBody,
|
|
1556
|
+
mediaType: "application/json",
|
|
1557
|
+
responseHeader: "Location",
|
|
1558
|
+
errors: {
|
|
1559
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1560
|
+
401: `Autorisations manquantes`,
|
|
1561
|
+
409: `Conflit - instructionId d\xE9j\xE0 utilis\xE9`,
|
|
1562
|
+
429: `Erreur inattendue`,
|
|
1563
|
+
503: `Erreur inattendue du serveur`
|
|
1564
|
+
}
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Détails d'une demande de paiement en masse
|
|
1569
|
+
* Ce point de terminaison permet de consulter les détails d'une demande de paiement en masse.
|
|
1570
|
+
*
|
|
1571
|
+
* **Statut du bulk :**
|
|
1572
|
+
* - `INITIE` : Créée avec confirmation demandée, en attente de confirmation
|
|
1573
|
+
* - `CONFIRME` : Confirmée par le business (si confirmation demandée) ou en cours de traitement (si sans confirmation)
|
|
1574
|
+
* - `ANNULE` : Annulée par le business avant confirmation (seulement si confirmation demandée)
|
|
1575
|
+
*
|
|
1576
|
+
* **Note :**
|
|
1577
|
+
* - Si créée **avec confirmation** (`confirmation: true`) : Le statut évolue de `INITIE` → `CONFIRME` ou `ANNULE`
|
|
1578
|
+
* - Si créée **sans confirmation** (`confirmation: false`) : Le statut est directement `CONFIRME` (aucune action requise du business)
|
|
1579
|
+
*
|
|
1580
|
+
* **Vérification de fin de validation (important pour confirmation) :**
|
|
1581
|
+
*
|
|
1582
|
+
* Lorsque `confirmation: true`, la validation des transactions se fait de manière asynchrone.
|
|
1583
|
+
* Pour savoir si la validation est terminée et que vous pouvez confirmer, vérifiez que :
|
|
1584
|
+
*
|
|
1585
|
+
* ```
|
|
1586
|
+
* transactionsInitiees + transactionsRejetees = transactionsTotal
|
|
1587
|
+
* ```
|
|
1588
|
+
*
|
|
1589
|
+
* - Si égalité → Validation terminée, vous pouvez confirmer ✅
|
|
1590
|
+
* - Si inégalité → Validation en cours, attendez encore (consultez à nouveau plus tard) ⏳
|
|
1591
|
+
*
|
|
1592
|
+
* Le détail de chaque transaction se consulte via `GET /demandes-paiements?txId={txId}`.
|
|
1593
|
+
*
|
|
1594
|
+
* **Consultation des transactions individuelles :**
|
|
1595
|
+
* Pour obtenir la liste détaillée des transactions (avec noms des payeurs, codes d'erreur, etc.), utilisez :
|
|
1596
|
+
* - Toutes les transactions : `GET /demandes-paiements?instructionId={instructionId}`
|
|
1597
|
+
* - Seulement les rejetées : `GET /demandes-paiements?instructionId={instructionId}&statut=REJETE`
|
|
1598
|
+
* - Seulement les réussies : `GET /demandes-paiements?instructionId={instructionId}&statut=IRREVOCABLE`
|
|
1599
|
+
*
|
|
1600
|
+
* @returns DemandePaiementEnMasseStatutReponse Opération effectuée avec succès
|
|
1601
|
+
* @throws ApiError
|
|
1602
|
+
*/
|
|
1603
|
+
static demandePaiementGroupeConsulter({
|
|
1604
|
+
instructionId
|
|
1605
|
+
}) {
|
|
1606
|
+
return request(OpenAPI2, {
|
|
1607
|
+
method: "GET",
|
|
1608
|
+
url: "/demandes-paiements-groupes/{instructionId}",
|
|
1609
|
+
path: {
|
|
1610
|
+
"instructionId": instructionId
|
|
1611
|
+
},
|
|
1612
|
+
errors: {
|
|
1613
|
+
401: `Autorisations manquantes`,
|
|
1614
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1615
|
+
429: `Erreur inattendue`,
|
|
1616
|
+
503: `Erreur inattendue du serveur`
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Confirmer la demande de paiement en masse
|
|
1622
|
+
* Ce point de terminaison permet de confirmer ou d'annuler une demande de paiement en masse créée avec `confirmation: true`.
|
|
1623
|
+
*
|
|
1624
|
+
* **Processus de vérification :**
|
|
1625
|
+
* 1. Après la création (`POST /demandes-paiements-groupes`), le participant valide toutes les transactions (unicité des txId + recherche d'alias des payeurs)
|
|
1626
|
+
* 2. Les transactions invalides sont automatiquement rejetées (`statut: REJETE`) avec codes `BE23` (alias invalide) ou `DU03` (txId dupliqué)
|
|
1627
|
+
* 3. Les transactions valides passent à l'état `INITIE` avec les noms et pays des payeurs
|
|
1628
|
+
* 4. Le business consulte via `GET /demandes-paiements-groupes/{instructionId}` pour vérifier la progression de la validation
|
|
1629
|
+
* 5. **La validation (unicité des txId + recherche d'alias) est terminée quand** : `transactionsInitiees + transactionsRejetees = transactionsTotal`
|
|
1630
|
+
* 6. Le business peut alors confirmer ou annuler l'envoi des demandes de paiement
|
|
1631
|
+
*
|
|
1632
|
+
* **Important :** La confirmation n'est possible que lorsque la validation de toutes les transactions est terminée.
|
|
1633
|
+
* Si le business tente de confirmer pendant que la validation est en cours, une erreur 403 sera retournée avec la progression actuelle.
|
|
1634
|
+
*
|
|
1635
|
+
* **Comportement de la confirmation :**
|
|
1636
|
+
* - `decision: true` → Le système envoie **automatiquement SEULEMENT** les demandes de paiement pour les transactions avec `statut: INITIE`
|
|
1637
|
+
* - Les transactions `REJETE` (erreurs de validation) sont **automatiquement exclues** (pas besoin de les lister)
|
|
1638
|
+
* - Le statut du bulk passe de `INITIE` à `CONFIRME`
|
|
1639
|
+
*
|
|
1640
|
+
* **Idempotence** : Cet endpoint est idempotent.
|
|
1641
|
+
* - Premier appel avec `decision: true` → Envoie les demandes, retourne `200 OK {statut: "CONFIRME"}`
|
|
1642
|
+
* - Appels suivants avec `decision: true` → Retourne `200 OK {statut: "CONFIRME"}` (idempotent, ne relance pas)
|
|
1643
|
+
* - Premier appel avec `decision: false` → Annule, retourne `200 OK {statut: "ANNULE"}`
|
|
1644
|
+
* - Appels suivants avec `decision: false` → Retourne `200 OK {statut: "ANNULE"}` (idempotent)
|
|
1645
|
+
* - `decision: true` après `decision: false` → Retourne `403 Forbidden` (déjà annulé)
|
|
1646
|
+
* - `decision: false` après `decision: true` → Retourne `403 Forbidden` (déjà confirmé)
|
|
1647
|
+
*
|
|
1648
|
+
* **Timeout adaptatif** : Le délai pour confirmer dépend automatiquement du nombre de transactions :
|
|
1649
|
+
* - **1 à 500 transactions** : 24 heures
|
|
1650
|
+
* - **501 à 1000 transactions** : 48 heures
|
|
1651
|
+
* - **Plus de 1000 transactions** : 72 heures
|
|
1652
|
+
*
|
|
1653
|
+
* Passé ce délai, la demande expire automatiquement et ne peut plus être confirmée. Le délai exact est indiqué dans le champ `dateExpiration` retourné par `GET /demandes-paiements-groupes/{instructionId}`.
|
|
1654
|
+
*
|
|
1655
|
+
* **Changement de décision** : Une fois une décision prise, elle est définitive. Impossible de confirmer après avoir annulé, et vice-versa.
|
|
1656
|
+
*
|
|
1657
|
+
* @returns DemandePaiementEnMasseStatutReponse Confirmation enregistrée avec succès.
|
|
1658
|
+
* - Si `decision: true`, le statut passe à `CONFIRME` et les demandes de paiement sont envoyées
|
|
1659
|
+
* - Si `decision: false`, le statut passe à `ANNULE`
|
|
1660
|
+
*
|
|
1661
|
+
* @throws ApiError
|
|
1662
|
+
*/
|
|
1663
|
+
static demandePaiementGroupeConfirmer({
|
|
1664
|
+
instructionId,
|
|
1665
|
+
requestBody
|
|
1666
|
+
}) {
|
|
1667
|
+
return request(OpenAPI2, {
|
|
1668
|
+
method: "PUT",
|
|
1669
|
+
url: "/demandes-paiements-groupes/{instructionId}/confirmations",
|
|
1670
|
+
path: {
|
|
1671
|
+
"instructionId": instructionId
|
|
1672
|
+
},
|
|
1673
|
+
body: requestBody,
|
|
1674
|
+
mediaType: "application/json",
|
|
1675
|
+
errors: {
|
|
1676
|
+
401: `Autorisations manquantes`,
|
|
1677
|
+
403: `Op\xE9ration interdite`,
|
|
1678
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1679
|
+
429: `Erreur inattendue`,
|
|
1680
|
+
503: `Erreur inattendue du serveur`
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
// src/generated/services/NotificationService.ts
|
|
1689
|
+
var NotificationService;
|
|
1690
|
+
var init_NotificationService = __esm({
|
|
1691
|
+
"src/generated/services/NotificationService.ts"() {
|
|
1692
|
+
"use strict";
|
|
1693
|
+
init_OpenAPI();
|
|
1694
|
+
init_request();
|
|
1695
|
+
NotificationService = class {
|
|
1696
|
+
/**
|
|
1697
|
+
* Créer un lien de rappel.
|
|
1698
|
+
* Cet endpoint permet au client de configurer des webhooks (liens de rappel) pour recevoir des notifications en temps réel.
|
|
1699
|
+
*
|
|
1700
|
+
* Le client dispose d'une grande flexibilité dans la configuration de ses webhooks et peut choisir parmi plusieurs stratégies :
|
|
1701
|
+
*
|
|
1702
|
+
* **1. Callback URL général**
|
|
1703
|
+
* - Un seul point de rappel pour toutes les notifications
|
|
1704
|
+
* - Tous les événements de tous les comptes/alias sont envoyés à la même URL
|
|
1705
|
+
* - Configuration simple, idéale pour centraliser toutes les notifications
|
|
1706
|
+
*
|
|
1707
|
+
* **2. Callback URL par alias**
|
|
1708
|
+
* - Un point de rappel distinct pour chaque alias de compte
|
|
1709
|
+
* - Permet de router les notifications vers des systèmes différents selon le compte concerné
|
|
1710
|
+
* - Utile pour isoler les flux de notifications par compte ou par service
|
|
1711
|
+
*
|
|
1712
|
+
* **3. Callback URL par événement**
|
|
1713
|
+
* - Un point de rappel spécifique pour chaque type d'événement (PAIEMENT_RECU, RTP_RECU, etc.)
|
|
1714
|
+
* - Permet de traiter différemment chaque catégorie d'événement
|
|
1715
|
+
* - Facilite la séparation des traitements métier (paiements vs demandes vs retours)
|
|
1716
|
+
*
|
|
1717
|
+
* **4. Callback URL par événement et alias**
|
|
1718
|
+
* - Granularité maximale : un point de rappel pour chaque combinaison événement/alias
|
|
1719
|
+
* - Configuration la plus fine pour des besoins très spécifiques
|
|
1720
|
+
* - Permet de router précisément chaque notification vers le système approprié
|
|
1721
|
+
*
|
|
1722
|
+
* Cette flexibilité permet aux clients d'adapter la configuration des webhooks à leur architecture technique et à leurs besoins métier.
|
|
1723
|
+
*
|
|
1724
|
+
* @returns WebhookCreationResponse Webhook créé avec succès
|
|
1725
|
+
* @throws ApiError
|
|
1726
|
+
*/
|
|
1727
|
+
static webhookCreer({
|
|
1728
|
+
requestBody
|
|
1729
|
+
}) {
|
|
1730
|
+
return request(OpenAPI2, {
|
|
1731
|
+
method: "POST",
|
|
1732
|
+
url: "/webhooks",
|
|
1733
|
+
body: requestBody,
|
|
1734
|
+
mediaType: "application/json",
|
|
1735
|
+
errors: {
|
|
1736
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1737
|
+
401: `Autorisations manquantes`,
|
|
1738
|
+
429: `Erreur inattendue`,
|
|
1739
|
+
503: `Erreur inattendue du serveur`
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Lister les webhooks
|
|
1745
|
+
* Endpoint pour lister les webhooks
|
|
1746
|
+
*
|
|
1747
|
+
* @returns WebhookList Liste des webhooks configurés
|
|
1748
|
+
* @throws ApiError
|
|
1749
|
+
*/
|
|
1750
|
+
static webhookLister() {
|
|
1751
|
+
return request(OpenAPI2, {
|
|
1752
|
+
method: "GET",
|
|
1753
|
+
url: "/webhooks",
|
|
1754
|
+
errors: {
|
|
1755
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1756
|
+
401: `Autorisations manquantes`,
|
|
1757
|
+
429: `Erreur inattendue`,
|
|
1758
|
+
503: `Erreur inattendue du serveur`
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Modifier un Webhook
|
|
1764
|
+
* Endpoint pour la modification d'un webhook.
|
|
1765
|
+
*
|
|
1766
|
+
* @returns any Le Webhook a été modifié avec succès
|
|
1767
|
+
* @throws ApiError
|
|
1768
|
+
*/
|
|
1769
|
+
static webhookModifier({
|
|
1770
|
+
id,
|
|
1771
|
+
requestBody
|
|
1772
|
+
}) {
|
|
1773
|
+
return request(OpenAPI2, {
|
|
1774
|
+
method: "PUT",
|
|
1775
|
+
url: "/webhooks/{id}",
|
|
1776
|
+
path: {
|
|
1777
|
+
"id": id
|
|
1778
|
+
},
|
|
1779
|
+
body: requestBody,
|
|
1780
|
+
mediaType: "application/json",
|
|
1781
|
+
errors: {
|
|
1782
|
+
401: `Autorisations manquantes`,
|
|
1783
|
+
429: `Erreur inattendue`,
|
|
1784
|
+
503: `Erreur inattendue du serveur`
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Supprimer un Webhook
|
|
1790
|
+
* Endpoint pour la suppression d'un webhook.
|
|
1791
|
+
*
|
|
1792
|
+
* @returns void
|
|
1793
|
+
* @throws ApiError
|
|
1794
|
+
*/
|
|
1795
|
+
static webhookSupprimer({
|
|
1796
|
+
id
|
|
1797
|
+
}) {
|
|
1798
|
+
return request(OpenAPI2, {
|
|
1799
|
+
method: "DELETE",
|
|
1800
|
+
url: "/webhooks/{id}",
|
|
1801
|
+
path: {
|
|
1802
|
+
"id": id
|
|
1803
|
+
},
|
|
1804
|
+
errors: {
|
|
1805
|
+
401: `Autorisations manquantes`,
|
|
1806
|
+
429: `Erreur inattendue`,
|
|
1807
|
+
503: `Erreur inattendue du serveur`
|
|
1808
|
+
}
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* Recuperer un webhook
|
|
1813
|
+
* Endpoint pour la consultation des informations d'un Webhook
|
|
1814
|
+
* @returns WebhookData Details du webhook
|
|
1815
|
+
* @throws ApiError
|
|
1816
|
+
*/
|
|
1817
|
+
static webhookConsulter({
|
|
1818
|
+
id
|
|
1819
|
+
}) {
|
|
1820
|
+
return request(OpenAPI2, {
|
|
1821
|
+
method: "GET",
|
|
1822
|
+
url: "/webhooks/{id}",
|
|
1823
|
+
path: {
|
|
1824
|
+
"id": id
|
|
1825
|
+
},
|
|
1826
|
+
errors: {
|
|
1827
|
+
401: `Autorisations manquantes`,
|
|
1828
|
+
429: `Erreur inattendue`,
|
|
1829
|
+
503: `Erreur inattendue du serveur`
|
|
1830
|
+
}
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
|
|
1837
|
+
// src/generated/services/PaiementEnMasseService.ts
|
|
1838
|
+
var PaiementEnMasseService;
|
|
1839
|
+
var init_PaiementEnMasseService = __esm({
|
|
1840
|
+
"src/generated/services/PaiementEnMasseService.ts"() {
|
|
1841
|
+
"use strict";
|
|
1842
|
+
init_OpenAPI();
|
|
1843
|
+
init_request();
|
|
1844
|
+
PaiementEnMasseService = class {
|
|
1845
|
+
/**
|
|
1846
|
+
* Envoyer un paiement en masse
|
|
1847
|
+
* Ce point de terminaison permet au client d'envoyer des paiements en masse.
|
|
1848
|
+
*
|
|
1849
|
+
* **Traitement asynchrone :** La création d'un paiement en masse retourne immédiatement `202 Accepted`. Le traitement des transactions se fait de manière asynchrone.
|
|
1850
|
+
*
|
|
1851
|
+
* **Sans confirmation (`confirmation: false` ou non spécifié) :**
|
|
1852
|
+
* - Les transactions sont créées et validées (unicité des txId)
|
|
1853
|
+
* - Les paiements sont exécutés directement
|
|
1854
|
+
* - Les transactions invalides (txId dupliqué) sont automatiquement rejetées avec le code `DU03`
|
|
1855
|
+
* - Le business peut suivre la progression via `GET /paiements-groupes/{instructionId}` et `GET /paiements?instructionId={instructionId}`
|
|
1856
|
+
*
|
|
1857
|
+
* **Avec confirmation (`confirmation: true`) :**
|
|
1858
|
+
* - Les transactions sont créées et validées (unicité des txId + recherche d'alias)
|
|
1859
|
+
* - Les transactions avec alias invalide sont automatiquement rejetées avec le code `BE23`
|
|
1860
|
+
* - Les transactions avec txId dupliqué sont rejetées avec le code `DU03`
|
|
1861
|
+
* - Les transactions valides passent à l'état `INITIE` et peuvent être consultées via `GET /paiements?instructionId={instructionId}&statut=INITIE`
|
|
1862
|
+
* - Le business dispose d'un **délai adaptatif** pour confirmer ou annuler via `PUT /paiements-groupes/{instructionId}/confirmations` :
|
|
1863
|
+
* - **1 à 500 transactions** : 24 heures
|
|
1864
|
+
* - **501 à 1000 transactions** : 48 heures
|
|
1865
|
+
* - **Plus de 1000 transactions** : 72 heures
|
|
1866
|
+
* - Lors de la confirmation, seules les transactions `INITIE` sont envoyées (les transactions `REJETE` sont automatiquement exclues)
|
|
1867
|
+
* - Passé le délai, la demande expire automatiquement
|
|
1868
|
+
*
|
|
1869
|
+
* **Consultation des détails :**
|
|
1870
|
+
* - Statut global du bulk : `GET /paiements-groupes/{instructionId}`
|
|
1871
|
+
* - Liste de toutes les transactions : `GET /paiements?instructionId={instructionId}`
|
|
1872
|
+
* - Seulement les rejetées (validation) : `GET /paiements?instructionId={instructionId}&statut=REJETE`
|
|
1873
|
+
* - Seulement les valides (avec noms/pays) : `GET /paiements?instructionId={instructionId}&statut=INITIE`
|
|
1874
|
+
*
|
|
1875
|
+
* **Convention de nommage des instructionId (important) :**
|
|
1876
|
+
*
|
|
1877
|
+
* L'`instructionId` doit être **unique** pour chaque création de bulk. Pour faciliter le suivi métier, nous recommandons la convention suivante :
|
|
1878
|
+
*
|
|
1879
|
+
* ```
|
|
1880
|
+
* <IDENTIFIANT_METIER>-<NUMERO_TENTATIVE>
|
|
1881
|
+
* ```
|
|
1882
|
+
*
|
|
1883
|
+
* **Exemples :**
|
|
1884
|
+
* - Première tentative : `SALAIRES-2025-01-1` (salaires de janvier 2025, tentative 1)
|
|
1885
|
+
* - Deuxième tentative : `SALAIRES-2025-01-2` (corrections après échecs)
|
|
1886
|
+
* - Troisième tentative : `SALAIRES-2025-01-3` (nouvelles corrections)
|
|
1887
|
+
*
|
|
1888
|
+
* **Avantages :**
|
|
1889
|
+
* - ✅ Chaque bulk a un statut indépendant (INITIE, CONFIRME, ANNULE)
|
|
1890
|
+
* - ✅ Traçabilité claire des tentatives successives
|
|
1891
|
+
* - ✅ Possibilité de filtrer par identifiant métier : `GET /paiements?instructionId[beginsWith]=SALAIRES-2025-01`
|
|
1892
|
+
* - ✅ Respect de l'unicité de l'instructionId
|
|
1893
|
+
*
|
|
1894
|
+
* @returns string La demande a été acceptée et est en cours de traitement.
|
|
1895
|
+
*
|
|
1896
|
+
* Consultez le statut via `GET /paiements-groupes/{instructionId}`.
|
|
1897
|
+
*
|
|
1898
|
+
* @throws ApiError
|
|
1899
|
+
*/
|
|
1900
|
+
static paiementGroupeCreer({
|
|
1901
|
+
requestBody
|
|
1902
|
+
}) {
|
|
1903
|
+
return request(OpenAPI2, {
|
|
1904
|
+
method: "POST",
|
|
1905
|
+
url: "/paiements-groupes",
|
|
1906
|
+
body: requestBody,
|
|
1907
|
+
mediaType: "application/json",
|
|
1908
|
+
responseHeader: "Location",
|
|
1909
|
+
errors: {
|
|
1910
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
1911
|
+
401: `Autorisations manquantes`,
|
|
1912
|
+
409: `Conflit - instructionId d\xE9j\xE0 utilis\xE9`,
|
|
1913
|
+
429: `Erreur inattendue`,
|
|
1914
|
+
503: `Erreur inattendue du serveur`
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Détails d'un paiement en masse
|
|
1920
|
+
* Ce point de terminaison permet de consulter les détails d'un paiement en masse.
|
|
1921
|
+
*
|
|
1922
|
+
* **Statut du bulk :**
|
|
1923
|
+
* - `INITIE` : Créé avec confirmation demandée, en attente de confirmation
|
|
1924
|
+
* - `CONFIRME` : Confirmé par le business (si confirmation demandée) ou en cours de traitement (si sans confirmation)
|
|
1925
|
+
* - `ANNULE` : Annulé par le business avant confirmation (seulement si confirmation demandée)
|
|
1926
|
+
*
|
|
1927
|
+
* **Note :**
|
|
1928
|
+
* - Si créé **avec confirmation** (`confirmation: true`) : Le statut évolue de `INITIE` → `CONFIRME` ou `ANNULE`
|
|
1929
|
+
* - Si créé **sans confirmation** (`confirmation: false`) : Le statut est directement `CONFIRME` (aucune action requise du business)
|
|
1930
|
+
*
|
|
1931
|
+
* **Vérification de fin de validation (important pour confirmation) :**
|
|
1932
|
+
*
|
|
1933
|
+
* Lorsque `confirmation: true`, la validation des transactions se fait de manière asynchrone.
|
|
1934
|
+
* Pour savoir si la validation est terminée et si vous pouvez confirmer, vérifiez que :
|
|
1935
|
+
*
|
|
1936
|
+
* ```
|
|
1937
|
+
* transactionsInitiees + transactionsRejetees = transactionsTotal
|
|
1938
|
+
* ```
|
|
1939
|
+
*
|
|
1940
|
+
* - Si égalité → Validation terminée, vous pouvez confirmer ✅
|
|
1941
|
+
* - Si inégalité → Validation en cours, attendez encore (consultez à nouveau dans quelques secondes) ⏳
|
|
1942
|
+
*
|
|
1943
|
+
* La progression détaillée de chaque transaction se consulte via `GET /paiements?txId={txId}`.
|
|
1944
|
+
*
|
|
1945
|
+
* **Consultation des transactions individuelles :**
|
|
1946
|
+
* Pour obtenir la liste détaillée des transactions (avec noms des bénéficiaires, codes d'erreur, etc.), utilisez :
|
|
1947
|
+
* - Toutes les transactions : `GET /paiements?instructionId={instructionId}`
|
|
1948
|
+
* - Seulement les rejetées : `GET /paiements?instructionId={instructionId}&statut=REJETE`
|
|
1949
|
+
* - Seulement les réussies : `GET /paiements?instructionId={instructionId}&statut=IRREVOCABLE`
|
|
1950
|
+
*
|
|
1951
|
+
* @returns PaiementEnMasseReponseStatut Opération effectuée avec succès
|
|
1952
|
+
* @throws ApiError
|
|
1953
|
+
*/
|
|
1954
|
+
static paiementGroupeConsulter({
|
|
1955
|
+
instructionId
|
|
1956
|
+
}) {
|
|
1957
|
+
return request(OpenAPI2, {
|
|
1958
|
+
method: "GET",
|
|
1959
|
+
url: "/paiements-groupes/{instructionId}",
|
|
1960
|
+
path: {
|
|
1961
|
+
"instructionId": instructionId
|
|
1962
|
+
},
|
|
1963
|
+
errors: {
|
|
1964
|
+
401: `Autorisations manquantes`,
|
|
1965
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
1966
|
+
429: `Erreur inattendue`,
|
|
1967
|
+
503: `Erreur inattendue du serveur`
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* Confirmer le paiement en masse
|
|
1973
|
+
* Ce point de terminaison permet de confirmer ou d'annuler un paiement en masse créé avec `confirmation: true`.
|
|
1974
|
+
*
|
|
1975
|
+
* **Processus de vérification :**
|
|
1976
|
+
* 1. Après la création (`POST /paiements-groupes`), le participant valide asynchronement toutes les transactions (unicité des txId + recherche d'alias)
|
|
1977
|
+
* 2. Les transactions invalides sont automatiquement rejetées (`statut: REJETE`) avec codes `BE23` (alias invalide) ou `DU03` (txId dupliqué)
|
|
1978
|
+
* 3. Les transactions valides passent à l'état `INITIE` avec les noms et pays des bénéficiaires
|
|
1979
|
+
* 4. Le business consulte via `GET /paiements-groupes/{instructionId}` pour vérifier la progression de la validation
|
|
1980
|
+
* 5. **La validation est terminée quand** : `transactionsInitiees + transactionsRejetees = transactionsTotal`
|
|
1981
|
+
* 6. Le business peut alors confirmer ou annuler
|
|
1982
|
+
*
|
|
1983
|
+
* **Important :** La confirmation n'est possible que lorsque la validation de toutes les transactions est terminée.
|
|
1984
|
+
* Si le business tente de confirmer pendant que la validation est en cours, une erreur 403 sera retournée avec la progression actuelle.
|
|
1985
|
+
*
|
|
1986
|
+
* **Comportement de la confirmation :**
|
|
1987
|
+
* - `decision: true` → Le système envoie **automatiquement SEULEMENT** les transactions avec `statut: INITIE`
|
|
1988
|
+
* - Les transactions `REJETE` (erreurs de validation) sont **automatiquement exclues** (pas besoin de les lister)
|
|
1989
|
+
* - Le statut du bulk passe de `INITIE` à `CONFIRME`
|
|
1990
|
+
*
|
|
1991
|
+
* **Idempotence** : Cet endpoint est idempotent.
|
|
1992
|
+
* - Premier appel avec `decision: true` → Lance les paiements, retourne `200 OK {statut: "CONFIRME"}`
|
|
1993
|
+
* - Appels suivants avec `decision: true` → Retourne `200 OK {statut: "CONFIRME"}` (idempotent, ne relance pas)
|
|
1994
|
+
* - Premier appel avec `decision: false` → Annule, retourne `200 OK {statut: "ANNULE"}`
|
|
1995
|
+
* - Appels suivants avec `decision: false` → Retourne `200 OK {statut: "ANNULE"}` (idempotent)
|
|
1996
|
+
* - `decision: true` après `decision: false` → Retourne `403 Forbidden` (déjà annulé)
|
|
1997
|
+
* - `decision: false` après `decision: true` → Retourne `403 Forbidden` (déjà confirmé)
|
|
1998
|
+
*
|
|
1999
|
+
* **Timeout adaptatif** : Le délai pour confirmer dépend automatiquement du nombre de transactions :
|
|
2000
|
+
* - **1 à 500 transactions** : 24 heures
|
|
2001
|
+
* - **501 à 1000 transactions** : 48 heures
|
|
2002
|
+
* - **Plus de 1000 transactions** : 72 heures
|
|
2003
|
+
*
|
|
2004
|
+
* Passé ce délai, la demande expire automatiquement et ne peut plus être confirmée. Le délai exact est indiqué dans le champ `dateExpiration` retourné par `GET /paiements-groupes/{instructionId}`.
|
|
2005
|
+
*
|
|
2006
|
+
* **Changement de décision** : Une fois une décision prise, elle est définitive. Impossible de confirmer après avoir annulé, et vice-versa.
|
|
2007
|
+
*
|
|
2008
|
+
* @returns PaiementEnMasseReponseStatut Confirmation enregistrée avec succès.
|
|
2009
|
+
* - Si `decision: true`, le statut passe à `CONFIRME` et les paiements sont lancés
|
|
2010
|
+
* - Si `decision: false`, le statut passe à `ANNULE`
|
|
2011
|
+
*
|
|
2012
|
+
* @throws ApiError
|
|
2013
|
+
*/
|
|
2014
|
+
static paiementGroupeConfirmer({
|
|
2015
|
+
instructionId,
|
|
2016
|
+
requestBody
|
|
2017
|
+
}) {
|
|
2018
|
+
return request(OpenAPI2, {
|
|
2019
|
+
method: "PUT",
|
|
2020
|
+
url: "/paiements-groupes/{instructionId}/confirmations",
|
|
2021
|
+
path: {
|
|
2022
|
+
"instructionId": instructionId
|
|
2023
|
+
},
|
|
2024
|
+
body: requestBody,
|
|
2025
|
+
mediaType: "application/json",
|
|
2026
|
+
errors: {
|
|
2027
|
+
401: `Autorisations manquantes`,
|
|
2028
|
+
403: `Op\xE9ration interdite`,
|
|
2029
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
2030
|
+
429: `Erreur inattendue`,
|
|
2031
|
+
503: `Erreur inattendue du serveur`
|
|
2032
|
+
}
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
2037
|
+
});
|
|
2038
|
+
|
|
2039
|
+
// src/generated/services/PaiementImmediatService.ts
|
|
2040
|
+
var PaiementImmediatService;
|
|
2041
|
+
var init_PaiementImmediatService = __esm({
|
|
2042
|
+
"src/generated/services/PaiementImmediatService.ts"() {
|
|
2043
|
+
"use strict";
|
|
2044
|
+
init_OpenAPI();
|
|
2045
|
+
init_request();
|
|
2046
|
+
PaiementImmediatService = class {
|
|
2047
|
+
/**
|
|
2048
|
+
* Envoyer un paiement
|
|
2049
|
+
* Ce point de terminaison permet au business d'effectuer des paiements.
|
|
2050
|
+
*
|
|
2051
|
+
* Le destinataire du paiement est identifié par son alias de compte.
|
|
2052
|
+
*
|
|
2053
|
+
* Le business peut définir le champ `confirmation` à `true` pour demander une validation en deux étapes : le PSP retournera d'abord le résultat de la recherche d'alias (avec le nom et le pays du bénéficiaire), puis attendra une confirmation explicite avant d'exécuter le paiement via l'endpoint `PUT /paiements/{txId}/confirmations`.
|
|
2054
|
+
*
|
|
2055
|
+
* **Timeout de confirmation** : Si le business demande une confirmation, il dispose de **24 heures** pour confirmer. Passé ce délai, la demande expire automatiquement.
|
|
2056
|
+
*
|
|
2057
|
+
* @returns PaiementImmediatReponse Paiement traité. Le champ `statut` indique le résultat :
|
|
2058
|
+
* - `INITIE` : En attente de confirmation (si `confirmation: true`)
|
|
2059
|
+
* - `ENVOYE` : Paiement envoyé avec succès (si `confirmation: false`)
|
|
2060
|
+
* - `REJETE` : Paiement rejeté. Le champ `statutRaison` contient le code d'erreur :
|
|
2061
|
+
* - `DU03` : txId dupliqué (déjà utilisé)
|
|
2062
|
+
* - `BE23` : Alias bénéficiaire invalide
|
|
2063
|
+
* - Autres codes ISO 20022
|
|
2064
|
+
*
|
|
2065
|
+
* @throws ApiError
|
|
2066
|
+
*/
|
|
2067
|
+
static paiementCreer({
|
|
2068
|
+
requestBody
|
|
2069
|
+
}) {
|
|
2070
|
+
return request(OpenAPI2, {
|
|
2071
|
+
method: "POST",
|
|
2072
|
+
url: "/paiements",
|
|
2073
|
+
body: requestBody,
|
|
2074
|
+
mediaType: "application/json",
|
|
2075
|
+
errors: {
|
|
2076
|
+
400: `La requ\xEAte est malform\xE9e`,
|
|
2077
|
+
401: `Autorisations manquantes`,
|
|
2078
|
+
403: `Interdiction d'effectuer le paiement (erreurs m\xE9tier non-retriables)`,
|
|
2079
|
+
429: `Erreur inattendue`,
|
|
2080
|
+
503: `Erreur inattendue du serveur`
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
/**
|
|
2085
|
+
* Lister les paiements
|
|
2086
|
+
* Ce point de terminaison permet de lister les paiements effectués par le client.
|
|
2087
|
+
* @returns PaiementListe Succès de l'opération
|
|
2088
|
+
* @throws ApiError
|
|
2089
|
+
*/
|
|
2090
|
+
static paiementLister({
|
|
2091
|
+
payeAlias,
|
|
2092
|
+
payeCompte,
|
|
2093
|
+
payeurAlias,
|
|
2094
|
+
payeurCompte,
|
|
2095
|
+
dateEnvoi,
|
|
2096
|
+
dateIrrevocabilite,
|
|
2097
|
+
statut,
|
|
2098
|
+
categorie,
|
|
2099
|
+
montantAchat,
|
|
2100
|
+
montantRetrait,
|
|
2101
|
+
motif,
|
|
2102
|
+
refDocType,
|
|
2103
|
+
instructionId,
|
|
2104
|
+
txId,
|
|
2105
|
+
annulationStatut,
|
|
2106
|
+
annulationMotif,
|
|
2107
|
+
retourStatut,
|
|
2108
|
+
page,
|
|
2109
|
+
size,
|
|
2110
|
+
sort,
|
|
2111
|
+
fields
|
|
2112
|
+
}) {
|
|
2113
|
+
return request(OpenAPI2, {
|
|
2114
|
+
method: "GET",
|
|
2115
|
+
url: "/paiements",
|
|
2116
|
+
query: {
|
|
2117
|
+
"payeAlias": payeAlias,
|
|
2118
|
+
"payeCompte": payeCompte,
|
|
2119
|
+
"payeurAlias": payeurAlias,
|
|
2120
|
+
"payeurCompte": payeurCompte,
|
|
2121
|
+
"dateEnvoi": dateEnvoi,
|
|
2122
|
+
"dateIrrevocabilite": dateIrrevocabilite,
|
|
2123
|
+
"statut": statut,
|
|
2124
|
+
"categorie": categorie,
|
|
2125
|
+
"montantAchat": montantAchat,
|
|
2126
|
+
"montantRetrait": montantRetrait,
|
|
2127
|
+
"motif": motif,
|
|
2128
|
+
"refDocType": refDocType,
|
|
2129
|
+
"instructionId": instructionId,
|
|
2130
|
+
"txId": txId,
|
|
2131
|
+
"annulationStatut": annulationStatut,
|
|
2132
|
+
"annulationMotif": annulationMotif,
|
|
2133
|
+
"retourStatut": retourStatut,
|
|
2134
|
+
"page": page,
|
|
2135
|
+
"size": size,
|
|
2136
|
+
"sort": sort,
|
|
2137
|
+
"fields": fields
|
|
2138
|
+
},
|
|
2139
|
+
errors: {
|
|
2140
|
+
401: `Autorisations manquantes`,
|
|
2141
|
+
429: `Erreur inattendue`,
|
|
2142
|
+
503: `Erreur inattendue du serveur`
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Détails d'un paiement
|
|
2148
|
+
* Cet point de terminaison permet de consulter les details d'un paiement.
|
|
2149
|
+
*
|
|
2150
|
+
* @returns Paiement Opération effectuée avec succès
|
|
2151
|
+
* @throws ApiError
|
|
2152
|
+
*/
|
|
2153
|
+
static paiementRecuperer({
|
|
2154
|
+
txId
|
|
2155
|
+
}) {
|
|
2156
|
+
return request(OpenAPI2, {
|
|
2157
|
+
method: "GET",
|
|
2158
|
+
url: "/paiements/{txId}",
|
|
2159
|
+
path: {
|
|
2160
|
+
"txId": txId
|
|
2161
|
+
},
|
|
2162
|
+
errors: {
|
|
2163
|
+
401: `Autorisations manquantes`,
|
|
2164
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
2165
|
+
429: `Erreur inattendue`,
|
|
2166
|
+
503: `Erreur inattendue du serveur`
|
|
2167
|
+
}
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
2171
|
+
* Confirmer le paiement
|
|
2172
|
+
* Ce point de terminaison permet d'envoyer la confirmation de l'envoi d'un paiement immédiat
|
|
2173
|
+
* après vérification du nom et du pays du bénéficiaire.
|
|
2174
|
+
*
|
|
2175
|
+
* **Idempotence** : Cet endpoint est idempotent.
|
|
2176
|
+
* - Premier appel avec `decision: true` → Lance le paiement, retourne `200 OK {statut: "ENVOYE"}`
|
|
2177
|
+
* - Appels suivants avec `decision: true` → Retourne `200 OK` avec l'état actuel (ENVOYE, IRREVOCABLE, ou REJETE) - idempotent
|
|
2178
|
+
* - Premier appel avec `decision: false` → Annule, retourne `200 OK {statut: "ANNULE"}`
|
|
2179
|
+
* - Appels suivants avec `decision: false` → Retourne `200 OK {statut: "ANNULE"}` (idempotent)
|
|
2180
|
+
* - `decision: true` après `decision: false` → Retourne `403 Forbidden` (déjà annulé)
|
|
2181
|
+
* - `decision: false` après `decision: true` → Retourne `403 Forbidden` (déjà confirmé)
|
|
2182
|
+
*
|
|
2183
|
+
* **Timeout** : La confirmation doit être envoyée dans les **24 heures** suivant la création de la demande. Passé ce délai, la demande expire automatiquement et ne peut plus être confirmée.
|
|
2184
|
+
*
|
|
2185
|
+
* **Changement de décision** : Une fois une décision prise, elle est définitive. Impossible de confirmer après avoir annulé, et vice-versa.
|
|
2186
|
+
*
|
|
2187
|
+
* @returns PaiementImmediatConfirmationReponse Paiement en cours d'envoi
|
|
2188
|
+
* @throws ApiError
|
|
2189
|
+
*/
|
|
2190
|
+
static paiementConfirmer({
|
|
2191
|
+
txId,
|
|
2192
|
+
requestBody
|
|
2193
|
+
}) {
|
|
2194
|
+
return request(OpenAPI2, {
|
|
2195
|
+
method: "PUT",
|
|
2196
|
+
url: "/paiements/{txId}/confirmations",
|
|
2197
|
+
path: {
|
|
2198
|
+
"txId": txId
|
|
2199
|
+
},
|
|
2200
|
+
body: requestBody,
|
|
2201
|
+
mediaType: "application/json",
|
|
2202
|
+
errors: {
|
|
2203
|
+
401: `Autorisations manquantes`,
|
|
2204
|
+
403: `Op\xE9ration interdite`,
|
|
2205
|
+
404: `La ressource n'existe pas dans le syst\xE8me`,
|
|
2206
|
+
429: `Erreur inattendue`,
|
|
2207
|
+
503: `Erreur inattendue du serveur`
|
|
2208
|
+
}
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* Vérifier un paiement
|
|
2213
|
+
* Ce point de terminaison permet de vérifier la réception d’un paiement à partir de l’`end2endId`.
|
|
2214
|
+
*
|
|
2215
|
+
* Dans certains cas, le **client business** peut ne pas avoir reçu la notification de paiement.
|
|
2216
|
+
* Le **client payeur** peut alors lui communiquer l’`end2endId` afin qu’il puisse vérifier manuellement le statut du paiement.
|
|
2217
|
+
*
|
|
2218
|
+
* Le **participant** doit, dans ce cas, vérifier dans sa base de données et s'il ne trouve pas le paiement, il doit interroger l’endpoint de PI-SPI permettant de **récupérer le statut d’un paiement**, puis **retourner ce statut** dans sa réponse.
|
|
2219
|
+
*
|
|
2220
|
+
* Le statut retourné doit être soit :
|
|
2221
|
+
* - `IRREVOCABLE` (paiement irrévocable), ou
|
|
2222
|
+
* - `REJETE` (paiement rejeté).
|
|
2223
|
+
*
|
|
2224
|
+
* Un transfert **ne peut pas** être signalé comme « en cours de traitement » dans ce contexte.
|
|
2225
|
+
*
|
|
2226
|
+
* ⚠️ **Remarques :**
|
|
2227
|
+
* - La vérification ne doit concerner que les paiements réalisés depuis **moins de 3 mois (90 jours)** afin de garantir la disponibilité de la réponse.
|
|
2228
|
+
* - La garantie de réponse n’est assurée qu’à partir de **20 secondes après l’envoi du transfert**.
|
|
2229
|
+
*
|
|
2230
|
+
* @returns Paiement Opération effectuée avec succès
|
|
2231
|
+
* @throws ApiError
|
|
2232
|
+
*/
|
|
2233
|
+
static paiementVerifier({
|
|
2234
|
+
end2EndId
|
|
2235
|
+
}) {
|
|
2236
|
+
return request(OpenAPI2, {
|
|
2237
|
+
method: "GET",
|
|
2238
|
+
url: "/paiements/{end2endId}/statuts",
|
|
2239
|
+
path: {
|
|
2240
|
+
"end2endId": end2EndId
|
|
2241
|
+
},
|
|
2242
|
+
errors: {
|
|
2243
|
+
401: `Autorisations manquantes`,
|
|
2244
|
+
404: `Ce paiement n'a pas \xE9t\xE9 trouv\xE9`,
|
|
2245
|
+
429: `Erreur inattendue`,
|
|
2246
|
+
503: `Erreur inattendue du serveur`
|
|
2247
|
+
}
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
// src/generated/services/RetoursdeFondsService.ts
|
|
2255
|
+
var RetoursdeFondsService;
|
|
2256
|
+
var init_RetoursdeFondsService = __esm({
|
|
2257
|
+
"src/generated/services/RetoursdeFondsService.ts"() {
|
|
2258
|
+
"use strict";
|
|
2259
|
+
init_OpenAPI();
|
|
2260
|
+
init_request();
|
|
2261
|
+
RetoursdeFondsService = class {
|
|
2262
|
+
/**
|
|
2263
|
+
* Retourner les fonds
|
|
2264
|
+
* Ce point de terminaison permet au business de retourner les fonds d'un paiement reçu.
|
|
2265
|
+
*
|
|
2266
|
+
* **Idempotence** : Cet endpoint est idempotent. Plusieurs appels avec le même `end2endId` produiront le même résultat.
|
|
2267
|
+
* Si le retour de fonds a déjà été envoyé et irrévocable, le champ `retourStatut` de la réponse sera `IRREVOCABLE`.
|
|
2268
|
+
* Si le retour de fonds a été envoyé et rejeté, le retour de fonds sera envoyé à nouveau.
|
|
2269
|
+
* Si le retour de fonds est en cours d'envoi, le champ `retourStatut` de la réponse sera `INITIE`.
|
|
2270
|
+
*
|
|
2271
|
+
* **Notifications webhook** : Après envoi du retour de fonds, si le business a souscrit au service de webhook, il recevra :
|
|
2272
|
+
* - Une notification `RETOUR_ENVOYE` en cas de succès du retour de fonds
|
|
2273
|
+
* - Une notification `RETOUR_REJETE` en cas de rejet de la demande
|
|
2274
|
+
*
|
|
2275
|
+
* **Vérification du statut** : Pour obtenir le statut d'un retour de fonds envoyé, vous pouvez invoquer l'endpoint `GET /paiements/{end2endId}` et le champ `retourStatut` de la réponse indiquera l'état du retour de fonds.
|
|
2276
|
+
*
|
|
2277
|
+
* @returns Paiement Retour de fonds enregistré avec succès
|
|
2278
|
+
* @throws ApiError
|
|
2279
|
+
*/
|
|
2280
|
+
static retourFondsEnvoyer({
|
|
2281
|
+
end2EndId
|
|
2282
|
+
}) {
|
|
2283
|
+
return request(OpenAPI2, {
|
|
2284
|
+
method: "PUT",
|
|
2285
|
+
url: "/paiements/{end2endId}/retours",
|
|
2286
|
+
path: {
|
|
2287
|
+
"end2endId": end2EndId
|
|
2288
|
+
},
|
|
2289
|
+
errors: {
|
|
2290
|
+
401: `Autorisations manquantes`,
|
|
2291
|
+
403: `Interdiction d'effectuer le retour de fonds`,
|
|
2292
|
+
429: `Erreur inattendue`,
|
|
2293
|
+
503: `Erreur inattendue du serveur`
|
|
2294
|
+
}
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
});
|
|
2300
|
+
|
|
2301
|
+
// src/generated/index.ts
|
|
2302
|
+
var init_generated = __esm({
|
|
2303
|
+
"src/generated/index.ts"() {
|
|
2304
|
+
"use strict";
|
|
2305
|
+
init_ApiError();
|
|
2306
|
+
init_CancelablePromise();
|
|
2307
|
+
init_OpenAPI();
|
|
2308
|
+
init_AnnulationStatut();
|
|
2309
|
+
init_CompteOperation();
|
|
2310
|
+
init_CompteSolde();
|
|
2311
|
+
init_CompteTransfertIntraReponse();
|
|
2312
|
+
init_DemandePaiementConfirmationAnnulationRaison();
|
|
2313
|
+
init_DemandePaiementConfirmationReponse();
|
|
2314
|
+
init_DemandePaiementConsultationReponse();
|
|
2315
|
+
init_DemandePaiementEnMasseStatutReponse();
|
|
2316
|
+
init_DemandePaiementListeItem();
|
|
2317
|
+
init_DemandePaiementReponseRequest();
|
|
2318
|
+
init_DemandePaiementRequest();
|
|
2319
|
+
init_DemandePaiementRequestCategorie();
|
|
2320
|
+
init_DemandePaiementStatut();
|
|
2321
|
+
init_DemandePaiementStatutRaison();
|
|
2322
|
+
init_Paiement();
|
|
2323
|
+
init_PaiementAnnulationMotif();
|
|
2324
|
+
init_PaiementAnnulationStatutRaison();
|
|
2325
|
+
init_PaiementEnMasseReponseStatut();
|
|
2326
|
+
init_PaiementImmediatConfirmationReponse();
|
|
2327
|
+
init_PaiementImmediatReponse();
|
|
2328
|
+
init_PaiementStatut();
|
|
2329
|
+
init_PaiementStatutRaison();
|
|
2330
|
+
init_RefDocType();
|
|
2331
|
+
init_RetourStatut();
|
|
2332
|
+
init_RetourStatutRaison();
|
|
2333
|
+
init_WebhookEvent();
|
|
2334
|
+
init_WebhooksEvents();
|
|
2335
|
+
init_AliasService();
|
|
2336
|
+
init_ComptesService();
|
|
2337
|
+
init_DemandeAnnulationService();
|
|
2338
|
+
init_DemandesDePaiementService();
|
|
2339
|
+
init_DemandesDePaiementEnMasseService();
|
|
2340
|
+
init_NotificationService();
|
|
2341
|
+
init_PaiementEnMasseService();
|
|
2342
|
+
init_PaiementImmediatService();
|
|
2343
|
+
init_RetoursdeFondsService();
|
|
2344
|
+
}
|
|
2345
|
+
});
|
|
2346
|
+
|
|
2347
|
+
// src/index.ts
|
|
2348
|
+
var index_exports = {};
|
|
2349
|
+
__export(index_exports, {
|
|
2350
|
+
ACCOUNT_STATUS: () => ACCOUNT_STATUS,
|
|
2351
|
+
ACCOUNT_TYPE: () => ACCOUNT_TYPE,
|
|
2352
|
+
ALIAS_TYPES: () => ALIAS_TYPES2,
|
|
2353
|
+
AliasService: () => AliasService2,
|
|
2354
|
+
AliasType: () => AliasType,
|
|
2355
|
+
AnnulationStatut: () => AnnulationStatut,
|
|
2356
|
+
ApiError: () => ApiError,
|
|
2357
|
+
CLIENT_TYPE: () => CLIENT_TYPE,
|
|
2358
|
+
CURRENCY: () => CURRENCY,
|
|
2359
|
+
CancelError: () => CancelError,
|
|
2360
|
+
CancelablePromise: () => CancelablePromise,
|
|
2361
|
+
CompteOperation: () => CompteOperation,
|
|
2362
|
+
CompteSolde: () => CompteSolde,
|
|
2363
|
+
CompteTransfertIntraReponse: () => CompteTransfertIntraReponse,
|
|
2364
|
+
ComptesService: () => ComptesService2,
|
|
2365
|
+
DEFAULT_LIMITS: () => DEFAULT_LIMITS,
|
|
2366
|
+
DEFAULT_PISPI_LOGO_DATA_URL: () => DEFAULT_PISPI_LOGO_DATA_URL,
|
|
2367
|
+
DemandeAnnulationService: () => DemandeAnnulationService,
|
|
2368
|
+
DemandePaiementConfirmationAnnulationRaison: () => DemandePaiementConfirmationAnnulationRaison,
|
|
2369
|
+
DemandePaiementConfirmationReponse: () => DemandePaiementConfirmationReponse,
|
|
2370
|
+
DemandePaiementConsultationReponse: () => DemandePaiementConsultationReponse,
|
|
2371
|
+
DemandePaiementEnMasseStatutReponse: () => DemandePaiementEnMasseStatutReponse,
|
|
2372
|
+
DemandePaiementListeItem: () => DemandePaiementListeItem,
|
|
2373
|
+
DemandePaiementReponseRequest: () => DemandePaiementReponseRequest,
|
|
2374
|
+
DemandePaiementRequest: () => DemandePaiementRequest,
|
|
2375
|
+
DemandePaiementRequestCategorie: () => DemandePaiementRequestCategorie,
|
|
2376
|
+
DemandePaiementStatut: () => DemandePaiementStatut,
|
|
2377
|
+
DemandePaiementStatutRaison: () => DemandePaiementStatutRaison,
|
|
2378
|
+
DemandesDePaiementEnMasseService: () => DemandesDePaiementEnMasseService,
|
|
2379
|
+
DemandesDePaiementService: () => DemandesDePaiementService,
|
|
2380
|
+
NotificationService: () => NotificationService,
|
|
2381
|
+
OpenAPI: () => OpenAPI2,
|
|
2382
|
+
PAYMENT_STATUS: () => PAYMENT_STATUS,
|
|
2383
|
+
PISPI_AMBER_LOGO_DATA_URL: () => PISPI_AMBER_LOGO_DATA_URL,
|
|
2384
|
+
PISPI_QRCODE_LOGO_DATA_URL: () => PISPI_QRCODE_LOGO_DATA_URL,
|
|
2385
|
+
PI_SPI_ENDPOINTS: () => PI_SPI_ENDPOINTS,
|
|
2386
|
+
Paiement: () => Paiement,
|
|
2387
|
+
PaiementAnnulationMotif: () => PaiementAnnulationMotif,
|
|
2388
|
+
PaiementAnnulationStatutRaison: () => PaiementAnnulationStatutRaison,
|
|
2389
|
+
PaiementEnMasseReponseStatut: () => PaiementEnMasseReponseStatut,
|
|
2390
|
+
PaiementEnMasseService: () => PaiementEnMasseService,
|
|
2391
|
+
PaiementImmediatConfirmationReponse: () => PaiementImmediatConfirmationReponse,
|
|
2392
|
+
PaiementImmediatReponse: () => PaiementImmediatReponse,
|
|
2393
|
+
PaiementImmediatService: () => PaiementImmediatService,
|
|
2394
|
+
PaiementStatut: () => PaiementStatut,
|
|
2395
|
+
PaiementStatutRaison: () => PaiementStatutRaison,
|
|
2396
|
+
PiSpiAuthError: () => PiSpiAuthError,
|
|
2397
|
+
PiSpiError: () => PiSpiError,
|
|
2398
|
+
PiSpiNotFoundError: () => PiSpiNotFoundError,
|
|
2399
|
+
PiSpiRateLimitError: () => PiSpiRateLimitError,
|
|
2400
|
+
PiSpiSDK: () => PiSpiSDK,
|
|
2401
|
+
PiSpiValidationError: () => PiSpiValidationError,
|
|
2402
|
+
QRCode: () => QRCode,
|
|
2403
|
+
QueryBuilder: () => QueryBuilder,
|
|
2404
|
+
RefDocType: () => RefDocType,
|
|
2405
|
+
RetourStatut: () => RetourStatut,
|
|
2406
|
+
RetourStatutRaison: () => RetourStatutRaison,
|
|
2407
|
+
RetoursdeFondsService: () => RetoursdeFondsService,
|
|
2408
|
+
UEMOA_COUNTRIES: () => UEMOA_COUNTRIES2,
|
|
2409
|
+
WEBHOOK_EVENTS: () => WEBHOOK_EVENTS,
|
|
2410
|
+
WebhookEvent: () => WebhookEvent,
|
|
2411
|
+
WebhooksEvents: () => WebhooksEvents,
|
|
2412
|
+
buildLomiCustomerQr: () => buildLomiCustomerQr,
|
|
2413
|
+
buildPayloadString: () => buildPayloadString,
|
|
2414
|
+
centimesToXof: () => centimesToXof,
|
|
2415
|
+
computeCrc16: () => computeCrc16,
|
|
2416
|
+
createQrPayload: () => createQrPayload,
|
|
2417
|
+
formatAmount: () => formatAmount,
|
|
2418
|
+
generateQrCodeSvg: () => generateQrCodeSvg,
|
|
2419
|
+
getAvailableAliasTypes: () => getAvailableAliasTypes,
|
|
2420
|
+
getCountryFromAccount: () => getCountryFromAccount,
|
|
2421
|
+
handleApiError: () => handleApiError,
|
|
2422
|
+
isValidAccountNumber: () => isValidAccountNumber,
|
|
2423
|
+
isValidAliasType: () => isValidAliasType,
|
|
2424
|
+
isValidPhoneNumber: () => isValidPhoneNumber,
|
|
2425
|
+
isValidPispiQrPayload: () => isValidPispiQrPayload,
|
|
2426
|
+
isValidShidAlias: () => isValidShidAlias,
|
|
2427
|
+
parseLomiCustomerQr: () => parseLomiCustomerQr,
|
|
2428
|
+
retryWithBackoff: () => retryWithBackoff,
|
|
2429
|
+
serializeLomiCustomerQr: () => serializeLomiCustomerQr,
|
|
2430
|
+
sleep: () => sleep,
|
|
2431
|
+
xofToCentimes: () => xofToCentimes
|
|
2432
|
+
});
|
|
2433
|
+
module.exports = __toCommonJS(index_exports);
|
|
2434
|
+
|
|
2435
|
+
// src/errors.ts
|
|
2436
|
+
var PiSpiError = class extends Error {
|
|
2437
|
+
constructor(message, statusCode, statusText, type, detail, instance) {
|
|
2438
|
+
super(message);
|
|
2439
|
+
this.name = "PiSpiError";
|
|
2440
|
+
this.statusCode = statusCode;
|
|
2441
|
+
this.statusText = statusText;
|
|
2442
|
+
this.type = type;
|
|
2443
|
+
this.detail = detail;
|
|
2444
|
+
this.instance = instance;
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
var PiSpiValidationError = class extends PiSpiError {
|
|
2448
|
+
constructor(message, statusCode, statusText, errors, type, detail) {
|
|
2449
|
+
super(message, statusCode, statusText, type, detail);
|
|
2450
|
+
this.name = "PiSpiValidationError";
|
|
2451
|
+
this.errors = errors;
|
|
2452
|
+
}
|
|
2453
|
+
};
|
|
2454
|
+
var PiSpiAuthError = class extends PiSpiError {
|
|
2455
|
+
constructor(message, statusCode, statusText) {
|
|
2456
|
+
super(message, statusCode, statusText);
|
|
2457
|
+
this.name = "PiSpiAuthError";
|
|
2458
|
+
}
|
|
2459
|
+
};
|
|
2460
|
+
var PiSpiNotFoundError = class extends PiSpiError {
|
|
2461
|
+
constructor(message, statusCode, statusText) {
|
|
2462
|
+
super(message, statusCode, statusText);
|
|
2463
|
+
this.name = "PiSpiNotFoundError";
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2466
|
+
var PiSpiRateLimitError = class extends PiSpiError {
|
|
2467
|
+
constructor(message, statusCode, statusText, retryAfter) {
|
|
2468
|
+
super(message, statusCode, statusText);
|
|
2469
|
+
this.name = "PiSpiRateLimitError";
|
|
2470
|
+
this.retryAfter = retryAfter;
|
|
2471
|
+
}
|
|
2472
|
+
};
|
|
2473
|
+
|
|
2474
|
+
// src/error-handler.ts
|
|
2475
|
+
function handleApiError(error) {
|
|
2476
|
+
const isApiError = error && typeof error === "object" && "status" in error && "statusText" in error && "body" in error;
|
|
2477
|
+
if (isApiError) {
|
|
2478
|
+
const apiError = error;
|
|
2479
|
+
const status = apiError.status;
|
|
2480
|
+
const body = apiError.body;
|
|
2481
|
+
const type = body?.type;
|
|
2482
|
+
const title = body?.title || apiError.statusText;
|
|
2483
|
+
const detail = body?.detail || apiError.message;
|
|
2484
|
+
const instance = body?.instance;
|
|
2485
|
+
if (status === 400) {
|
|
2486
|
+
const invalidParams = body?.invalidParams || body?.errors;
|
|
2487
|
+
throw new PiSpiValidationError(
|
|
2488
|
+
detail || title || "Validation error",
|
|
2489
|
+
status,
|
|
2490
|
+
apiError.statusText,
|
|
2491
|
+
invalidParams,
|
|
2492
|
+
type,
|
|
2493
|
+
detail
|
|
2494
|
+
);
|
|
2495
|
+
}
|
|
2496
|
+
if (status === 401) {
|
|
2497
|
+
throw new PiSpiAuthError(
|
|
2498
|
+
detail || title || "Authentication failed",
|
|
2499
|
+
status,
|
|
2500
|
+
apiError.statusText
|
|
2501
|
+
);
|
|
2502
|
+
}
|
|
2503
|
+
if (status === 403) {
|
|
2504
|
+
throw new PiSpiError(
|
|
2505
|
+
detail || title || "Forbidden",
|
|
2506
|
+
status,
|
|
2507
|
+
apiError.statusText,
|
|
2508
|
+
type,
|
|
2509
|
+
detail,
|
|
2510
|
+
instance
|
|
2511
|
+
);
|
|
2512
|
+
}
|
|
2513
|
+
if (status === 404) {
|
|
2514
|
+
throw new PiSpiNotFoundError(
|
|
2515
|
+
detail || title || "Resource not found",
|
|
2516
|
+
status,
|
|
2517
|
+
apiError.statusText
|
|
2518
|
+
);
|
|
2519
|
+
}
|
|
2520
|
+
if (status === 429) {
|
|
2521
|
+
throw new PiSpiRateLimitError(
|
|
2522
|
+
detail || title || "Rate limit exceeded",
|
|
2523
|
+
status,
|
|
2524
|
+
apiError.statusText
|
|
2525
|
+
);
|
|
2526
|
+
}
|
|
2527
|
+
throw new PiSpiError(
|
|
2528
|
+
detail || title || apiError.message || "API error",
|
|
2529
|
+
status,
|
|
2530
|
+
apiError.statusText,
|
|
2531
|
+
type,
|
|
2532
|
+
detail,
|
|
2533
|
+
instance
|
|
2534
|
+
);
|
|
2535
|
+
}
|
|
2536
|
+
throw error;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
// src/services/base.ts
|
|
2540
|
+
var BaseService = class {
|
|
2541
|
+
constructor(config) {
|
|
2542
|
+
this.config = config;
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* Wrap an async operation with error handling
|
|
2546
|
+
*/
|
|
2547
|
+
async execute(operation) {
|
|
2548
|
+
try {
|
|
2549
|
+
return await operation();
|
|
2550
|
+
} catch (error) {
|
|
2551
|
+
throw handleApiError(error);
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
/**
|
|
2555
|
+
* Make an HTTP request
|
|
2556
|
+
*/
|
|
2557
|
+
async request(method, path, body, params) {
|
|
2558
|
+
return this.execute(async () => {
|
|
2559
|
+
const url = new URL(`${this.config.BASE}${path}`);
|
|
2560
|
+
if (params) {
|
|
2561
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
2562
|
+
if (value !== void 0 && value !== null) {
|
|
2563
|
+
url.searchParams.append(key, String(value));
|
|
2564
|
+
}
|
|
2565
|
+
});
|
|
2566
|
+
}
|
|
2567
|
+
const headers = {
|
|
2568
|
+
"Content-Type": "application/json",
|
|
2569
|
+
"Accept": "application/json",
|
|
2570
|
+
...this.config.HEADERS
|
|
2571
|
+
};
|
|
2572
|
+
if (this.config.TOKEN) {
|
|
2573
|
+
headers["Authorization"] = `Bearer ${this.config.TOKEN}`;
|
|
2574
|
+
}
|
|
2575
|
+
const fetchOptions = {
|
|
2576
|
+
method,
|
|
2577
|
+
headers,
|
|
2578
|
+
body: body ? JSON.stringify(body) : void 0
|
|
2579
|
+
};
|
|
2580
|
+
if (this.config.dispatcher) {
|
|
2581
|
+
fetchOptions.dispatcher = this.config.dispatcher;
|
|
2582
|
+
}
|
|
2583
|
+
const response = await fetch(url.toString(), fetchOptions);
|
|
2584
|
+
if (!response.ok) {
|
|
2585
|
+
let errorBody;
|
|
2586
|
+
try {
|
|
2587
|
+
const parsed = await response.json();
|
|
2588
|
+
errorBody = {
|
|
2589
|
+
...parsed,
|
|
2590
|
+
status: response.status,
|
|
2591
|
+
statusText: response.statusText
|
|
2592
|
+
};
|
|
2593
|
+
} catch {
|
|
2594
|
+
errorBody = {
|
|
2595
|
+
status: response.status,
|
|
2596
|
+
statusText: response.statusText
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
throw errorBody;
|
|
2600
|
+
}
|
|
2601
|
+
if (response.status === 204) {
|
|
2602
|
+
return {};
|
|
2603
|
+
}
|
|
2604
|
+
return await response.json();
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2607
|
+
};
|
|
2608
|
+
|
|
2609
|
+
// src/services/comptes.ts
|
|
2610
|
+
var ComptesService = class extends BaseService {
|
|
2611
|
+
/**
|
|
2612
|
+
* Get account details and balance
|
|
2613
|
+
*
|
|
2614
|
+
* **Returns:**
|
|
2615
|
+
* - Account type (CACC, SVGS, etc.)
|
|
2616
|
+
* - Account number
|
|
2617
|
+
* - Current balance (`solde` in centimes)
|
|
2618
|
+
* - Account status (OUVERT, BLOQUE, CLOTURE)
|
|
2619
|
+
* - Opening date
|
|
2620
|
+
* - Pre-confirmation indicator
|
|
2621
|
+
*
|
|
2622
|
+
* @param numero - Account number (e.g., 'CIC2344256727788288822')
|
|
2623
|
+
* @returns Account details including balance
|
|
2624
|
+
* @throws {PiSpiNotFoundError} If account not found
|
|
2625
|
+
* @throws {PiSpiAuthError} If authentication fails
|
|
2626
|
+
*
|
|
2627
|
+
* @example
|
|
2628
|
+
* ```typescript
|
|
2629
|
+
* const account = await sdk.comptes.getAccount('CIC2344256727788288822');
|
|
2630
|
+
* // Returns: {
|
|
2631
|
+
* // type: 'CACC',
|
|
2632
|
+
* // numero: 'CIC2344256727788288822',
|
|
2633
|
+
* // solde: 150000000, // 1,500,000 XOF in centimes
|
|
2634
|
+
* // statut: 'OUVERT',
|
|
2635
|
+
* // dateOuverture: '2023-02-21T15:30:01.250Z'
|
|
2636
|
+
* // }
|
|
2637
|
+
* ```
|
|
2638
|
+
*/
|
|
2639
|
+
async getAccount(numero) {
|
|
2640
|
+
return this.request("GET", `/comptes/${encodeURIComponent(numero)}`);
|
|
2641
|
+
}
|
|
2642
|
+
/**
|
|
2643
|
+
* List account operations (transactions)
|
|
2644
|
+
*
|
|
2645
|
+
* **Filtering Options:**
|
|
2646
|
+
* - Filter by account number (`comptePayeur`, `comptePaye`)
|
|
2647
|
+
* - Filter by status (`statut`: INITIE, ENVOYE, IRREVOCABLE, REJETE)
|
|
2648
|
+
* - Filter by dates (`dateEnvoi`, `dateIrrevocabilite`)
|
|
2649
|
+
* - Use QueryBuilder for advanced filtering
|
|
2650
|
+
*
|
|
2651
|
+
* @param params - Query parameters for filtering and pagination
|
|
2652
|
+
* @param params.comptePayeur - Filter by payer account number
|
|
2653
|
+
* @param params.comptePaye - Filter by payee account number
|
|
2654
|
+
* @param params.statut - Filter by transaction status
|
|
2655
|
+
* @param params.dateEnvoi - Filter by send date
|
|
2656
|
+
* @param params.dateIrrevocabilite - Filter by irrevocability date
|
|
2657
|
+
* @param params.page - Page number (default: 1)
|
|
2658
|
+
* @param params.size - Page size (default: 20, max: 100)
|
|
2659
|
+
* @returns Paginated list of operations
|
|
2660
|
+
*
|
|
2661
|
+
* @example
|
|
2662
|
+
* ```typescript
|
|
2663
|
+
* // List all operations for an account
|
|
2664
|
+
* const operations = await sdk.comptes.listOperations({
|
|
2665
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
2666
|
+
* page: 1,
|
|
2667
|
+
* size: 20
|
|
2668
|
+
* });
|
|
2669
|
+
*
|
|
2670
|
+
* // Filter by status
|
|
2671
|
+
* const completed = await sdk.comptes.listOperations({
|
|
2672
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
2673
|
+
* statut: 'IRREVOCABLE'
|
|
2674
|
+
* });
|
|
2675
|
+
* ```
|
|
2676
|
+
*/
|
|
2677
|
+
async listOperations(params) {
|
|
2678
|
+
return this.request("GET", "/comptes/transactions", void 0, params);
|
|
2679
|
+
}
|
|
2680
|
+
/**
|
|
2681
|
+
* Transfer funds between accounts owned by the same client
|
|
2682
|
+
*
|
|
2683
|
+
* **Intra-Account Transfer:**
|
|
2684
|
+
* - Transfers between accounts owned by the same legal entity
|
|
2685
|
+
* - Accounts must be at the same financial institution
|
|
2686
|
+
* - Can use account numbers or aliases
|
|
2687
|
+
*
|
|
2688
|
+
* **Transfer Methods:**
|
|
2689
|
+
* - Using account numbers: `comptePayeur` and `comptePaye`
|
|
2690
|
+
* - Using aliases: `payeurAlias` and `payeAlias`
|
|
2691
|
+
*
|
|
2692
|
+
* @param transfer - Transfer request details
|
|
2693
|
+
* @param transfer.comptePayeur - Payer account number (if using account numbers)
|
|
2694
|
+
* @param transfer.comptePaye - Payee account number (if using account numbers)
|
|
2695
|
+
* @param transfer.payeurAlias - Payer alias (if using aliases)
|
|
2696
|
+
* @param transfer.payeAlias - Payee alias (if using aliases)
|
|
2697
|
+
* @param transfer.montant - Amount in centimes (e.g., 150000 = 1,500 XOF)
|
|
2698
|
+
* @param transfer.motif - Transfer reason/description
|
|
2699
|
+
* @param transfer.txId - Unique transaction ID (optional, auto-generated if not provided)
|
|
2700
|
+
* @returns Transfer response with status
|
|
2701
|
+
* @throws {PiSpiValidationError} If transfer fails validation
|
|
2702
|
+
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
2703
|
+
*
|
|
2704
|
+
* @example
|
|
2705
|
+
* ```typescript
|
|
2706
|
+
* // Transfer using account numbers
|
|
2707
|
+
* await sdk.comptes.transfer({
|
|
2708
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
2709
|
+
* comptePaye: 'SNC2344256727788288822',
|
|
2710
|
+
* montant: 150000, // 1,500 XOF
|
|
2711
|
+
* motif: 'Transfert de fonds',
|
|
2712
|
+
* txId: '23511722'
|
|
2713
|
+
* });
|
|
2714
|
+
*
|
|
2715
|
+
* // Transfer using aliases
|
|
2716
|
+
* await sdk.comptes.transfer({
|
|
2717
|
+
* payeurAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f',
|
|
2718
|
+
* payeAlias: '4r5ty499-3e50-435b-b757-ac7a83d67juio',
|
|
2719
|
+
* montant: 150000,
|
|
2720
|
+
* motif: 'Transfert entre comptes'
|
|
2721
|
+
* });
|
|
2722
|
+
* ```
|
|
2723
|
+
*/
|
|
2724
|
+
async transfer(transfer) {
|
|
2725
|
+
const txId = transfer.txId ?? `TRF-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
2726
|
+
return this.request("POST", "/comptes/transactions", {
|
|
2727
|
+
txId,
|
|
2728
|
+
comptePayeur: transfer.comptePayeur,
|
|
2729
|
+
comptePaye: transfer.comptePaye,
|
|
2730
|
+
payeurAlias: transfer.payeurAlias,
|
|
2731
|
+
payeAlias: transfer.payeAlias,
|
|
2732
|
+
montant: transfer.montant,
|
|
2733
|
+
motif: transfer.motif
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2738
|
+
// src/services/alias.ts
|
|
2739
|
+
var AliasService = class extends BaseService {
|
|
2740
|
+
/**
|
|
2741
|
+
* Create an account alias
|
|
2742
|
+
*
|
|
2743
|
+
* **Alias Types:**
|
|
2744
|
+
* - `SHID`: System-generated unique payment address (UUID format, 36 chars). Available for all client types (P, C, B, G)
|
|
2745
|
+
* - `MCOD`: Merchant code for USSD payments. Available for business clients only (C, B, G)
|
|
2746
|
+
* - `MBNO`: Mobile phone number. Available for individuals only (P)
|
|
2747
|
+
*
|
|
2748
|
+
* **Limits:**
|
|
2749
|
+
* - Default: 20 aliases per account
|
|
2750
|
+
* - Limit can be increased based on client needs
|
|
2751
|
+
*
|
|
2752
|
+
* @param alias - Alias creation data
|
|
2753
|
+
* @param alias.compte - Account number (e.g., 'CIC2344256727788288822')
|
|
2754
|
+
* @param alias.type - Alias type: 'SHID', 'MCOD', or 'MBNO'
|
|
2755
|
+
* @returns Created alias with generated `cle` (key) value
|
|
2756
|
+
* @throws {PiSpiError} If account not found or limit exceeded
|
|
2757
|
+
*
|
|
2758
|
+
* @example
|
|
2759
|
+
* ```typescript
|
|
2760
|
+
* // For business clients (C, B, G)
|
|
2761
|
+
* await sdk.alias.create({
|
|
2762
|
+
* compte: 'SNC2344256727788288822',
|
|
2763
|
+
* type: AliasType.SHID
|
|
2764
|
+
* });
|
|
2765
|
+
* ```
|
|
2766
|
+
*/
|
|
2767
|
+
async create(alias) {
|
|
2768
|
+
return this.request(
|
|
2769
|
+
"POST",
|
|
2770
|
+
`/comptes/${encodeURIComponent(alias.compte)}/alias`,
|
|
2771
|
+
{ type: alias.type }
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* List aliases for an account
|
|
2776
|
+
*
|
|
2777
|
+
* @param compte - Account number
|
|
2778
|
+
* @param params - Query parameters for pagination
|
|
2779
|
+
* @returns Paginated list of aliases
|
|
2780
|
+
*/
|
|
2781
|
+
async list(compte, params) {
|
|
2782
|
+
return this.request("GET", `/comptes/${encodeURIComponent(compte)}/alias`, void 0, params);
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Delete an alias
|
|
2786
|
+
*
|
|
2787
|
+
* @param alias - Alias identifier
|
|
2788
|
+
*/
|
|
2789
|
+
async delete(alias, compte) {
|
|
2790
|
+
if (!compte) {
|
|
2791
|
+
throw new Error("Account number (compte) is required to delete an alias.");
|
|
2792
|
+
}
|
|
2793
|
+
return this.request(
|
|
2794
|
+
"DELETE",
|
|
2795
|
+
`/comptes/${encodeURIComponent(compte)}/alias/${encodeURIComponent(alias)}`
|
|
2796
|
+
);
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
// src/services/webhooks.ts
|
|
2801
|
+
var WebhooksService = class extends BaseService {
|
|
2802
|
+
/**
|
|
2803
|
+
* Create a webhook configuration
|
|
2804
|
+
*
|
|
2805
|
+
* **Webhook Setup:**
|
|
2806
|
+
* - URL must be HTTPS
|
|
2807
|
+
* - Server must support mTLS with BCEAO-issued certificate
|
|
2808
|
+
* - Server must validate HMAC signatures
|
|
2809
|
+
* - Server must respond with 2xx status code
|
|
2810
|
+
*
|
|
2811
|
+
* **Event Types:**
|
|
2812
|
+
* - `PAIEMENT_RECU`: Payment received
|
|
2813
|
+
* - `PAIEMENT_ENVOYE`: Payment sent (irreversible)
|
|
2814
|
+
* - `PAIEMENT_REJETE`: Payment rejected
|
|
2815
|
+
* - `RTP_RECU`: Payment request received
|
|
2816
|
+
* - `RTP_REJETE`: Payment request rejected
|
|
2817
|
+
* - `RETOUR_ENVOYE`: Fund return sent
|
|
2818
|
+
* - `RETOUR_REJETE`: Fund return rejected
|
|
2819
|
+
* - `RETOUR_RECU`: Fund return received
|
|
2820
|
+
* - `ANNULATION_DEMANDE`: Cancellation request received
|
|
2821
|
+
* - `ANNULATION_REJETE`: Cancellation request rejected
|
|
2822
|
+
*
|
|
2823
|
+
* @param webhook - Webhook configuration
|
|
2824
|
+
* @param webhook.callbackUrl - HTTPS URL to receive notifications (must support mTLS)
|
|
2825
|
+
* @param webhook.events - Array of event types to subscribe to
|
|
2826
|
+
* @param webhook.alias - Optional: Alias-specific webhook (only notifications for this alias)
|
|
2827
|
+
* @returns Created webhook configuration
|
|
2828
|
+
* @throws {PiSpiValidationError} If URL is invalid or events array is empty
|
|
2829
|
+
*
|
|
2830
|
+
* @example
|
|
2831
|
+
* ```typescript
|
|
2832
|
+
* // Webhook for all payment events
|
|
2833
|
+
* await sdk.webhooks.create({
|
|
2834
|
+
* callbackUrl: 'https://business.example.com/api/webhooks/pi-spi',
|
|
2835
|
+
* events: ['PAIEMENT_RECU', 'PAIEMENT_ENVOYE', 'PAIEMENT_REJETE']
|
|
2836
|
+
* });
|
|
2837
|
+
*
|
|
2838
|
+
* // Alias-specific webhook
|
|
2839
|
+
* await sdk.webhooks.create({
|
|
2840
|
+
* callbackUrl: 'https://business.example.com/api/webhooks/pi-spi',
|
|
2841
|
+
* events: ['PAIEMENT_RECU'],
|
|
2842
|
+
* alias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f'
|
|
2843
|
+
* });
|
|
2844
|
+
* ```
|
|
2845
|
+
*/
|
|
2846
|
+
async create(webhook) {
|
|
2847
|
+
return this.request("POST", "/webhooks", webhook);
|
|
2848
|
+
}
|
|
2849
|
+
/**
|
|
2850
|
+
* List all configured webhooks
|
|
2851
|
+
*
|
|
2852
|
+
* @param params - Query parameters for pagination
|
|
2853
|
+
* @returns Paginated list of webhooks
|
|
2854
|
+
*
|
|
2855
|
+
* @example
|
|
2856
|
+
* ```typescript
|
|
2857
|
+
* const webhooks = await sdk.webhooks.list({ page: 1, size: 20 });
|
|
2858
|
+
* ```
|
|
2859
|
+
*/
|
|
2860
|
+
async list(params) {
|
|
2861
|
+
return this.request("GET", "/webhooks", void 0, params);
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* Get webhook details by ID
|
|
2865
|
+
*
|
|
2866
|
+
* @param id - Webhook ID
|
|
2867
|
+
* @returns Webhook details
|
|
2868
|
+
* @throws {PiSpiNotFoundError} If webhook not found
|
|
2869
|
+
*/
|
|
2870
|
+
async get(id) {
|
|
2871
|
+
return this.request("GET", `/webhooks/${encodeURIComponent(id)}`);
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Update webhook configuration
|
|
2875
|
+
*
|
|
2876
|
+
* @param id - Webhook ID
|
|
2877
|
+
* @param webhook - Updated webhook configuration
|
|
2878
|
+
* @param webhook.callbackUrl - New callback URL (optional)
|
|
2879
|
+
* @param webhook.events - New event subscriptions (optional)
|
|
2880
|
+
* @param webhook.alias - New alias filter (optional)
|
|
2881
|
+
* @returns Updated webhook configuration
|
|
2882
|
+
* @throws {PiSpiNotFoundError} If webhook not found
|
|
2883
|
+
* @throws {PiSpiValidationError} If update fails validation
|
|
2884
|
+
*
|
|
2885
|
+
* @example
|
|
2886
|
+
* ```typescript
|
|
2887
|
+
* await sdk.webhooks.update('webhook-001', {
|
|
2888
|
+
* callbackUrl: 'https://updated-url.com/webhooks/pi-spi',
|
|
2889
|
+
* events: ['PAIEMENT_RECU', 'RTP_RECU']
|
|
2890
|
+
* });
|
|
2891
|
+
* ```
|
|
2892
|
+
*/
|
|
2893
|
+
async update(id, webhook) {
|
|
2894
|
+
return this.request(
|
|
2895
|
+
"PUT",
|
|
2896
|
+
`/webhooks/${encodeURIComponent(id)}`,
|
|
2897
|
+
webhook
|
|
2898
|
+
);
|
|
2899
|
+
}
|
|
2900
|
+
/**
|
|
2901
|
+
* Delete a webhook configuration
|
|
2902
|
+
*
|
|
2903
|
+
* @param id - Webhook ID
|
|
2904
|
+
* @throws {PiSpiNotFoundError} If webhook not found
|
|
2905
|
+
*/
|
|
2906
|
+
async delete(id) {
|
|
2907
|
+
return this.request("DELETE", `/webhooks/${encodeURIComponent(id)}`);
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
// src/services/demandes-paiement.ts
|
|
2912
|
+
var DemandesPaiementService = class extends BaseService {
|
|
2913
|
+
/**
|
|
2914
|
+
* Create a payment request
|
|
2915
|
+
*
|
|
2916
|
+
* **Request Types:**
|
|
2917
|
+
* - **E-commerce** (`categorie: 521`): Max 3 minutes validity
|
|
2918
|
+
* - **POS** (`categorie: 500`): Max 24 hours validity
|
|
2919
|
+
* - **Invoice** (`categorie: 401`): Custom due date (up to 90 days)
|
|
2920
|
+
*
|
|
2921
|
+
* **Confirmation Options:**
|
|
2922
|
+
* - `confirmation: false`: Request sent immediately (default for POS)
|
|
2923
|
+
* - `confirmation: true`: Returns payer info for verification before sending
|
|
2924
|
+
*
|
|
2925
|
+
* **Customer Actions:**
|
|
2926
|
+
* - Accept & Pay Now: Payment processed immediately
|
|
2927
|
+
* - Accept & Pay Later: Payment scheduled (if dateLimiteReponse > 24h)
|
|
2928
|
+
* - Reject: Request rejected with reason
|
|
2929
|
+
* - Ignore: Request expires after dateLimiteReponse
|
|
2930
|
+
*
|
|
2931
|
+
* @param request - Payment request creation data
|
|
2932
|
+
* @param request.comptePaye - Business account number (payee)
|
|
2933
|
+
* @param request.payeurAlias - Customer alias (payer)
|
|
2934
|
+
* @param request.montant - Amount in centimes (e.g., 150000 = 1,500 XOF)
|
|
2935
|
+
* @param request.categorie - Request category: '500' (POS), '521' (E-commerce), '401' (Invoice)
|
|
2936
|
+
* @param request.motif - Payment reason/description
|
|
2937
|
+
* @param request.txId - Unique transaction ID (optional)
|
|
2938
|
+
* @param request.dateLimitePaiement - Payment due date (required for e-commerce and invoices)
|
|
2939
|
+
* @param request.dateLimiteReponse - Response deadline (default: 90 days from creation)
|
|
2940
|
+
* @param request.confirmation - Whether to require confirmation (default: false for POS, true for invoices)
|
|
2941
|
+
* @param request.refDocType - Reference document type (e.g., 'CINV' for invoice)
|
|
2942
|
+
* @param request.refDocNumero - Reference document number (e.g., invoice number)
|
|
2943
|
+
* @returns Payment request response
|
|
2944
|
+
* @throws {PiSpiValidationError} If request fails validation
|
|
2945
|
+
*
|
|
2946
|
+
* @example
|
|
2947
|
+
* ```typescript
|
|
2948
|
+
* // E-commerce payment request (3-minute expiry)
|
|
2949
|
+
* await sdk.demandesPaiement.create({
|
|
2950
|
+
* comptePaye: 'CIC2344256727788288822',
|
|
2951
|
+
* payeurAlias: '9b1b3499-3e50-435b-b757-ac7a83d8aa96',
|
|
2952
|
+
* montant: 25000, // 250 XOF
|
|
2953
|
+
* categorie: '521',
|
|
2954
|
+
* dateLimitePaiement: '2023-02-21T15:37:00.000Z', // 3 minutes from now
|
|
2955
|
+
* motif: 'Paiement du livre Manuel des écritures comptables'
|
|
2956
|
+
* });
|
|
2957
|
+
*
|
|
2958
|
+
* // Invoice payment request
|
|
2959
|
+
* await sdk.demandesPaiement.create({
|
|
2960
|
+
* comptePaye: 'CIC2344256727788288822',
|
|
2961
|
+
* payeurAlias: '9b1b3499-3e50-435b-b757-ac7a83d8aa96',
|
|
2962
|
+
* montant: 150000, // 1,500 XOF
|
|
2963
|
+
* categorie: '401',
|
|
2964
|
+
* dateLimitePaiement: '2023-12-31T23:59:59.999Z',
|
|
2965
|
+
* motif: 'Facture électricité mars 2023',
|
|
2966
|
+
* refDocType: 'CINV',
|
|
2967
|
+
* refDocNumero: 'FACT-ELEC-202303',
|
|
2968
|
+
* confirmation: true
|
|
2969
|
+
* });
|
|
2970
|
+
* ```
|
|
2971
|
+
*/
|
|
2972
|
+
async create(request2) {
|
|
2973
|
+
return this.request("POST", "/demandes-paiements", request2);
|
|
2974
|
+
}
|
|
2975
|
+
/**
|
|
2976
|
+
* List payment requests with filtering and pagination
|
|
2977
|
+
*
|
|
2978
|
+
* @param params - Query parameters for filtering and pagination
|
|
2979
|
+
* @returns Paginated list of payment requests
|
|
2980
|
+
*/
|
|
2981
|
+
async list(params) {
|
|
2982
|
+
return this.request("GET", "/demandes-paiements", void 0, params);
|
|
2983
|
+
}
|
|
2984
|
+
/**
|
|
2985
|
+
* Get payment request details
|
|
2986
|
+
*
|
|
2987
|
+
* @param id - Payment request transaction ID
|
|
2988
|
+
* @returns Payment request details
|
|
2989
|
+
* @throws {PiSpiNotFoundError} If request not found
|
|
2990
|
+
*/
|
|
2991
|
+
async get(id) {
|
|
2992
|
+
return this.request("GET", `/demandes-paiements/${encodeURIComponent(id)}`);
|
|
2993
|
+
}
|
|
2994
|
+
/**
|
|
2995
|
+
* Accept a payment request
|
|
2996
|
+
*
|
|
2997
|
+
* **Note:** This is typically called by the customer's payment app, not the business.
|
|
2998
|
+
* The business receives notification when customer accepts.
|
|
2999
|
+
*
|
|
3000
|
+
* @param id - Payment request transaction ID
|
|
3001
|
+
* @param immediate - Whether to pay immediately (true) or schedule payment (false)
|
|
3002
|
+
* @returns Payment confirmation response
|
|
3003
|
+
*/
|
|
3004
|
+
async accept(id, immediate = true) {
|
|
3005
|
+
return this.request(
|
|
3006
|
+
"POST",
|
|
3007
|
+
`/demandes-paiements/${encodeURIComponent(id)}/reponses`,
|
|
3008
|
+
{ decision: true, paiementImmediat: immediate }
|
|
3009
|
+
);
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Reject a payment request
|
|
3013
|
+
*
|
|
3014
|
+
* **Note:** This is typically called by the customer's payment app, not the business.
|
|
3015
|
+
* The business receives notification when customer rejects.
|
|
3016
|
+
*
|
|
3017
|
+
* @param id - Payment request transaction ID
|
|
3018
|
+
* @param reason - Rejection reason code (optional)
|
|
3019
|
+
* @returns Rejection confirmation response
|
|
3020
|
+
*/
|
|
3021
|
+
async reject(id, reason) {
|
|
3022
|
+
return this.request(
|
|
3023
|
+
"POST",
|
|
3024
|
+
`/demandes-paiements/${encodeURIComponent(id)}/reponses`,
|
|
3025
|
+
{ decision: false, ...reason ? { raison: reason } : {} }
|
|
3026
|
+
);
|
|
3027
|
+
}
|
|
3028
|
+
/**
|
|
3029
|
+
* Confirm sending a payment request created with confirmation: true
|
|
3030
|
+
*/
|
|
3031
|
+
async confirm(txId, decision) {
|
|
3032
|
+
return this.request(
|
|
3033
|
+
"PUT",
|
|
3034
|
+
`/demandes-paiements/${encodeURIComponent(txId)}/confirmations`,
|
|
3035
|
+
{ decision }
|
|
3036
|
+
);
|
|
3037
|
+
}
|
|
3038
|
+
};
|
|
3039
|
+
|
|
3040
|
+
// src/services/demandes-paiement-en-masse.ts
|
|
3041
|
+
var DemandesPaiementEnMasseService = class extends BaseService {
|
|
3042
|
+
/**
|
|
3043
|
+
* Create bulk payment requests
|
|
3044
|
+
*/
|
|
3045
|
+
async create(request2) {
|
|
3046
|
+
const transactions = request2.transactions.map((t) => ({
|
|
3047
|
+
...t,
|
|
3048
|
+
categorie: t.categorie || "401"
|
|
3049
|
+
}));
|
|
3050
|
+
return this.request("POST", "/demandes-paiements-groupes", {
|
|
3051
|
+
...request2,
|
|
3052
|
+
transactions
|
|
3053
|
+
// Use the mapped transactions with defaults
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3056
|
+
/**
|
|
3057
|
+
* Get bulk payment request details and status
|
|
3058
|
+
*/
|
|
3059
|
+
async get(instructionId) {
|
|
3060
|
+
return this.request("GET", `/demandes-paiements-groupes/${instructionId}`);
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Confirm and send bulk payment requests
|
|
3064
|
+
*/
|
|
3065
|
+
async confirm(instructionId) {
|
|
3066
|
+
return this.request("PUT", `/demandes-paiements-groupes/${instructionId}/confirmations`, {
|
|
3067
|
+
decision: true
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3070
|
+
};
|
|
3071
|
+
|
|
3072
|
+
// src/services/paiements.ts
|
|
3073
|
+
var PaiementsService = class extends BaseService {
|
|
3074
|
+
/**
|
|
3075
|
+
* Create an immediate payment
|
|
3076
|
+
*
|
|
3077
|
+
* **Payment Flow:**
|
|
3078
|
+
* - If `confirmation: false`: Payment is sent immediately (default)
|
|
3079
|
+
* - If `confirmation: true`: Payment is initiated, returns payee info for confirmation
|
|
3080
|
+
*
|
|
3081
|
+
* **Supported Transaction Types:**
|
|
3082
|
+
* - Bank-to-Bank (`categorie: 733`)
|
|
3083
|
+
* - Bank-to-Wallet (via alias lookup)
|
|
3084
|
+
* - Wallet-to-Wallet (via alias lookup)
|
|
3085
|
+
* - Wallet-to-Bank (via alias lookup)
|
|
3086
|
+
*
|
|
3087
|
+
* **Status Values:**
|
|
3088
|
+
* - `INITIE`: Waiting for confirmation (if confirmation: true)
|
|
3089
|
+
* - `ENVOYE`: Payment sent successfully
|
|
3090
|
+
* - `IRREVOCABLE`: Payment confirmed and cannot be reversed
|
|
3091
|
+
* - `REJETE`: Payment rejected (check `statutRaison` for error code)
|
|
3092
|
+
*
|
|
3093
|
+
* @param payment - Payment creation data
|
|
3094
|
+
* @param payment.comptePayeur - Payer account number (e.g., 'CIC2344256727788288822')
|
|
3095
|
+
* @param payment.payeAlias - Payee alias (SHID, MCOD, or MBNO format)
|
|
3096
|
+
* @param payment.montant - Amount in centimes (e.g., 150000 = 1,500 XOF)
|
|
3097
|
+
* @param payment.motif - Payment reason/description
|
|
3098
|
+
* @param payment.txId - Unique transaction ID (optional, auto-generated if not provided)
|
|
3099
|
+
* @param payment.confirmation - Whether to require confirmation before sending (default: false)
|
|
3100
|
+
* @param payment.categorie - Payment category/canal (default: 733 for API Business)
|
|
3101
|
+
* @returns Payment response with status
|
|
3102
|
+
* @throws {PiSpiValidationError} If payment fails validation (e.g., invalid alias, duplicate txId)
|
|
3103
|
+
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
3104
|
+
*
|
|
3105
|
+
* @example
|
|
3106
|
+
* ```typescript
|
|
3107
|
+
* // Immediate payment (no confirmation)
|
|
3108
|
+
* const payment = await sdk.paiements.create({
|
|
3109
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3110
|
+
* payeAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f', // SHID alias
|
|
3111
|
+
* montant: 150000, // 1,500 XOF
|
|
3112
|
+
* motif: 'Paiement de services',
|
|
3113
|
+
* txId: '23552722'
|
|
3114
|
+
* });
|
|
3115
|
+
*
|
|
3116
|
+
* // Payment with confirmation (returns payee info)
|
|
3117
|
+
* const paymentWithConfirmation = await sdk.paiements.create({
|
|
3118
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3119
|
+
* payeAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f',
|
|
3120
|
+
* montant: 3000000, // 30,000 XOF
|
|
3121
|
+
* confirmation: true
|
|
3122
|
+
* });
|
|
3123
|
+
* ```
|
|
3124
|
+
*/
|
|
3125
|
+
async create(payment) {
|
|
3126
|
+
const txId = payment.txId ?? `PAY-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
3127
|
+
const payeurAlias = payment.payeurAlias ?? payment.comptePayeur;
|
|
3128
|
+
if (!payeurAlias) {
|
|
3129
|
+
throw new Error("payeurAlias or comptePayeur is required for SPI payouts");
|
|
3130
|
+
}
|
|
3131
|
+
return this.request("POST", "/paiements", {
|
|
3132
|
+
txId,
|
|
3133
|
+
payeurAlias,
|
|
3134
|
+
payeAlias: payment.payeAlias,
|
|
3135
|
+
montant: payment.montant,
|
|
3136
|
+
motif: payment.motif,
|
|
3137
|
+
confirmation: payment.confirmation ?? false
|
|
3138
|
+
});
|
|
3139
|
+
}
|
|
3140
|
+
/**
|
|
3141
|
+
* Get payment details by transaction ID
|
|
3142
|
+
*
|
|
3143
|
+
* @param txId - Transaction ID
|
|
3144
|
+
* @returns Payment details including status and history
|
|
3145
|
+
* @throws {PiSpiNotFoundError} If payment not found
|
|
3146
|
+
*
|
|
3147
|
+
* @example
|
|
3148
|
+
* ```typescript
|
|
3149
|
+
* const payment = await sdk.paiements.get('23552722');
|
|
3150
|
+
* console.log('Status:', payment.statut); // 'IRREVOCABLE'
|
|
3151
|
+
* console.log('Amount:', payment.montant); // 150000
|
|
3152
|
+
* ```
|
|
3153
|
+
*/
|
|
3154
|
+
async get(txId) {
|
|
3155
|
+
return this.request("GET", `/paiements/${encodeURIComponent(txId)}`);
|
|
3156
|
+
}
|
|
3157
|
+
/**
|
|
3158
|
+
* List payments with filtering and pagination
|
|
3159
|
+
*
|
|
3160
|
+
* **Filter Options:**
|
|
3161
|
+
* - Filter by account: `comptePayeur`
|
|
3162
|
+
* - Filter by status: `statut` (INITIE, ENVOYE, IRREVOCABLE, REJETE)
|
|
3163
|
+
* - Filter by dates: `dateEnvoi`, `dateIrrevocabilite`
|
|
3164
|
+
* - Use QueryBuilder for advanced filtering
|
|
3165
|
+
*
|
|
3166
|
+
* @param params - Query parameters for filtering and pagination
|
|
3167
|
+
* @returns Paginated list of payments
|
|
3168
|
+
*
|
|
3169
|
+
* @example
|
|
3170
|
+
* ```typescript
|
|
3171
|
+
* // List all payments for an account
|
|
3172
|
+
* const payments = await sdk.paiements.list({
|
|
3173
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3174
|
+
* page: 1,
|
|
3175
|
+
* size: 20
|
|
3176
|
+
* });
|
|
3177
|
+
*
|
|
3178
|
+
* // Filter by status
|
|
3179
|
+
* const completed = await sdk.paiements.list({
|
|
3180
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3181
|
+
* statut: 'IRREVOCABLE'
|
|
3182
|
+
* });
|
|
3183
|
+
* ```
|
|
3184
|
+
*/
|
|
3185
|
+
async list(params) {
|
|
3186
|
+
return this.request("GET", "/paiements", void 0, params);
|
|
3187
|
+
}
|
|
3188
|
+
/**
|
|
3189
|
+
* Confirm a payment that was created with confirmation: true
|
|
3190
|
+
*/
|
|
3191
|
+
async confirm(txId, decision, body) {
|
|
3192
|
+
return this.request(
|
|
3193
|
+
"PUT",
|
|
3194
|
+
`/paiements/${encodeURIComponent(txId)}/confirmations`,
|
|
3195
|
+
{ decision, ...body }
|
|
3196
|
+
);
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Verify payment status by end-to-end ID
|
|
3200
|
+
*/
|
|
3201
|
+
async verifyStatus(end2endId) {
|
|
3202
|
+
return this.request(
|
|
3203
|
+
"GET",
|
|
3204
|
+
`/paiements/${encodeURIComponent(end2endId)}/statuts`
|
|
3205
|
+
);
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
|
|
3209
|
+
// src/services/paiements-en-masse.ts
|
|
3210
|
+
var PaiementsEnMasseService = class extends BaseService {
|
|
3211
|
+
/**
|
|
3212
|
+
* Create bulk payments
|
|
3213
|
+
*
|
|
3214
|
+
* **Bulk Processing:**
|
|
3215
|
+
* - All transactions share the same `instructionId`
|
|
3216
|
+
* - Each transaction needs unique `txId`
|
|
3217
|
+
* - Transactions are processed in parallel
|
|
3218
|
+
* - Failed transactions can be retried
|
|
3219
|
+
*
|
|
3220
|
+
* **Performance Considerations:**
|
|
3221
|
+
* - Larger bulks take longer to process
|
|
3222
|
+
* - May hit HTTP timeout for very large bulks
|
|
3223
|
+
* - Recommended: 500-5,000 transactions per bulk
|
|
3224
|
+
* - For >10,000 transactions, split into multiple bulks
|
|
3225
|
+
*
|
|
3226
|
+
* **Response Status:**
|
|
3227
|
+
* - `INITIE`: Bulk created, awaiting confirmation
|
|
3228
|
+
* - `ENVOYE`: Bulk sent, transactions processing
|
|
3229
|
+
* - `IRREVOCABLE`: All transactions completed
|
|
3230
|
+
* - `PARTIEL`: Some transactions succeeded, some failed
|
|
3231
|
+
* - `REJETE`: Bulk rejected (validation failed)
|
|
3232
|
+
*
|
|
3233
|
+
* @param payment - Bulk payment creation data
|
|
3234
|
+
* @param payment.comptePayeur - Payer account number
|
|
3235
|
+
* @param payment.instructionId - Unique bulk instruction ID
|
|
3236
|
+
* @param payment.transactions - Array of payment transactions
|
|
3237
|
+
* @param payment.transactions[].txId - Unique transaction ID (must be unique within bulk)
|
|
3238
|
+
* @param payment.transactions[].payeAlias - Payee alias (SHID, MCOD, or MBNO)
|
|
3239
|
+
* @param payment.transactions[].montant - Amount in centimes
|
|
3240
|
+
* @param payment.transactions[].motif - Payment reason/description
|
|
3241
|
+
* @param payment.transactions[].refDocType - Reference document type (optional)
|
|
3242
|
+
* @param payment.transactions[].refDocNumero - Reference document number (optional)
|
|
3243
|
+
* @returns Bulk payment response with status and summary
|
|
3244
|
+
* @throws {PiSpiValidationError} If bulk fails validation (e.g., duplicate txId, invalid alias)
|
|
3245
|
+
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
3246
|
+
*
|
|
3247
|
+
* @example
|
|
3248
|
+
* ```typescript
|
|
3249
|
+
* // Create bulk payment for salary disbursement
|
|
3250
|
+
* await sdk.paiementsEnMasse.createBulk({
|
|
3251
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3252
|
+
* instructionId: 'SALARY-2023-03',
|
|
3253
|
+
* transactions: [
|
|
3254
|
+
* {
|
|
3255
|
+
* txId: 'SAL-001',
|
|
3256
|
+
* payeAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f',
|
|
3257
|
+
* montant: 500000, // 5,000 XOF
|
|
3258
|
+
* motif: 'Salaire mars 2023'
|
|
3259
|
+
* },
|
|
3260
|
+
* {
|
|
3261
|
+
* txId: 'SAL-002',
|
|
3262
|
+
* payeAlias: '4r5ty499-3e50-435b-b757-ac7a83d67juio',
|
|
3263
|
+
* montant: 750000, // 7,500 XOF
|
|
3264
|
+
* motif: 'Salaire mars 2023'
|
|
3265
|
+
* }
|
|
3266
|
+
* ]
|
|
3267
|
+
* });
|
|
3268
|
+
* ```
|
|
3269
|
+
*/
|
|
3270
|
+
async createBulk(payment) {
|
|
3271
|
+
return this.request("POST", "/paiements-groupes", payment);
|
|
3272
|
+
}
|
|
3273
|
+
/**
|
|
3274
|
+
* Get bulk payment details and status
|
|
3275
|
+
*
|
|
3276
|
+
* **Response Includes:**
|
|
3277
|
+
* - Overall bulk status
|
|
3278
|
+
* - Transaction counts (total, succeeded, failed)
|
|
3279
|
+
* - Individual transaction statuses
|
|
3280
|
+
* - Failed transaction details
|
|
3281
|
+
*
|
|
3282
|
+
* @param instructionId - Bulk instruction ID
|
|
3283
|
+
* @returns Bulk payment details with transaction statuses
|
|
3284
|
+
* @throws {PiSpiNotFoundError} If bulk payment not found
|
|
3285
|
+
*
|
|
3286
|
+
* @example
|
|
3287
|
+
* ```typescript
|
|
3288
|
+
* const bulk = await sdk.paiementsEnMasse.get('SALARY-2023-03');
|
|
3289
|
+
* console.log('Status:', bulk.statut); // 'IRREVOCABLE'
|
|
3290
|
+
* console.log('Succeeded:', bulk.nombreSuccess); // 98
|
|
3291
|
+
* console.log('Failed:', bulk.nombreEchec); // 2
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
async get(instructionId) {
|
|
3295
|
+
return this.request(
|
|
3296
|
+
"GET",
|
|
3297
|
+
`/paiements-groupes/${encodeURIComponent(instructionId)}`
|
|
3298
|
+
);
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Confirm or retry a bulk payment
|
|
3302
|
+
*/
|
|
3303
|
+
async confirm(instructionId, decision = true) {
|
|
3304
|
+
return this.request(
|
|
3305
|
+
"PUT",
|
|
3306
|
+
`/paiements-groupes/${encodeURIComponent(instructionId)}/confirmations`,
|
|
3307
|
+
{ decision }
|
|
3308
|
+
);
|
|
3309
|
+
}
|
|
3310
|
+
/**
|
|
3311
|
+
* Retry failed payments in a bulk payment
|
|
3312
|
+
*
|
|
3313
|
+
* **Retry Process:**
|
|
3314
|
+
* - Only failed transactions are retried
|
|
3315
|
+
* - Successful transactions are not affected
|
|
3316
|
+
* - Uses same `instructionId`
|
|
3317
|
+
* - Can retry multiple times if needed
|
|
3318
|
+
*
|
|
3319
|
+
* @param instructionId - Bulk instruction ID
|
|
3320
|
+
* @returns Retry response with updated status
|
|
3321
|
+
* @throws {PiSpiNotFoundError} If bulk payment not found
|
|
3322
|
+
* @throws {PiSpiError} If no failed transactions to retry
|
|
3323
|
+
*
|
|
3324
|
+
* @example
|
|
3325
|
+
* ```typescript
|
|
3326
|
+
* // Retry failed transactions
|
|
3327
|
+
* await sdk.paiementsEnMasse.retry('SALARY-2023-03');
|
|
3328
|
+
* ```
|
|
3329
|
+
*/
|
|
3330
|
+
async retry(instructionId) {
|
|
3331
|
+
return this.confirm(instructionId, true);
|
|
3332
|
+
}
|
|
3333
|
+
};
|
|
3334
|
+
|
|
3335
|
+
// src/services/retours-fonds.ts
|
|
3336
|
+
var RetoursFondsService = class extends BaseService {
|
|
3337
|
+
/**
|
|
3338
|
+
* Create a fund return
|
|
3339
|
+
*
|
|
3340
|
+
* **Return Process:**
|
|
3341
|
+
* 1. Business identifies original payment transaction
|
|
3342
|
+
* 2. Creates return request (must be within 90 days)
|
|
3343
|
+
* 3. Return is processed immediately
|
|
3344
|
+
* 4. Funds are returned to original payer
|
|
3345
|
+
*
|
|
3346
|
+
* **Status Values:**
|
|
3347
|
+
* - `ENVOYE`: Return sent successfully
|
|
3348
|
+
* - `IRREVOCABLE`: Return confirmed and cannot be reversed
|
|
3349
|
+
* - `REJETE`: Return rejected (check `statutRaison` for error code)
|
|
3350
|
+
*
|
|
3351
|
+
* **Rejection Reasons:**
|
|
3352
|
+
* - `AM04`: Insufficient guarantee funds
|
|
3353
|
+
* - `AM09`: Wrong amount
|
|
3354
|
+
* - `AC06`: Blocked account
|
|
3355
|
+
* - `FR01`: Fraud suspicion
|
|
3356
|
+
* - `RR04`: Regulatory reason
|
|
3357
|
+
*
|
|
3358
|
+
* @param returnRequest - Fund return request data
|
|
3359
|
+
* @param returnRequest.comptePaye - Business account number (original payee)
|
|
3360
|
+
* @param returnRequest.txId - Original payment transaction ID
|
|
3361
|
+
* @param returnRequest.montant - Amount to return in centimes (e.g., 150000 = 1,500 XOF)
|
|
3362
|
+
* @param returnRequest.motif - Return reason code (e.g., 'CUST' for customer request)
|
|
3363
|
+
* @returns Fund return response
|
|
3364
|
+
* @throws {PiSpiValidationError} If return fails validation (e.g., > 90 days, invalid txId)
|
|
3365
|
+
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
3366
|
+
*
|
|
3367
|
+
* @example
|
|
3368
|
+
* ```typescript
|
|
3369
|
+
* // Return full payment amount
|
|
3370
|
+
* await sdk.retoursFonds.create({
|
|
3371
|
+
* comptePaye: 'CIC2344256727788288822',
|
|
3372
|
+
* txId: '23552722', // Original payment ID
|
|
3373
|
+
* montant: 150000, // 1,500 XOF
|
|
3374
|
+
* motif: 'CUST' // Customer request
|
|
3375
|
+
* });
|
|
3376
|
+
* ```
|
|
3377
|
+
*/
|
|
3378
|
+
async create(returnRequest) {
|
|
3379
|
+
const end2endId = returnRequest.end2endId ?? returnRequest.txId;
|
|
3380
|
+
if (!end2endId) {
|
|
3381
|
+
throw new Error("end2endId or txId is required for fund returns");
|
|
3382
|
+
}
|
|
3383
|
+
return this.request(
|
|
3384
|
+
"PUT",
|
|
3385
|
+
`/paiements/${encodeURIComponent(end2endId)}/retours`
|
|
3386
|
+
);
|
|
3387
|
+
}
|
|
3388
|
+
/**
|
|
3389
|
+
* Get fund return details by end-to-end ID
|
|
3390
|
+
*/
|
|
3391
|
+
async get(end2endId) {
|
|
3392
|
+
return this.request(
|
|
3393
|
+
"GET",
|
|
3394
|
+
`/paiements/${encodeURIComponent(end2endId)}/statuts`
|
|
3395
|
+
);
|
|
3396
|
+
}
|
|
3397
|
+
/**
|
|
3398
|
+
* List payments with fund return status filter
|
|
3399
|
+
*/
|
|
3400
|
+
async list(params) {
|
|
3401
|
+
return this.request("GET", "/paiements", void 0, params);
|
|
3402
|
+
}
|
|
3403
|
+
};
|
|
3404
|
+
|
|
3405
|
+
// src/services/demandes-annulation.ts
|
|
3406
|
+
var DemandesAnnulationService = class extends BaseService {
|
|
3407
|
+
/**
|
|
3408
|
+
* Create a cancellation request
|
|
3409
|
+
*
|
|
3410
|
+
* **Cancellation Process:**
|
|
3411
|
+
* 1. Business identifies payment to cancel
|
|
3412
|
+
* 2. Creates cancellation request (must be within 90 days)
|
|
3413
|
+
* 3. Payee receives cancellation request
|
|
3414
|
+
* 4. Payee accepts or rejects
|
|
3415
|
+
* 5. If accepted, funds are returned via fund return mechanism
|
|
3416
|
+
*
|
|
3417
|
+
* **Status Values:**
|
|
3418
|
+
* - `INITIE`: Cancellation request sent, awaiting payee response
|
|
3419
|
+
* - `ACCEPTE`: Payee accepted cancellation (funds returned)
|
|
3420
|
+
* - `REJETE`: Payee rejected cancellation request
|
|
3421
|
+
*
|
|
3422
|
+
* **Rejection Reasons:**
|
|
3423
|
+
* - `CUST`: Customer rejection (payee refuses cancellation)
|
|
3424
|
+
* - `AM09`: Wrong amount
|
|
3425
|
+
* - `AC06`: Blocked account
|
|
3426
|
+
* - `FR01`: Fraud suspicion
|
|
3427
|
+
*
|
|
3428
|
+
* @param request - Cancellation request data
|
|
3429
|
+
* @param request.comptePayeur - Business account number (original payer)
|
|
3430
|
+
* @param request.txId - Original payment transaction ID to cancel
|
|
3431
|
+
* @param request.motif - Cancellation reason code (e.g., 'CUST' for customer request)
|
|
3432
|
+
* @returns Cancellation request response
|
|
3433
|
+
* @throws {PiSpiValidationError} If cancellation fails validation (e.g., > 90 days, invalid txId)
|
|
3434
|
+
* @throws {PiSpiNotFoundError} If payment not found
|
|
3435
|
+
*
|
|
3436
|
+
* @example
|
|
3437
|
+
* ```typescript
|
|
3438
|
+
* // Request cancellation
|
|
3439
|
+
* await sdk.demandesAnnulation.create({
|
|
3440
|
+
* comptePayeur: 'CIC2344256727788288822',
|
|
3441
|
+
* txId: '23552722', // Payment to cancel
|
|
3442
|
+
* motif: 'CUST' // Customer request
|
|
3443
|
+
* });
|
|
3444
|
+
* ```
|
|
3445
|
+
*/
|
|
3446
|
+
async create(request2) {
|
|
3447
|
+
const end2endId = request2.end2endId ?? request2.txId;
|
|
3448
|
+
if (!end2endId) {
|
|
3449
|
+
throw new Error("end2endId or txId is required for cancellation requests");
|
|
3450
|
+
}
|
|
3451
|
+
return this.request(
|
|
3452
|
+
"POST",
|
|
3453
|
+
`/paiements/${encodeURIComponent(end2endId)}/annulations`,
|
|
3454
|
+
{ raison: request2.motif }
|
|
3455
|
+
);
|
|
3456
|
+
}
|
|
3457
|
+
/**
|
|
3458
|
+
* Get cancellation request details by end-to-end ID
|
|
3459
|
+
*/
|
|
3460
|
+
async get(end2endId) {
|
|
3461
|
+
return this.request(
|
|
3462
|
+
"GET",
|
|
3463
|
+
`/paiements/${encodeURIComponent(end2endId)}/statuts`
|
|
3464
|
+
);
|
|
3465
|
+
}
|
|
3466
|
+
/**
|
|
3467
|
+
* List payments with cancellation status filter
|
|
3468
|
+
*/
|
|
3469
|
+
async list(params) {
|
|
3470
|
+
return this.request("GET", "/paiements", void 0, params);
|
|
3471
|
+
}
|
|
3472
|
+
/**
|
|
3473
|
+
* Respond to a cancellation request (accept or reject)
|
|
3474
|
+
*/
|
|
3475
|
+
async respond(end2endId, decision) {
|
|
3476
|
+
return this.request(
|
|
3477
|
+
"PUT",
|
|
3478
|
+
`/paiements/${encodeURIComponent(end2endId)}/annulations/reponses`,
|
|
3479
|
+
{ decision }
|
|
3480
|
+
);
|
|
3481
|
+
}
|
|
3482
|
+
};
|
|
3483
|
+
|
|
3484
|
+
// src/qrcode/logo.ts
|
|
3485
|
+
var AMBER_LOGO_SEGMENTS = [
|
|
3486
|
+
"iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAMAAABlApw1AAACUlBMVEUAAAD7uQD7uQD7uQD7uQD7uQD7",
|
|
3487
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3488
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3489
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3490
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3491
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3492
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3493
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3494
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3495
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7",
|
|
3496
|
+
"uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQD7uQBqFsbfAAAAxXRSTlMAAAUpaqDF2uPq7ezn",
|
|
3497
|
+
"4djPzsvDwsC3trCdfVEdAgtJn977/vXUlUQIQK7087FHHJ7vKBmsLBqtyi8bMC3WuSs+v9EjvLM0ILW9",
|
|
3498
|
+
"zR4yxh8Xphb9shil+Ov8bzND4BUh14g3pKgmmQdL+YsO7j8PupYKVSVKaKI15cETLnpkca+n08QN5gOX",
|
|
3499
|
+
"XV5gTV9TbooU0HTdQYmOewaMIk8E6PZc0tyakN9CTPJaZcgBRngJJDs4gEhY8E5SEpwREGHi5JuU2/dw",
|
|
3500
|
+
"ofG+YwjdAcYAAAZRSURBVHja7Z37XxRVGIfnhULYFQQlNJTLriGiSSiBGGFihVwqm0BJMfOGS2aE5C2z",
|
|
3501
|
+
"q0ghGqXdyBQrIaKbUWSl2fX8X82wrCyX2Xln59zm8znfn4fZ59nznrOzh3POalqcgYTEO+5MmpNsJsXn",
|
|
3502
|
+
"nxbf3OTJpM6ZSNq89PFkzF9gJvOuLCMLF92dvXgJxMsRL35Obl5+gNBJcOk9BctygKMDFC4vWkGJfiIr",
|
|
3503
|
+
"713FTwGK7yuhiz+uULSakwGsKaWPb2bB/VwMoKycDT8hays4GDDk52LAlJ+9AcA6pvyGwQNMDaAyM8hW",
|
|
3504
|
+
"gDy4jKEBlFUxxjcybz0zA8b1H8n8REYGnPiZGXDjZ2TAkZ+FAUBlFevxJzoZD1E2gOINHPGNVNMdi7jW",
|
|
3505
|
+
"TzhUq0gAv2FA7+laCD8hGzZSMhDET8jDVAwAEh/hOf5EJ/NRCgZQkyQI30i1+54srH7CcV1FgvldGwjn",
|
|
3506
|
+
"d2fA/vsXWwNj/Nkkmt5MbZxPFQZ/nWj2cNLjGosA6rNEk0eSVe/cwOCXon7C2eTYQC5+5way8Ts1ANgo",
|
|
3507
|
+
"Gb9h4GA0BajIEM07MxnoWUejfjjMXzlPVT1OQL76j2RhGcZAXn5CyhEGMvNjDABqJOY3DNbF7skADY+J",
|
|
3508
|
+
"ZoyZYGYlxOR/nPP8lfNUxagiues/Eut+4A1+awOv8BsGT4Cn+Ulw85MwC3+D9P33dvSnZsybgtD5K+ep",
|
|
3509
|
+
"agSv1k84waYpVeQ5/mkGTviDW0q28omvGW2A5/cXPb1qWwWXVG5vsWuDHRMG8AySf+ezuwq5rQuDNWk2",
|
|
3510
|
+
"OPrucE+GnD0o/EDTXq7L2mwFCNnXCmYH2L8Swx9qe47rykKMwIHnTYGDL6AaoD2H78pIjAApfxE06NiC",
|
|
3511
|
+
"4U87xHllJ0pgRSdohagVfIGXeNY/WoAcTtCOHMUIHDvOfWktSiD1Ze2EjrhOf4V3AyAFmk9qr2Ia4Ggi",
|
|
3512
|
+
"b36kAHlNex1z2RtvyiqQrr2F8jwlq0Cy5sNc1sW9C2AF/Jofc1k7d34loASUgBJQAkpACSgBeQRqT3ff",
|
|
3513
|
+
"ztvbLGyg9Z2ebkR61lvdIOfM5A1O986lKECCkyFnrV7/3LvR11mG9FndoL5lygvRFIhOWwwBVKwFUh3D",
|
|
3514
|
+
"KAEloASUgBJQAkpACSgBJaAElIASUAJKQAkoASWgBJSAElACSkAJKAFXAsXveVygtcnbAhoklqPWcUsr",
|
|
3515
|
+
"oEHO+33n28K5gKonIQIfoLYFf4ja1SBE4CPMGkiZBXZjzjiWWeAYZiuCzAItH3tcIPSJxwWMOyA298ss",
|
|
3516
|
+
"sBaxnUJqgaW5Hhcgef22BnILfLrL4wKk1PajAC2A2gBBXeDiZ3YDEVogRYgAuWS3sQ4tcFmMABlIABoC",
|
|
3517
|
+
"yVqmIIGSDptTUnACddoVQQLk8y9iGiAFNmtfXhUkQFoGY23uwgmEhrQdX4kSIL7eVnApkL9agxPCBMjF",
|
|
3518
|
+
"K42WZYQTyOvXYK/TcYieAAnWNgyDC4GrX4MGMILZz8pGwOgIIxZnNqEE9nxj7klffEmgANGr+76drTNj",
|
|
3519
|
+
"BPzfmX8IsN/ZlKSlwPF4BAyF/KaT35/rn9YQCIHQD+EPQ4Bs1K7uSEqvdc6a3B/z4xIwEhytLj3fO5gd",
|
|
3520
|
+
"fbef7E4b1AsiT4QAPzsxaA5ZxeX51Hpgyt1suqa+aGzybBJnBlIkmt+LBlP5TYMzzp+rJeI3DJYMoTbd",
|
|
3521
|
+
"yBH98Mx5DS9V0cz331sGs/N7x8CK3ysG1vzjBtL35OYY/KbB0FbRhDb8v1yP/VV6WO4qChT8ajcdI3U/",
|
|
3522
|
+
"CBQctJ+TlNgAwy+zAY5fXgMsv2nw2wHRtDOjD+DPiYNTHdK1QaD9OppfxirC14+cBk75ZTNwzi+XQTz8",
|
|
3523
|
+
"psHgqGjycPSu+M6phIRBKdog0DUWF78sVRRf/chj4IZfBgN3/OIN3PKbBh0Cn4v0Avfn5EJ/z+/C3v8B",
|
|
3524
|
+
"J88/1m3Q6XxJMx1+1/Uj1oAWvygDevxiDGjyj/8fjfOMF11+c76o+wZX/pt28z9yVxHt95+3AQt+ngZs",
|
|
3525
|
+
"+PkZsOIfN0j2Mr9p0M18NG2+yY7fHE0drquI4/2nPX5ObwO2/YBl/fAwYM/P1iDwB3t+0+DaLTb8f57l",
|
|
3526
|
+
"c8g+wPb0AAP+lBFev3ID0PjXTtq/XT/695EETvymwnBNX9I/9OhDl/ctb+WHH26FsdwL/95K8fld50Zd",
|
|
3527
|
+
"03+H7Ld0WOR/rIwlUtPE/X8AAAAASUVORK5CYII="
|
|
3528
|
+
];
|
|
3529
|
+
var OCTO_QRCODE_LOGO_SEGMENTS = [
|
|
3530
|
+
"iVBORw0KGgoAAAANSUhEUgAAAPYAAAD6CAYAAACS0LqzAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAA",
|
|
3531
|
+
"AAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA9qADAAQAAAABAAAA+gAA",
|
|
3532
|
+
"AAA4bIViAAAVTklEQVR4Ae2dW2xcx3nHZ5bcpVYXmEEkBPYDuXmI5ASoJVVGEyCwRD4YsFE5lquXpK0Q",
|
|
3533
|
+
"CYUvDwYiG0iARkEkAbGLGkVsoyrgSwNLdYq4LRQ7qQEH9YNoGQGSoJIYP0ixXrr0g51ADkJDIpdcUns6",
|
|
3534
|
+
"H9cUd8nl7jln5/LNzH8AWrvnMueb3zc/z+w5Z89KgZKaQFKrVRbEzTE5UNjZaIiKFGLXqp0rq94zeptM",
|
|
3535
|
+
"CyHVn/ZS1VVjIsS0lCsxSplM31xsTA3IgcliuTyh6zgx1KP6Jko3AkmSDM/XZg4XCoUH1XZj3bbFOuME",
|
|
3536
|
+
"JkTSOFPcsOmN1v8BGD+qhweA2OskjYRerM99K0kaR9VIN7zOZljshkBVyGSi2CiclOVy1U0IvI8KsTvk",
|
|
3537
|
+
"Z3F+5kAjEa9A6A5weC2qNoR4fsOGjc/xCst9NBC7JQc0Si/UZ58ViTzcshgv+ROYKCbyCEbvlURB7E9Z",
|
|
3538
|
+
"1NSJsYFC8rpI1pwQW6GFV5wJVEVh8KFSqTTJOUhbsUFsRXpJapmcUy8rtsDjOAYISDEt5OA45FYfIg3g",
|
|
3539
|
+
"9apKSO1VunoHC7mXGEUtNqTu7YmXW0DueEdsSO2lsumDjlzuKEdsSJ3eD6+3jFju6MSG1F6rmif4qroU",
|
|
3540
|
+
"Nh7bpbCoxF66Tj1fu6R6RyVPD8E+3hKITu6Ct6nKGHjz5pMaLmll5BbI5pUFdTmTvsQTSHt6NiOKEfuW",
|
|
3541
|
+
"1Lj5pGeHCHyDaEbu4MWG1IGrmr15UcgdtNiQOnuvj2SP4OUOVmxIHYmi+ZsZtNxBig2p8/f2yPYMVu7g",
|
|
3542
|
+
"xIbUkanZf3ODlDs4sevzs5fw1cv+e3tkNQQnd1DXsevzM69A6siU1NPc4K5zBzNiN6XGk0/09PNoawlm",
|
|
3543
|
+
"5A5CbEgdrYgmGl4tDpV3+/4UVO+n4pDaRN+Ous7KQr12jk7C+kzB6xEbUvvc9ZjHLsVksVQe93Xk9lZs",
|
|
3544
|
+
"blLPXJ8WVy68u/R37fdTYurqe0s9d/b6J4LWcSnb7hjVHsq227PXue32ETGyfaeobL9LfHHPPdpj0lKh",
|
|
3545
|
+
"x3J7KTYnqa9cOC/eeu1floTmJLCWjm2pkk1bhsWefQ+Ig498V+T5n4TRMD2V2zuxF+Zmn02EOGo0mSkq",
|
|
3546
|
+
"v/bRlHjx5KPishIbRR+BvfsP8RPcQ7m9EnthvnZcndQ4oa8b5avprddOiZ++9DSrKXa+lvDd6+Ajx8TB",
|
|
3547
|
+
"h4/xCdAzub0Rm4vUZ19+Spx96Sk+HS7gSO4ee0A8+v0XBU3VWRSZnC4NbTrCIpYeQXghNqTukcWAV4+q",
|
|
3548
|
+
"k2vfe+EXkDtjjtmLDakzZjTAzSF39qSyFhtSZ09oqHtA7myZZSs2pM6WyBi2htzps8xSbEidPoGxbQm5",
|
|
3549
|
+
"02Wc3b3ikDpd4mLdiu7o+8Fj9/G51Kh+S72u7q3glg9WYkNqbt2DZzzs5FY3TFHf5USLzVQcUnPqFn7E",
|
|
3550
|
+
"wm1arr4wckJ95fMkB3osxIbUHLqCnzFA7s55cy42pO6cGCxNTwByr2XlVGxIvTYhWJKPAORu5+ZMbEjd",
|
|
3551
|
+
"ngi8658A5F5h6ERsSL2SALzSSwByN3laF7s+N/ctIRrP6U1n9trwLa3szHzZA3ILYVXsxXr9m43G4mnX",
|
|
3552
|
+
"HQRSu86A+ePHLrc1sSG1+c6MI7QTiFluK2JD6vYOh3f2CMQqt3GxIbW9TowjdSZAcv/Dv/+q80oHS23c",
|
|
3553
|
+
"oWb0XnEuUr/6w+/gcUYOOjCXQ9K95fTgSS6FnttHbpiMx9iIzUXqF1RCz7/5qkmGqNsTAvvUE1AfPf4i",
|
|
3554
|
+
"m2gLhcHDg6XSGRMBGREbUptIFerUQSAWubWLvVCrjSUyOacjCf3UgZG6H3ph7xuD3Fo/Y9dv3NiVyMbr",
|
|
3555
|
+
"rrsFpHadAd7Hf0d9NOP0mZvu7dD9mVvbiE1Si0GpRmrp9CHQkJq3VJyiC3nk1iI2pObUXRFLFgLc5JaJ",
|
|
3556
|
+
"HC+WyxNZ2tBp276n4pC6E1Ys84UAt2l5Ukher9fru/rl19eIDan7xY/9uRBgNXJLMS3k4HipVJrMyye3",
|
|
3557
|
+
"2JA6L3Lsx5VASHLnEhtSc+2aiKtfAqHInVnsWq1WGZCNSzj73W8Xwv5cCYQgd6aTZ02p6eYTXNLi2ikR",
|
|
3558
|
+
"V/8EWJ1QS8SwSBbPZT2hlnrEXpFaVPpHl78GXKfOzw57ZiPAauQWolpUl8JkuVxN04pUYkPqNCixTYgE",
|
|
3559
|
+
"fJW7p9iQOsTuijZlIeCj3F3FhtRZ0o9tQybgm9zrig2pQ+6maFseAj7J3VFsSJ0n7dgnBgK+yL1GbEgd",
|
|
3560
|
+
"Q/dEG/shwE7uofJu9Ry16dY2rbmOXZCNZ9UGldaNbL/GJS3bxHG8LARYXedWri7UZ8nZttImNv1KhxTy",
|
|
3561
|
+
"QNsWlt9AasvAcbhcBFjJncjDi/Mzbd7emopzmIJD6lx9DDs5JMBmWq6+EVYslT+/PCW/NWIPFBrHFZ+K",
|
|
3562
|
+
"K0aQ2hV5HLcfAmxGbnXraX1u9uhyW5ZG7E9H6/9bXmj7X0htmziOp5sAi5G7ZdReGrEHxM0x3Q1NWx+k",
|
|
3563
|
+
"TksK23EmwGLkVqP2/HztMHFqTsVlgabh1gukto4cBzRIgIPcSugHqYnS1TQcUhvsYajaKQHX0/LiUPkz",
|
|
3564
|
+
"BRfTcEjttN/h4IYJuB65F+ZmDhREQe4z3M626iF1Gw68CZSAU7ml2DUokkJFiMQKXl+k3rhBiK/uFGLk",
|
|
3565
|
+
"c0LcOSJEWb2nZSj+EPjle0L86Odu4yW5qdj+IcBGQ1YGldSVpaMb/s/Zl59i/6uXW4fVmYe9QuzeDpEN",
|
|
3566
|
+
"d4doqie5t94xIg4+fMxamwsFuVOJbf6mFJL67EtPWWtYngPd+2Ul9T0QOg877NOdAPX9jVtuE/d//fHu",
|
|
3567
|
+
"G+pbW7l155m+OttruvbRFHupaZT+xr2Quj1zeKeTAMlNLtgqxsXm9KuGnaCS1PSHAgImCcxe/8TqL3wa",
|
|
3568
|
+
"FfvKhfPisvrjWugEGaTmmp3w4iIXLl9410rDjIp99uWnrTQiz0GWTpSpz9QoIGCTwFuvnbJyOGNi0+cJ",
|
|
3569
|
+
"zqM1jdQkNwoI2CRAs9iZ69PGD2lM7CuWphx5CNE1abqkhQICtgnQZ+0LE28aP6wxsf934r+NB5/3ALt3",
|
|
3570
|
+
"4Ax4XnbYr38CU1fV3TOGizGxP/7oA8Oh56/+ztH8+2JPEOiXwOWL5k+gGRPb5jW7rKC33pZ1D2wPAvoI",
|
|
3571
|
+
"zPr8GdvGCYK8qCF2XnLYTwcBG4OesRFbBwDUAQIgkI8AxM7HDXuBAGsCEJt1ehAcCOQjALHzccNeIMCa",
|
|
3572
|
+
"AMRmnR4EBwL5CEDsfNywFwiwJgCxWacHwYFAPgIQOx837AUCrAlAbNbpQXAgkI8AxM7HDXuBAGsCEJt1",
|
|
3573
|
+
"ehAcCOQjALHzccNeIMCaAMRmnR4EBwL5CNBzxaMrF69mf9DCZ9VXPW19j/vS+0LMzvNOy44Re4+Wol/1",
|
|
3574
|
+
"yFp+Z+9Jv1lDs7J9lGL/5H+ys/3qXfbEfvs3QnDvmH/3NXtiu/6pnuy9xf0emIq7zwEiAAHtBCC2dqSo",
|
|
3575
|
+
"EATcE4DY7nOACEBAOwGIrR0pKgQB9wQgtvscIAIQ0E4AYmtHigpBwD0BiO0+B4gABLQTgNjakaJCEHBP",
|
|
3576
|
+
"AGK7zwEiAAHtBCC2dqSoEATcE4DY7nOACEBAOwGIrR0pKgQB9wQgtvscIAIQ0E4AYmtHigpBwD0BiO0+",
|
|
3577
|
+
"B4gABLQTgNjakaJCEHBPAGK7zwEiAAHtBCC2dqSoEATcE4DY7nOACEBAOwGIrR0pKgQB9wQgtvscIAIQ",
|
|
3578
|
+
"0E4AYmtHigpBwD0BiO0+B4gABLQTgNjakaJCEHBPAGK7zwEiAAHtBCC2dqSoEATcE4DY7nOACEBAOwGI",
|
|
3579
|
+
"rR0pKgQB9wQgtvscIAIQ0E4AYmtHigpBwD0BiO0+B4gABLQTgNjakaJCEHBPAGK7zwEiAAHtBCC2dqSo",
|
|
3580
|
+
"EATcE4DY7nOACEBAOwGIrR0pKgQB9wQgtvscIAIQ0E4AYmtHigpBwD0BiO0+B4gABLQTgNjakaJCEHBP",
|
|
3581
|
+
"AGK7zwEiAAHtBCC2dqSoEATcE4DY7nOACEBAOwGIrR0pKgQB9wQgtvscIIIeBDZu6LEBVq8hALHXIMECbgQe3MstIv7xDPIPERHG",
|
|
3582
|
+
"TuDev2gSePs3Qnw8HTuNdO2H2Ok4YSvHBEhu+nt/Kl0gs3NC/PN/pds2xK0gdohZDbhNO0bTNS72kR2f",
|
|
3583
|
+
"sdP1E2y1ikDs4qzCwe4txGaXEj8Cgti88wSxeeeHbXR//IRtaAhMEYDY6Aa5CHzwh1y7YSdLBCC2JdCh",
|
|
3584
|
+
"HYbOOv8Rl57YphVis00N/8AuXuUfY6wRQuxYM6+h3Zfe11AJqjBCAGIbwRpHpb9TN4vQlByFHwGIzS8n",
|
|
3585
|
+
"XkVEt3mi8CMAsfnlxKuISGyM2vxSBrH55cSriEhqjNr8Ugax+eXEu4gwavNLGcTmlxPvIqJR+2fvehd2",
|
|
3586
|
+
"0AEbE3vTluGgwaFx7QTe/rUQdJYchQcBY2Jv3HIbjxYiCmsETqnvP+PLIb1xb7s95XdPe1e17hbGxB79",
|
|
3587
|
+
"wl3rHhQrwiRAU/Jnfoyz5L2yu+0Oj8X+4p57erUP6wMkQCM25O6eWBuDnrER+0sQu3t2A177we8hd7f0",
|
|
3588
|
+
"3mnBDWNij27fKb60B4+X7JbgkNeR3Cf+FZ+5O+XYxqBnTGxq0J59+zu1C8siIbA8Lce3wFYSvnf/3wob",
|
|
3589
|
+
"V4yMir1v/yFh40TBCja84kaA5D71n0L85G2M3pSbg48cs5IiJXZi7OvydMnr0BPPWGkIDsKbAF3nppNq",
|
|
3590
|
+
"v3yPd5wmo6PR2salLmqDElsaE5sOcPfYA0t/9BolbgI0ev/o50J851RTcHofSyGhbY3Wiml1UEoxmSSi",
|
|
3591
|
+
"YhLwY99/Sfz91a+Iax/i1iSTnH2pe1lwivfPdwixW/3tGBFi67AvLcge56En/9HaaK2iqw7evCneKRTE",
|
|
3592
|
+
"geyhpt+DpuTfe+EX4geP3eet3B+rp3LamkbG9DXIi+opLPRHhcQe+ZwQn1X/blU3LvbzY3ycGB58+Jia",
|
|
3593
|
+
"tX6t2Ugr/238Vi7UamOJTM7ZON61j6a8ltsGIxwjLAIktcUpeBNeIo9IelWfm/mT+qxtZSIEucPquGjN",
|
|
3594
|
+
"+gScSK3CKSby883LXY3kzPrh6V1DJxFoWo7LYHq5ojZeBFxJra5yTcpyuboktpQDb9jEArlt0saxbBNw",
|
|
3595
|
+
"J7VqaVJ4ntq7JHaxXJ5QU3H1Z69AbnuscSR7BJxKrZpZFGKCWtuciqsXMhEnaYHNArlt0saxTBNwLbWQ",
|
|
3596
|
+
"8jRNw6mdt8SmUTsRwuqUnAKA3EQBxXcCzqVW166LjZXB+ZbYBLY0NH9E/VOl1zYL5LZJG8fSTYCB1Oqz",
|
|
3597
|
+
"tTy5PFpT+9rElvIz01JdA9Pd8DT1Qe40lLANNwIspFZT8FK5fLqVTZvYtKJ5Ik080bqRrdeQ2xZpHEcH",
|
|
3598
|
+
"ARZSr5qCL7drjdi0orRh43NJklg/mUbHhtxEAYU7ATZSJ3K8dQq+zE0uv+j073xt5oSU8nindaaX4Q41",
|
|
3599
|
+
"04RRf14C3KWmdnUVmzaA3EQBBQSaBHyQmiLtKTZtBLmJAkrsBHyRmvKUSmzaEHITBZRYCfCQOpkuJoXd",
|
|
3600
|
+
"nT5Tr85Lx5Nnqzei90PlTSdwQq0TGSwLnQAXqcVi0vFEWSf+qUfs5Z0xci+TwL8xEOAkdWnz5sm0zDOL",
|
|
3601
|
+
"TRVD7rR4sZ3PBHyVmpjnEpt2hNxEASVUAj5LTTnJLTbtDLmJAkrsBHyRmvKUSmzaEHITBZRYCfCQOpkuJoXd",
|
|
3602
|
+
"AMXmnJLTbtDLmJAkpoBHyXmvLRl9hUwXztxmkpC9+k17YLr3LaJmz8e",
|
|
3603
|
+
"pG4ytvoZe3Va6TP3TfUTJWp5dfU6G+9xQs0GZXvHgNQrrJ2O2Mth1Gq1yoBM1B1qGLmXmeDfbAQgdTsv",
|
|
3604
|
+
"FmJTSJC7PTF4l54ApF7Lio3YFBrkXpsgLOlOAFJ35sNKbAoRcndOFJauJQCp1zJZXsJObAoMci+nB/+u",
|
|
3605
|
+
"RwBSr0emuZyl2BQa5O6euJjXQure2WcrNoUOuXsnMLYtIHW6jLMWm5oAudMlMoatDj35jLj/G487byrd",
|
|
3606
|
+
"++3iNtEsDWcvNjUGcmdJaZjbPnb8RbF3/yHnjfNBaoLkhdgUKOQmCnEWSJ09796ITU2D3NkT7PsekDpf",
|
|
3607
|
+
"Bl0Sm5roWu7Z65+If/vht8X5N3+cjzj2SkWA7uN/8p/+Q4xuvyvV9iY38mX63crAO7EpeNdyUwzvvPmq",
|
|
3608
|
+
"+OnLT4trH07RWxSNBO7/+uPirx75rti0ZVhjrfmq8lFqaqmXYlPgHOSmOCA4Uei/kMR7//JvxH1//big",
|
|
3609
|
+
"0ZpDod+io5+t4hBL1hi8FZsaWr9xY5cYlPTccuf/a5+6+p64fOG8uHLxXfHxhx8I+q73zPXprPmIZvtt",
|
|
3610
|
+
"d4wuCTz6hT8Td489IEbUlJvDCL2cAJ+lpjZ4LTY1gJPcFA+K/wR8l5oy4L3Y1AjITRRQdBAIQWriEITY",
|
|
3611
|
+
"1BDITRRQ+iEQitTEIBixqTGQmyig5CEQktTU/qDEpgZBbqKAkoVAaFJT24MTmxoFuYkCShoCIUpN7Q5S",
|
|
3612
|
+
"bGoY5CYKKN0IhCo1tTlYsalx9VrtsJDJK/QaBQTaCEgxWSyVx6WUQd5sELTYlEjI3dad8YYIBC51s4kR",
|
|
3613
|
+
"pBpyR5DktE2MQOpoxKaGQu60PT/g7SKRmjIY/FS8tZtC7lYakb2OSGrKbFRiU4MhN1GIrEQmNWU3OrGp",
|
|
3614
|
+
"0ZCbKERSIpSaMhul2NRwyE0UAi+RSk1Zdfozui67ValcPk1Px3AZA45tkEDEUhPVaMWmxtOzoSE3kQiu",
|
|
3615
|
+
"VIsN+VCoN5+kyVa0U/FWOPO1mROqExxvXYbX3hKoFhM5Lsvlqrct0BA4xP4UYn1u9qh6+awGpqjCFYHI",
|
|
3616
|
+
"p9+t2KOeireCKG3Y+JxYbOxWy6qty/HaFwKN50O+9ztrFiB2C7HS5s2TN9U0Tn3uPtOyGC9ZE0imC3Lg",
|
|
3617
|
+
"odKGzUdj/ky9OkWYiq8m8un7hVptLJENNTWXu9bZBIudEkimk0Q8TzMtCL02ERB7LZO2JSR4QzQOSyke",
|
|
3618
|
+
"VJIPt63EGxcEJtSM6h0I3R09xO7Op21tcxRPDijBdwrRIMkrkL0Nke43VSGSaSELk42byW+HpHwj9rPd",
|
|
3619
|
+
"aQH/P0RzGOBNa7tyAAAAAElFTkSuQmCC"
|
|
3620
|
+
];
|
|
3621
|
+
var PISPI_AMBER_LOGO_DATA_URL = `data:image/png;base64,${AMBER_LOGO_SEGMENTS.join("")}`;
|
|
3622
|
+
var PISPI_QRCODE_LOGO_DATA_URL = `data:image/png;base64,${OCTO_QRCODE_LOGO_SEGMENTS.join("")}`;
|
|
3623
|
+
var DEFAULT_PISPI_LOGO_DATA_URL = PISPI_QRCODE_LOGO_DATA_URL;
|
|
3624
|
+
|
|
3625
|
+
// src/qrcode/index.ts
|
|
3626
|
+
var cachedQrCodeModule = null;
|
|
3627
|
+
function resolveQrCodeModule(module2) {
|
|
3628
|
+
if (module2?.create) {
|
|
3629
|
+
return module2;
|
|
3630
|
+
}
|
|
3631
|
+
if (module2?.default?.create) {
|
|
3632
|
+
return module2.default;
|
|
3633
|
+
}
|
|
3634
|
+
throw new Error(`Le module "qrcode" n'expose pas l'API attendue.`);
|
|
3635
|
+
}
|
|
3636
|
+
async function getQrCodeModule() {
|
|
3637
|
+
if (cachedQrCodeModule) {
|
|
3638
|
+
return cachedQrCodeModule;
|
|
3639
|
+
}
|
|
3640
|
+
if (typeof window !== "undefined" && window.QRCode) {
|
|
3641
|
+
const resolved2 = resolveQrCodeModule(window.QRCode);
|
|
3642
|
+
cachedQrCodeModule = resolved2;
|
|
3643
|
+
return resolved2;
|
|
3644
|
+
}
|
|
3645
|
+
const module2 = await import("qrcode");
|
|
3646
|
+
const resolved = resolveQrCodeModule(module2);
|
|
3647
|
+
cachedQrCodeModule = resolved;
|
|
3648
|
+
return resolved;
|
|
3649
|
+
}
|
|
3650
|
+
var DEFAULT_MERCHANT_CATEGORY_CODE = "0000";
|
|
3651
|
+
var DEFAULT_CURRENCY = "952";
|
|
3652
|
+
var DEFAULT_MERCHANT_NAME = "X";
|
|
3653
|
+
var DEFAULT_MERCHANT_CITY = "X";
|
|
3654
|
+
var DEFAULT_REFERENCE_LABEL_TAG = "05";
|
|
3655
|
+
var DEFAULT_MERCHANT_CHANNEL_TAG = "11";
|
|
3656
|
+
var DEFAULT_LOGO_SIZE_RATIO = 0.18;
|
|
3657
|
+
var DEFAULT_LOGO_PADDING_RATIO = 0;
|
|
3658
|
+
var DEFAULT_LOGO_BORDER_RADIUS_RATIO = 0.5;
|
|
3659
|
+
var DEFAULT_MARGIN = 0;
|
|
3660
|
+
var DEFAULT_SVG_SIZE = 400;
|
|
3661
|
+
var DEFAULT_DOT_COLOR = "#1A1A1A";
|
|
3662
|
+
var DEFAULT_BACKGROUND_COLOR = "#FFFFFF";
|
|
3663
|
+
var DOT_RADIUS_RATIO = 0.44;
|
|
3664
|
+
var FINDER_CORNER_RADIUS = 0.8;
|
|
3665
|
+
function createQrPayload(input, options = {}) {
|
|
3666
|
+
const {
|
|
3667
|
+
alias,
|
|
3668
|
+
amount,
|
|
3669
|
+
countryCode,
|
|
3670
|
+
qrType,
|
|
3671
|
+
referenceLabel
|
|
3672
|
+
} = input;
|
|
3673
|
+
if (!alias) {
|
|
3674
|
+
throw new Error('Le param\xE8tre "alias" est obligatoire.');
|
|
3675
|
+
}
|
|
3676
|
+
validateAlias(alias);
|
|
3677
|
+
if (!countryCode) {
|
|
3678
|
+
throw new Error('Le param\xE8tre "countryCode" est obligatoire.');
|
|
3679
|
+
}
|
|
3680
|
+
validateCountryCode(countryCode);
|
|
3681
|
+
if (!qrType) {
|
|
3682
|
+
throw new Error('Le param\xE8tre "qrType" est obligatoire.');
|
|
3683
|
+
}
|
|
3684
|
+
if (!referenceLabel) {
|
|
3685
|
+
throw new Error('Le param\xE8tre "referenceLabel" est obligatoire.');
|
|
3686
|
+
}
|
|
3687
|
+
validateReferenceLabel(referenceLabel);
|
|
3688
|
+
if (amount !== void 0 && amount !== null && amount !== "") {
|
|
3689
|
+
validateAmount(amount);
|
|
3690
|
+
}
|
|
3691
|
+
const payloadSegments = [];
|
|
3692
|
+
payloadSegments.push(formatDataObject("00", "01"));
|
|
3693
|
+
const merchantAccountInformation = [
|
|
3694
|
+
formatDataObject("00", "int.bceao.pi"),
|
|
3695
|
+
formatDataObject("01", alias)
|
|
3696
|
+
].join("");
|
|
3697
|
+
payloadSegments.push(
|
|
3698
|
+
formatDataObject("36", merchantAccountInformation),
|
|
3699
|
+
formatDataObject("52", DEFAULT_MERCHANT_CATEGORY_CODE),
|
|
3700
|
+
formatDataObject("53", DEFAULT_CURRENCY)
|
|
3701
|
+
);
|
|
3702
|
+
if (amount !== void 0 && amount !== null && amount !== "") {
|
|
3703
|
+
payloadSegments.push(
|
|
3704
|
+
formatDataObject("54", sanitizeAmount(amount))
|
|
3705
|
+
);
|
|
3706
|
+
}
|
|
3707
|
+
payloadSegments.push(
|
|
3708
|
+
formatDataObject("58", countryCode),
|
|
3709
|
+
formatDataObject("59", DEFAULT_MERCHANT_NAME),
|
|
3710
|
+
formatDataObject("60", DEFAULT_MERCHANT_CITY)
|
|
3711
|
+
);
|
|
3712
|
+
const normalizedQrType = normalizeQrType(qrType);
|
|
3713
|
+
const additionalData = buildAdditionalData(
|
|
3714
|
+
normalizedQrType,
|
|
3715
|
+
referenceLabel,
|
|
3716
|
+
options.additionalData
|
|
3717
|
+
);
|
|
3718
|
+
if (additionalData) {
|
|
3719
|
+
payloadSegments.push(formatDataObject("62", additionalData));
|
|
3720
|
+
}
|
|
3721
|
+
const payloadWithoutCrc = payloadSegments.join("");
|
|
3722
|
+
const crcInput = `${payloadWithoutCrc}6304`;
|
|
3723
|
+
const crc = computeCrc16(crcInput);
|
|
3724
|
+
return { payload: `${payloadWithoutCrc}6304${crc}` };
|
|
3725
|
+
}
|
|
3726
|
+
function buildAdditionalData(qrType, referenceLabel, overrides) {
|
|
3727
|
+
const segments = [];
|
|
3728
|
+
const referenceLabelTag = formatDataObject(
|
|
3729
|
+
DEFAULT_REFERENCE_LABEL_TAG,
|
|
3730
|
+
referenceLabel
|
|
3731
|
+
);
|
|
3732
|
+
segments.push(referenceLabelTag);
|
|
3733
|
+
const merchantChannelValue = mapMerchantChannelFromType(qrType);
|
|
3734
|
+
segments.push(
|
|
3735
|
+
formatDataObject(DEFAULT_MERCHANT_CHANNEL_TAG, merchantChannelValue)
|
|
3736
|
+
);
|
|
3737
|
+
if (overrides?.purposeOfTransaction) {
|
|
3738
|
+
segments.push(formatDataObject("12", overrides.purposeOfTransaction));
|
|
3739
|
+
}
|
|
3740
|
+
if (overrides?.custom) {
|
|
3741
|
+
const entries = Object.entries(overrides.custom).sort(
|
|
3742
|
+
([a], [b]) => a.localeCompare(b)
|
|
3743
|
+
);
|
|
3744
|
+
for (const [tag, value] of entries) {
|
|
3745
|
+
validateSubTag(tag);
|
|
3746
|
+
segments.push(formatDataObject(tag, value));
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
return segments.join("");
|
|
3750
|
+
}
|
|
3751
|
+
function mapMerchantChannelFromType(value) {
|
|
3752
|
+
return value === "DYNAMIC" ? "400" : "000";
|
|
3753
|
+
}
|
|
3754
|
+
function mapQrTypeFromChannel(channel) {
|
|
3755
|
+
const normalized = channel?.trim().toUpperCase();
|
|
3756
|
+
if (normalized === "400") {
|
|
3757
|
+
return "DYNAMIC";
|
|
3758
|
+
}
|
|
3759
|
+
return "STATIC";
|
|
3760
|
+
}
|
|
3761
|
+
function formatDataObject(id, value) {
|
|
3762
|
+
const length = value.length.toString().padStart(2, "0");
|
|
3763
|
+
return `${id}${length}${value}`;
|
|
3764
|
+
}
|
|
3765
|
+
function sanitizeAmount(value) {
|
|
3766
|
+
return typeof value === "number" ? value.toString() : value.trim();
|
|
3767
|
+
}
|
|
3768
|
+
function validateSubTag(tag) {
|
|
3769
|
+
if (!/^[0-9A-Za-z]{2}$/.test(tag)) {
|
|
3770
|
+
throw new Error(
|
|
3771
|
+
`Le sous-tag additional data "${tag}" doit contenir exactement 2 caract\xE8res alphanum\xE9riques.`
|
|
3772
|
+
);
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
function validateAlias(alias) {
|
|
3776
|
+
const uuidV4Regex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
3777
|
+
if (!uuidV4Regex.test(alias)) {
|
|
3778
|
+
throw new Error("L'alias doit \xEAtre un UUID v4 valide.");
|
|
3779
|
+
}
|
|
3780
|
+
}
|
|
3781
|
+
function validateReferenceLabel(reference) {
|
|
3782
|
+
if (reference.length > 25) {
|
|
3783
|
+
throw new Error("Le referenceLabel ne doit pas d\xE9passer 25 caract\xE8res.");
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
function normalizeQrType(type) {
|
|
3787
|
+
const normalized = type.trim().toUpperCase();
|
|
3788
|
+
if (normalized === "STATIC" || normalized === "DYNAMIC") {
|
|
3789
|
+
return normalized;
|
|
3790
|
+
}
|
|
3791
|
+
throw new Error('Le param\xE8tre "qrType" doit \xEAtre "STATIC" ou "DYNAMIC".');
|
|
3792
|
+
}
|
|
3793
|
+
var UEMOA_COUNTRIES = /* @__PURE__ */ new Set(["BJ", "BF", "CI", "ML", "NE", "SN", "TG", "GW"]);
|
|
3794
|
+
function validateCountryCode(code) {
|
|
3795
|
+
if (!UEMOA_COUNTRIES.has(code.toUpperCase())) {
|
|
3796
|
+
throw new Error("Le countryCode doit \xEAtre l'un des codes ISO2 de l'UEMOA (BJ, BF, CI, ML, NE, SN, TG, GW).");
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
function validateAmount(amount) {
|
|
3800
|
+
const normalized = typeof amount === "number" ? amount.toString() : amount.trim();
|
|
3801
|
+
if (!/^\d+$/.test(normalized)) {
|
|
3802
|
+
throw new Error("Le montant doit contenir uniquement des chiffres.");
|
|
3803
|
+
}
|
|
3804
|
+
if (normalized.length > 13) {
|
|
3805
|
+
throw new Error("Le montant ne doit pas d\xE9passer 13 chiffres.");
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
function computeCrc16(input) {
|
|
3809
|
+
let crc = 65535;
|
|
3810
|
+
const polynomial = 4129;
|
|
3811
|
+
for (let i = 0; i < input.length; i += 1) {
|
|
3812
|
+
crc ^= (input.codePointAt(i) ?? 0) << 8;
|
|
3813
|
+
for (let j = 0; j < 8; j += 1) {
|
|
3814
|
+
const hasHighBit = (crc & 32768) === 0;
|
|
3815
|
+
crc = hasHighBit ? crc << 1 : crc << 1 ^ polynomial;
|
|
3816
|
+
crc &= 65535;
|
|
3817
|
+
}
|
|
3818
|
+
}
|
|
3819
|
+
return crc.toString(16).toUpperCase().padStart(4, "0");
|
|
3820
|
+
}
|
|
3821
|
+
function buildPayloadString(params, options) {
|
|
3822
|
+
return createQrPayload(params, options).payload;
|
|
3823
|
+
}
|
|
3824
|
+
async function generateQrCodeSvg(input, options = {}) {
|
|
3825
|
+
const { payload } = createQrPayload(input);
|
|
3826
|
+
const size = options.size ?? DEFAULT_SVG_SIZE;
|
|
3827
|
+
const margin = options.margin ?? DEFAULT_MARGIN;
|
|
3828
|
+
const module2 = await getQrCodeModule();
|
|
3829
|
+
const qr = module2.create(payload, {
|
|
3830
|
+
errorCorrectionLevel: "M"
|
|
3831
|
+
});
|
|
3832
|
+
const dotColor = options.dotColor ?? DEFAULT_DOT_COLOR;
|
|
3833
|
+
const backgroundColor = options.backgroundColor ?? DEFAULT_BACKGROUND_COLOR;
|
|
3834
|
+
return buildDotPatternSvg(qr, {
|
|
3835
|
+
size,
|
|
3836
|
+
margin,
|
|
3837
|
+
dotColor,
|
|
3838
|
+
backgroundColor,
|
|
3839
|
+
logo: {
|
|
3840
|
+
dataUrl: options.logoDataUrl ?? DEFAULT_PISPI_LOGO_DATA_URL,
|
|
3841
|
+
sizeRatio: options.logoSizeRatio ?? DEFAULT_LOGO_SIZE_RATIO,
|
|
3842
|
+
paddingRatio: options.logoPaddingRatio ?? DEFAULT_LOGO_PADDING_RATIO,
|
|
3843
|
+
borderRadiusRatio: options.logoBorderRadiusRatio ?? DEFAULT_LOGO_BORDER_RADIUS_RATIO,
|
|
3844
|
+
backgroundColor: options.logoBackgroundColor ?? DEFAULT_BACKGROUND_COLOR
|
|
3845
|
+
}
|
|
3846
|
+
});
|
|
3847
|
+
}
|
|
3848
|
+
function clamp(value, min, max) {
|
|
3849
|
+
return Math.min(Math.max(value, min), max);
|
|
3850
|
+
}
|
|
3851
|
+
function formatSvgNumber(value) {
|
|
3852
|
+
const normalized = Number.parseFloat(value.toFixed(3));
|
|
3853
|
+
if (Number.isNaN(normalized)) {
|
|
3854
|
+
return "0";
|
|
3855
|
+
}
|
|
3856
|
+
return normalized.toString();
|
|
3857
|
+
}
|
|
3858
|
+
var QRCode = {
|
|
3859
|
+
// Original methods
|
|
3860
|
+
createQrPayload,
|
|
3861
|
+
buildPayloadString,
|
|
3862
|
+
computeCrc16,
|
|
3863
|
+
generateQrCodeSvg,
|
|
3864
|
+
isValidPispiQrPayload,
|
|
3865
|
+
// Simplified aliases
|
|
3866
|
+
payload: buildPayloadString,
|
|
3867
|
+
svg: generateQrCodeSvg,
|
|
3868
|
+
validate: isValidPispiQrPayload,
|
|
3869
|
+
raw: createQrPayload
|
|
3870
|
+
// For when you need the object wrapper
|
|
3871
|
+
};
|
|
3872
|
+
function isValidPispiQrPayload(value) {
|
|
3873
|
+
const basicErrors = validatePayloadBasics(value);
|
|
3874
|
+
if (basicErrors.length > 0) {
|
|
3875
|
+
return { valid: false, errors: basicErrors };
|
|
3876
|
+
}
|
|
3877
|
+
const { segments, errors: parseErrors } = parseEmvSegments(value);
|
|
3878
|
+
if (parseErrors.length > 0) {
|
|
3879
|
+
return { valid: false, errors: parseErrors };
|
|
3880
|
+
}
|
|
3881
|
+
const segmentValidation = validateSegmentContent(segments, value);
|
|
3882
|
+
if (segmentValidation.errors.length > 0) {
|
|
3883
|
+
return { valid: false, errors: segmentValidation.errors };
|
|
3884
|
+
}
|
|
3885
|
+
const data = buildValidationData(segments, segmentValidation);
|
|
3886
|
+
return {
|
|
3887
|
+
valid: true,
|
|
3888
|
+
errors: [],
|
|
3889
|
+
data
|
|
3890
|
+
};
|
|
3891
|
+
}
|
|
3892
|
+
function validatePayloadBasics(value) {
|
|
3893
|
+
if (!value) {
|
|
3894
|
+
return ["La payload doit \xEAtre une cha\xEEne non vide."];
|
|
3895
|
+
}
|
|
3896
|
+
if (value.length < 12) {
|
|
3897
|
+
return ["Payload trop courte pour contenir des segments EMV."];
|
|
3898
|
+
}
|
|
3899
|
+
return [];
|
|
3900
|
+
}
|
|
3901
|
+
function parseEmvSegments(value) {
|
|
3902
|
+
const segments = {};
|
|
3903
|
+
const errors = [];
|
|
3904
|
+
let cursor = 0;
|
|
3905
|
+
try {
|
|
3906
|
+
while (cursor < value.length) {
|
|
3907
|
+
const tag = value.slice(cursor, cursor + 2);
|
|
3908
|
+
const lengthStr = value.slice(cursor + 2, cursor + 4);
|
|
3909
|
+
const length = Number.parseInt(lengthStr, 10);
|
|
3910
|
+
if (Number.isNaN(length) || length < 0) {
|
|
3911
|
+
errors.push(`Longueur invalide pour le tag ${tag}.`);
|
|
3912
|
+
break;
|
|
3913
|
+
}
|
|
3914
|
+
const valueStart = cursor + 4;
|
|
3915
|
+
const valueEnd = valueStart + length;
|
|
3916
|
+
if (valueEnd > value.length) {
|
|
3917
|
+
errors.push(`Segment ${tag} tronqu\xE9.`);
|
|
3918
|
+
break;
|
|
3919
|
+
}
|
|
3920
|
+
segments[tag] = value.slice(valueStart, valueEnd);
|
|
3921
|
+
cursor = valueEnd;
|
|
3922
|
+
}
|
|
3923
|
+
} catch (error) {
|
|
3924
|
+
errors.push(`Erreur lors de l'analyse de la payload: ${error?.message ?? error}`);
|
|
3925
|
+
}
|
|
3926
|
+
return { segments, errors };
|
|
3927
|
+
}
|
|
3928
|
+
function validateSegmentContent(segments, rawValue) {
|
|
3929
|
+
const errors = [];
|
|
3930
|
+
const formatErrors = validateFormatIndicator(segments["00"]);
|
|
3931
|
+
const merchantInfoResult = extractMerchantInfo(segments["36"]);
|
|
3932
|
+
const countryCodeResult = validateCountryCodeSegment(segments["58"]);
|
|
3933
|
+
const additionalDataResult = extractAdditionalData(segments["62"]);
|
|
3934
|
+
const crcErrors = validateCrcSegment(segments["63"], rawValue);
|
|
3935
|
+
errors.push(
|
|
3936
|
+
...formatErrors,
|
|
3937
|
+
...merchantInfoResult.errors,
|
|
3938
|
+
...countryCodeResult.errors,
|
|
3939
|
+
...additionalDataResult.errors,
|
|
3940
|
+
...crcErrors
|
|
3941
|
+
);
|
|
3942
|
+
return {
|
|
3943
|
+
errors,
|
|
3944
|
+
merchantInfo: merchantInfoResult.merchantInfo,
|
|
3945
|
+
referenceLabel: additionalDataResult.referenceLabel,
|
|
3946
|
+
merchantChannel: additionalDataResult.merchantChannel,
|
|
3947
|
+
countryCode: countryCodeResult.countryCode
|
|
3948
|
+
};
|
|
3949
|
+
}
|
|
3950
|
+
function validateFormatIndicator(formatIndicator) {
|
|
3951
|
+
if (!formatIndicator) {
|
|
3952
|
+
return ["Tag 00 (format indicator) manquant."];
|
|
3953
|
+
}
|
|
3954
|
+
if (formatIndicator !== "01") {
|
|
3955
|
+
return ["Tag 00 invalide (doit \xEAtre 01)."];
|
|
3956
|
+
}
|
|
3957
|
+
return [];
|
|
3958
|
+
}
|
|
3959
|
+
function extractMerchantInfo(segment) {
|
|
3960
|
+
if (!segment) {
|
|
3961
|
+
return {
|
|
3962
|
+
merchantInfo: null,
|
|
3963
|
+
errors: ["Tag 36 (Merchant Account Information) manquant."]
|
|
3964
|
+
};
|
|
3965
|
+
}
|
|
3966
|
+
try {
|
|
3967
|
+
const merchantInfo = parseSubFields(segment);
|
|
3968
|
+
const errors = [];
|
|
3969
|
+
if (!merchantInfo["01"]) {
|
|
3970
|
+
errors.push("Alias manquant dans les informations marchand (tag 36).");
|
|
3971
|
+
}
|
|
3972
|
+
return { merchantInfo, errors };
|
|
3973
|
+
} catch (error) {
|
|
3974
|
+
return {
|
|
3975
|
+
merchantInfo: null,
|
|
3976
|
+
errors: [`Erreur lors de l'analyse des informations marchand: ${error?.message ?? error}`]
|
|
3977
|
+
};
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
function validateCountryCodeSegment(countryCode) {
|
|
3981
|
+
if (!countryCode) {
|
|
3982
|
+
return {
|
|
3983
|
+
errors: ["Tag 58 (Country Code) manquant."]
|
|
3984
|
+
};
|
|
3985
|
+
}
|
|
3986
|
+
return {
|
|
3987
|
+
countryCode,
|
|
3988
|
+
errors: []
|
|
3989
|
+
};
|
|
3990
|
+
}
|
|
3991
|
+
function extractAdditionalData(segment) {
|
|
3992
|
+
if (!segment) {
|
|
3993
|
+
return {
|
|
3994
|
+
errors: ["Tag 62 (Additional Data Field) manquant."]
|
|
3995
|
+
};
|
|
3996
|
+
}
|
|
3997
|
+
try {
|
|
3998
|
+
const additionalSegments = parseSubFields(segment);
|
|
3999
|
+
const referenceLabel = additionalSegments["05"];
|
|
4000
|
+
const merchantChannel = additionalSegments[DEFAULT_MERCHANT_CHANNEL_TAG];
|
|
4001
|
+
const errors = [];
|
|
4002
|
+
if (!merchantChannel) {
|
|
4003
|
+
errors.push("Tag 11 (Merchant Channel) manquant dans les donn\xE9es additionnelles.");
|
|
4004
|
+
}
|
|
4005
|
+
return {
|
|
4006
|
+
referenceLabel,
|
|
4007
|
+
merchantChannel,
|
|
4008
|
+
errors
|
|
4009
|
+
};
|
|
4010
|
+
} catch (error) {
|
|
4011
|
+
return {
|
|
4012
|
+
errors: [`Erreur lors de l'analyse des donn\xE9es additionnelles: ${error?.message ?? error}`]
|
|
4013
|
+
};
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
function validateCrcSegment(crc, rawValue) {
|
|
4017
|
+
if (!crc) {
|
|
4018
|
+
return ["Tag 63 (CRC) manquant."];
|
|
4019
|
+
}
|
|
4020
|
+
const payloadWithoutCrc = rawValue.slice(0, -4);
|
|
4021
|
+
const computedCrc = computeCrc16(payloadWithoutCrc);
|
|
4022
|
+
if (crc !== computedCrc) {
|
|
4023
|
+
return ["CRC invalide."];
|
|
4024
|
+
}
|
|
4025
|
+
return [];
|
|
4026
|
+
}
|
|
4027
|
+
function buildValidationData(segments, context) {
|
|
4028
|
+
const amountValue = segments["54"];
|
|
4029
|
+
const data = {
|
|
4030
|
+
alias: context.merchantInfo?.["01"] ?? "",
|
|
4031
|
+
countryCode: context.countryCode ?? "",
|
|
4032
|
+
qrType: mapQrTypeFromChannel(context.merchantChannel),
|
|
4033
|
+
referenceLabel: context.referenceLabel ?? ""
|
|
4034
|
+
// Chaîne vide si Tag 05 est absent (optionnel)
|
|
4035
|
+
};
|
|
4036
|
+
if (amountValue !== void 0) {
|
|
4037
|
+
data.amount = amountValue;
|
|
4038
|
+
}
|
|
4039
|
+
return data;
|
|
4040
|
+
}
|
|
4041
|
+
function parseSubFields(data) {
|
|
4042
|
+
const segments = {};
|
|
4043
|
+
let cursor = 0;
|
|
4044
|
+
while (cursor < data.length) {
|
|
4045
|
+
const tag = data.slice(cursor, cursor + 2);
|
|
4046
|
+
const lengthStr = data.slice(cursor + 2, cursor + 4);
|
|
4047
|
+
const length = Number.parseInt(lengthStr, 10);
|
|
4048
|
+
if (Number.isNaN(length) || length < 0) {
|
|
4049
|
+
throw new Error(`Longueur invalide pour le sous-tag ${tag}`);
|
|
4050
|
+
}
|
|
4051
|
+
const valueStart = cursor + 4;
|
|
4052
|
+
const valueEnd = valueStart + length;
|
|
4053
|
+
if (valueEnd > data.length) {
|
|
4054
|
+
throw new Error(`Sous-segment ${tag} tronqu\xE9`);
|
|
4055
|
+
}
|
|
4056
|
+
const segmentValue = data.slice(valueStart, valueEnd);
|
|
4057
|
+
segments[tag] = segmentValue;
|
|
4058
|
+
cursor = valueEnd;
|
|
4059
|
+
}
|
|
4060
|
+
return segments;
|
|
4061
|
+
}
|
|
4062
|
+
function buildDotPatternSvg(qr, options) {
|
|
4063
|
+
const modules = qr.modules;
|
|
4064
|
+
const moduleCount = typeof modules?.size === "number" ? modules.size : modules.length;
|
|
4065
|
+
if (typeof moduleCount !== "number" || Number.isNaN(moduleCount)) {
|
|
4066
|
+
throw new TypeError("Format du QR Code inattendu: impossible de d\xE9terminer la taille de la matrice.");
|
|
4067
|
+
}
|
|
4068
|
+
const svgSize = options.size;
|
|
4069
|
+
const margin = options.margin;
|
|
4070
|
+
const drawableSize = svgSize - margin * 2;
|
|
4071
|
+
const cellSize = drawableSize / moduleCount;
|
|
4072
|
+
const dotRadius = cellSize * DOT_RADIUS_RATIO;
|
|
4073
|
+
const finderRadius = cellSize * FINDER_CORNER_RADIUS;
|
|
4074
|
+
const paths = [];
|
|
4075
|
+
const backgroundRect = `<rect fill="${options.backgroundColor}" width="${svgSize}" height="${svgSize}" rx="${formatSvgNumber(
|
|
4076
|
+
finderRadius
|
|
4077
|
+
)}" />`;
|
|
4078
|
+
const finderSize = 7;
|
|
4079
|
+
const finderOrigins = [
|
|
4080
|
+
[0, 0],
|
|
4081
|
+
[moduleCount - finderSize, 0],
|
|
4082
|
+
[0, moduleCount - finderSize]
|
|
4083
|
+
];
|
|
4084
|
+
for (const [fc, fr] of finderOrigins) {
|
|
4085
|
+
paths.push(
|
|
4086
|
+
...generateFinderPatternRects(
|
|
4087
|
+
margin + fc * cellSize,
|
|
4088
|
+
margin + fr * cellSize,
|
|
4089
|
+
cellSize,
|
|
4090
|
+
options.dotColor,
|
|
4091
|
+
options.backgroundColor
|
|
4092
|
+
)
|
|
4093
|
+
);
|
|
4094
|
+
}
|
|
4095
|
+
for (let row = 0; row < moduleCount; row += 1) {
|
|
4096
|
+
for (let col = 0; col < moduleCount; col += 1) {
|
|
4097
|
+
if (!isDarkModule(modules, moduleCount, row, col)) {
|
|
4098
|
+
continue;
|
|
4099
|
+
}
|
|
4100
|
+
if (isFinderPattern(moduleCount, row, col)) {
|
|
4101
|
+
continue;
|
|
4102
|
+
}
|
|
4103
|
+
const x = margin + col * cellSize + cellSize / 2;
|
|
4104
|
+
const y = margin + row * cellSize + cellSize / 2;
|
|
4105
|
+
paths.push(
|
|
4106
|
+
`<circle cx="${formatSvgNumber(x)}" cy="${formatSvgNumber(y)}" r="${formatSvgNumber(
|
|
4107
|
+
dotRadius
|
|
4108
|
+
)}" fill="${options.dotColor}" />`
|
|
4109
|
+
);
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
const logoSvg = generateLogoOverlay(
|
|
4113
|
+
svgSize,
|
|
4114
|
+
margin,
|
|
4115
|
+
moduleCount,
|
|
4116
|
+
cellSize,
|
|
4117
|
+
options.logo
|
|
4118
|
+
);
|
|
4119
|
+
return [
|
|
4120
|
+
`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${svgSize} ${svgSize}" shape-rendering="geometricPrecision">`,
|
|
4121
|
+
backgroundRect,
|
|
4122
|
+
...paths,
|
|
4123
|
+
logoSvg,
|
|
4124
|
+
"</svg>"
|
|
4125
|
+
].join("");
|
|
4126
|
+
}
|
|
4127
|
+
function isFinderPattern(moduleCount, row, col) {
|
|
4128
|
+
const patternSize = 7;
|
|
4129
|
+
const inTop = row < patternSize;
|
|
4130
|
+
const inBottom = row >= moduleCount - patternSize;
|
|
4131
|
+
const inLeft = col < patternSize;
|
|
4132
|
+
const inRight = col >= moduleCount - patternSize;
|
|
4133
|
+
return inTop && inLeft || inTop && inRight || inBottom && inLeft;
|
|
4134
|
+
}
|
|
4135
|
+
function generateFinderPatternRects(originX, originY, cellSize, dotColor, backgroundColor) {
|
|
4136
|
+
const fmt = formatSvgNumber;
|
|
4137
|
+
const out7 = cellSize * 7;
|
|
4138
|
+
const out5 = cellSize * 5;
|
|
4139
|
+
const out3 = cellSize * 3;
|
|
4140
|
+
const off1 = cellSize;
|
|
4141
|
+
const off2 = cellSize * 2;
|
|
4142
|
+
return [
|
|
4143
|
+
`<rect x="${fmt(originX)}" y="${fmt(originY)}" width="${fmt(out7)}" height="${fmt(out7)}" fill="${dotColor}" />`,
|
|
4144
|
+
`<rect x="${fmt(originX + off1)}" y="${fmt(originY + off1)}" width="${fmt(out5)}" height="${fmt(out5)}" fill="${backgroundColor}" />`,
|
|
4145
|
+
`<rect x="${fmt(originX + off2)}" y="${fmt(originY + off2)}" width="${fmt(out3)}" height="${fmt(out3)}" fill="${dotColor}" />`
|
|
4146
|
+
];
|
|
4147
|
+
}
|
|
4148
|
+
function generateLogoOverlay(svgSize, margin, moduleCount, cellSize, logo) {
|
|
4149
|
+
if (!logo.dataUrl) {
|
|
4150
|
+
return "";
|
|
4151
|
+
}
|
|
4152
|
+
const qrDrawableSize = moduleCount * cellSize;
|
|
4153
|
+
const logoSize = qrDrawableSize * clamp(logo.sizeRatio, 0.05, 0.5);
|
|
4154
|
+
const logoPadding = logoSize * clamp(logo.paddingRatio, 0, 0.25);
|
|
4155
|
+
const backgroundSize = logoSize + logoPadding * 2;
|
|
4156
|
+
const logoBorderRadius = clamp(logo.borderRadiusRatio, 0, 0.5) * backgroundSize;
|
|
4157
|
+
const originX = margin + (qrDrawableSize - backgroundSize) / 2;
|
|
4158
|
+
const originY = margin + (qrDrawableSize - backgroundSize) / 2;
|
|
4159
|
+
return [
|
|
4160
|
+
`<g class="pispi-logo" transform="translate(${formatSvgNumber(originX)}, ${formatSvgNumber(originY)})" pointer-events="none">`,
|
|
4161
|
+
`<rect width="${formatSvgNumber(backgroundSize)}" height="${formatSvgNumber(backgroundSize)}" rx="${formatSvgNumber(
|
|
4162
|
+
logoBorderRadius
|
|
4163
|
+
)}" fill="${logo.backgroundColor}" opacity="0.95"/>`,
|
|
4164
|
+
`<image x="${formatSvgNumber(logoPadding)}" y="${formatSvgNumber(logoPadding)}" width="${formatSvgNumber(
|
|
4165
|
+
logoSize
|
|
4166
|
+
)}" height="${formatSvgNumber(logoSize)}" href="${logo.dataUrl}" xlink:href="${logo.dataUrl}" preserveAspectRatio="xMidYMid meet"/>`,
|
|
4167
|
+
"</g>"
|
|
4168
|
+
].join("");
|
|
4169
|
+
}
|
|
4170
|
+
function isDarkModule(modules, moduleCount, row, col) {
|
|
4171
|
+
if (modules?.data && Array.isArray(modules.data)) {
|
|
4172
|
+
const index = row * moduleCount + col;
|
|
4173
|
+
return Boolean(modules.data[index]);
|
|
4174
|
+
}
|
|
4175
|
+
if (typeof modules?.get === "function") {
|
|
4176
|
+
return Boolean(modules.get(row, col));
|
|
4177
|
+
}
|
|
4178
|
+
if (Array.isArray(modules[row])) {
|
|
4179
|
+
return Boolean(modules[row][col]);
|
|
4180
|
+
}
|
|
4181
|
+
return false;
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
// src/sdk.ts
|
|
4185
|
+
var OpenAPI;
|
|
4186
|
+
var PiSpiSDK = class {
|
|
4187
|
+
/**
|
|
4188
|
+
* Initialize the PI-SPI SDK
|
|
4189
|
+
*
|
|
4190
|
+
* @param config - SDK configuration
|
|
4191
|
+
*
|
|
4192
|
+
* @example
|
|
4193
|
+
* ```typescript
|
|
4194
|
+
* const sdk = new PiSpiSDK({
|
|
4195
|
+
* baseUrl: 'https://sandbox.api.pi-bceao.com/piz/v1',
|
|
4196
|
+
* accessToken: 'your-oauth2-token',
|
|
4197
|
+
* });
|
|
4198
|
+
* ```
|
|
4199
|
+
*/
|
|
4200
|
+
constructor(config) {
|
|
4201
|
+
/**
|
|
4202
|
+
* QR Code utilities
|
|
4203
|
+
* Generate and validate BCEAO compatible QR codes
|
|
4204
|
+
*/
|
|
4205
|
+
this.qr = QRCode;
|
|
4206
|
+
this._config = {
|
|
4207
|
+
BASE: config.baseUrl || "https://sandbox.api.pi-bceao.com/piz/v1",
|
|
4208
|
+
TOKEN: config.accessToken,
|
|
4209
|
+
dispatcher: config.dispatcher,
|
|
4210
|
+
HEADERS: {
|
|
4211
|
+
...config.headers
|
|
4212
|
+
}
|
|
4213
|
+
};
|
|
4214
|
+
try {
|
|
4215
|
+
OpenAPI = this._config;
|
|
4216
|
+
} catch {
|
|
4217
|
+
OpenAPI = this._config;
|
|
4218
|
+
}
|
|
4219
|
+
this.comptes = new ComptesService(this._config);
|
|
4220
|
+
this.alias = new AliasService(this._config);
|
|
4221
|
+
this.webhooks = new WebhooksService(this._config);
|
|
4222
|
+
this.demandesPaiement = new DemandesPaiementService(this._config);
|
|
4223
|
+
this.demandesPaiementEnMasse = new DemandesPaiementEnMasseService(this._config);
|
|
4224
|
+
this.paiements = new PaiementsService(this._config);
|
|
4225
|
+
this.paiementsEnMasse = new PaiementsEnMasseService(this._config);
|
|
4226
|
+
this.retoursFonds = new RetoursFondsService(this._config);
|
|
4227
|
+
this.demandesAnnulation = new DemandesAnnulationService(this._config);
|
|
4228
|
+
}
|
|
4229
|
+
/**
|
|
4230
|
+
* Update the access token
|
|
4231
|
+
* Useful when tokens are refreshed
|
|
4232
|
+
*/
|
|
4233
|
+
setAccessToken(token) {
|
|
4234
|
+
if (this._config) {
|
|
4235
|
+
this._config.TOKEN = token;
|
|
4236
|
+
}
|
|
4237
|
+
if (OpenAPI) {
|
|
4238
|
+
OpenAPI.TOKEN = token;
|
|
4239
|
+
OpenAPI.HEADERS = {
|
|
4240
|
+
...OpenAPI.HEADERS,
|
|
4241
|
+
Authorization: `Bearer ${token}`
|
|
4242
|
+
};
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
/**
|
|
4246
|
+
* Get the current base URL
|
|
4247
|
+
*/
|
|
4248
|
+
getBaseUrl() {
|
|
4249
|
+
return this._config.BASE;
|
|
4250
|
+
}
|
|
4251
|
+
};
|
|
4252
|
+
|
|
4253
|
+
// src/customer-qr.ts
|
|
4254
|
+
var ALIAS_TYPES = ["SHID", "MBNO", "MCOD"];
|
|
4255
|
+
function buildLomiCustomerQr(input) {
|
|
4256
|
+
const alias = input.alias.trim();
|
|
4257
|
+
if (!alias) {
|
|
4258
|
+
throw new Error("alias is required");
|
|
4259
|
+
}
|
|
4260
|
+
const aliasType = input.aliasType ?? "SHID";
|
|
4261
|
+
if (!ALIAS_TYPES.includes(aliasType)) {
|
|
4262
|
+
throw new Error(`Invalid aliasType: ${aliasType}`);
|
|
4263
|
+
}
|
|
4264
|
+
return {
|
|
4265
|
+
t: "lomi.cust",
|
|
4266
|
+
v: 1,
|
|
4267
|
+
alias,
|
|
4268
|
+
aliasType
|
|
4269
|
+
};
|
|
4270
|
+
}
|
|
4271
|
+
function serializeLomiCustomerQr(qr) {
|
|
4272
|
+
return JSON.stringify(qr);
|
|
4273
|
+
}
|
|
4274
|
+
function parseLomiCustomerQr(raw) {
|
|
4275
|
+
const trimmed = raw.trim();
|
|
4276
|
+
if (!trimmed || trimmed.startsWith("000201")) {
|
|
4277
|
+
return null;
|
|
4278
|
+
}
|
|
4279
|
+
let parsed;
|
|
4280
|
+
try {
|
|
4281
|
+
parsed = JSON.parse(trimmed);
|
|
4282
|
+
} catch {
|
|
4283
|
+
return null;
|
|
4284
|
+
}
|
|
4285
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
4286
|
+
return null;
|
|
4287
|
+
}
|
|
4288
|
+
const record = parsed;
|
|
4289
|
+
if (record.t !== "lomi.cust" || record.v !== 1) {
|
|
4290
|
+
return null;
|
|
4291
|
+
}
|
|
4292
|
+
const alias = record.alias;
|
|
4293
|
+
if (typeof alias !== "string" || alias.trim().length === 0) {
|
|
4294
|
+
return null;
|
|
4295
|
+
}
|
|
4296
|
+
const aliasType = record.aliasType;
|
|
4297
|
+
if (typeof aliasType !== "string" || !ALIAS_TYPES.includes(aliasType)) {
|
|
4298
|
+
return null;
|
|
4299
|
+
}
|
|
4300
|
+
return {
|
|
4301
|
+
t: "lomi.cust",
|
|
4302
|
+
v: 1,
|
|
4303
|
+
alias: alias.trim(),
|
|
4304
|
+
aliasType
|
|
4305
|
+
};
|
|
4306
|
+
}
|
|
4307
|
+
|
|
4308
|
+
// src/query-builder.ts
|
|
4309
|
+
var QueryBuilder = class {
|
|
4310
|
+
constructor() {
|
|
4311
|
+
this.params = {};
|
|
4312
|
+
this.filters = /* @__PURE__ */ new Map();
|
|
4313
|
+
this.sortOrder = "asc";
|
|
4314
|
+
}
|
|
4315
|
+
/**
|
|
4316
|
+
* Add a filter condition
|
|
4317
|
+
* @param field - Field name to filter on
|
|
4318
|
+
* @param operator - Filter operator (default: 'eq')
|
|
4319
|
+
* @param value - Filter value
|
|
4320
|
+
*/
|
|
4321
|
+
filter(field, operatorOrValue, value) {
|
|
4322
|
+
let operator;
|
|
4323
|
+
let filterValue;
|
|
4324
|
+
if (value === void 0) {
|
|
4325
|
+
if (typeof operatorOrValue === "string" && this.isOperator(operatorOrValue)) {
|
|
4326
|
+
throw new Error("Filter operator requires a value");
|
|
4327
|
+
}
|
|
4328
|
+
operator = "eq";
|
|
4329
|
+
filterValue = operatorOrValue;
|
|
4330
|
+
} else {
|
|
4331
|
+
operator = operatorOrValue;
|
|
4332
|
+
filterValue = value;
|
|
4333
|
+
}
|
|
4334
|
+
this.filters.set(field, { operator, value: filterValue });
|
|
4335
|
+
return this;
|
|
4336
|
+
}
|
|
4337
|
+
/**
|
|
4338
|
+
* Add an equality filter (shorthand)
|
|
4339
|
+
*/
|
|
4340
|
+
eq(field, value) {
|
|
4341
|
+
return this.filter(field, "eq", value);
|
|
4342
|
+
}
|
|
4343
|
+
/**
|
|
4344
|
+
* Add a "not equal" filter (shorthand)
|
|
4345
|
+
*/
|
|
4346
|
+
ne(field, value) {
|
|
4347
|
+
return this.filter(field, "ne", value);
|
|
4348
|
+
}
|
|
4349
|
+
/**
|
|
4350
|
+
* Add a "greater than" filter (shorthand)
|
|
4351
|
+
*/
|
|
4352
|
+
gt(field, value) {
|
|
4353
|
+
return this.filter(field, "gt", value);
|
|
4354
|
+
}
|
|
4355
|
+
/**
|
|
4356
|
+
* Add a "greater than or equal" filter (shorthand)
|
|
4357
|
+
*/
|
|
4358
|
+
gte(field, value) {
|
|
4359
|
+
return this.filter(field, "gte", value);
|
|
4360
|
+
}
|
|
4361
|
+
/**
|
|
4362
|
+
* Add a "less than" filter (shorthand)
|
|
4363
|
+
*/
|
|
4364
|
+
lt(field, value) {
|
|
4365
|
+
return this.filter(field, "lt", value);
|
|
4366
|
+
}
|
|
4367
|
+
/**
|
|
4368
|
+
* Add a "less than or equal" filter (shorthand)
|
|
4369
|
+
*/
|
|
4370
|
+
lte(field, value) {
|
|
4371
|
+
return this.filter(field, "lte", value);
|
|
4372
|
+
}
|
|
4373
|
+
/**
|
|
4374
|
+
* Add an "in" filter (shorthand)
|
|
4375
|
+
*/
|
|
4376
|
+
in(field, values) {
|
|
4377
|
+
return this.filter(field, "in", values);
|
|
4378
|
+
}
|
|
4379
|
+
/**
|
|
4380
|
+
* Add a "contains" filter (shorthand)
|
|
4381
|
+
*/
|
|
4382
|
+
contains(field, value) {
|
|
4383
|
+
return this.filter(field, "contains", value);
|
|
4384
|
+
}
|
|
4385
|
+
/**
|
|
4386
|
+
* Set sort field and order
|
|
4387
|
+
* @param field - Field to sort by
|
|
4388
|
+
* @param order - Sort order ('asc' or 'desc', default: 'asc')
|
|
4389
|
+
*/
|
|
4390
|
+
sort(field, order = "asc") {
|
|
4391
|
+
this.sortField = field;
|
|
4392
|
+
this.sortOrder = order;
|
|
4393
|
+
return this;
|
|
4394
|
+
}
|
|
4395
|
+
/**
|
|
4396
|
+
* Sort in descending order (shorthand)
|
|
4397
|
+
*/
|
|
4398
|
+
sortDesc(field) {
|
|
4399
|
+
return this.sort(field, "desc");
|
|
4400
|
+
}
|
|
4401
|
+
/**
|
|
4402
|
+
* Set page number
|
|
4403
|
+
*/
|
|
4404
|
+
page(page) {
|
|
4405
|
+
this.params.page = typeof page === "string" ? page : page.toString();
|
|
4406
|
+
return this;
|
|
4407
|
+
}
|
|
4408
|
+
/**
|
|
4409
|
+
* Set page size
|
|
4410
|
+
*/
|
|
4411
|
+
size(size) {
|
|
4412
|
+
if (size < 1) {
|
|
4413
|
+
throw new Error("Page size must be at least 1");
|
|
4414
|
+
}
|
|
4415
|
+
if (size > 100) {
|
|
4416
|
+
throw new Error("Page size cannot exceed 100");
|
|
4417
|
+
}
|
|
4418
|
+
this.params.size = size;
|
|
4419
|
+
return this;
|
|
4420
|
+
}
|
|
4421
|
+
/**
|
|
4422
|
+
* Add a custom parameter
|
|
4423
|
+
*/
|
|
4424
|
+
param(key, value) {
|
|
4425
|
+
this.params[key] = value;
|
|
4426
|
+
return this;
|
|
4427
|
+
}
|
|
4428
|
+
/**
|
|
4429
|
+
* Build the query parameters object
|
|
4430
|
+
*/
|
|
4431
|
+
build() {
|
|
4432
|
+
const result = { ...this.params };
|
|
4433
|
+
for (const [field, { operator, value }] of this.filters.entries()) {
|
|
4434
|
+
if (operator === "eq") {
|
|
4435
|
+
result[field] = String(value);
|
|
4436
|
+
} else if (operator === "exists") {
|
|
4437
|
+
result[`${field}[exists]`] = String(value);
|
|
4438
|
+
} else {
|
|
4439
|
+
result[`${field}[${operator}]`] = Array.isArray(value) ? value.join(",") : String(value);
|
|
4440
|
+
}
|
|
4441
|
+
}
|
|
4442
|
+
if (this.sortField) {
|
|
4443
|
+
result.sort = this.sortOrder === "desc" ? `-${this.sortField}` : this.sortField;
|
|
4444
|
+
}
|
|
4445
|
+
return result;
|
|
4446
|
+
}
|
|
4447
|
+
/**
|
|
4448
|
+
* Build query string
|
|
4449
|
+
*/
|
|
4450
|
+
buildQueryString() {
|
|
4451
|
+
const params = this.build();
|
|
4452
|
+
const pairs = Object.entries(params).filter(([_, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
|
4453
|
+
return pairs.length > 0 ? `?${pairs.join("&")}` : "";
|
|
4454
|
+
}
|
|
4455
|
+
/**
|
|
4456
|
+
* Reset the builder
|
|
4457
|
+
*/
|
|
4458
|
+
reset() {
|
|
4459
|
+
this.params = {};
|
|
4460
|
+
this.filters.clear();
|
|
4461
|
+
this.sortField = void 0;
|
|
4462
|
+
this.sortOrder = "asc";
|
|
4463
|
+
return this;
|
|
4464
|
+
}
|
|
4465
|
+
isOperator(value) {
|
|
4466
|
+
return [
|
|
4467
|
+
"eq",
|
|
4468
|
+
"ne",
|
|
4469
|
+
"gt",
|
|
4470
|
+
"gte",
|
|
4471
|
+
"lt",
|
|
4472
|
+
"lte",
|
|
4473
|
+
"in",
|
|
4474
|
+
"contains",
|
|
4475
|
+
"notContains",
|
|
4476
|
+
"beginsWith",
|
|
4477
|
+
"endsWith",
|
|
4478
|
+
"exists"
|
|
4479
|
+
].includes(value);
|
|
4480
|
+
}
|
|
4481
|
+
};
|
|
4482
|
+
|
|
4483
|
+
// src/types/alias.ts
|
|
4484
|
+
var AliasType = {
|
|
4485
|
+
/**
|
|
4486
|
+
* SHID - System-generated unique payment address (UUID format, 36 characters)
|
|
4487
|
+
* Available for all client types: P, C, B, G
|
|
4488
|
+
*/
|
|
4489
|
+
SHID: "SHID",
|
|
4490
|
+
/**
|
|
4491
|
+
* MCOD - Merchant code for USSD payment support
|
|
4492
|
+
* Available for business clients only: C, B, G
|
|
4493
|
+
*/
|
|
4494
|
+
MCOD: "MCOD",
|
|
4495
|
+
/**
|
|
4496
|
+
* MBNO - Mobile phone number alias
|
|
4497
|
+
* Available for individual clients only: P
|
|
4498
|
+
*/
|
|
4499
|
+
MBNO: "MBNO"
|
|
4500
|
+
};
|
|
4501
|
+
var ALIAS_TYPES2 = [AliasType.SHID, AliasType.MCOD, AliasType.MBNO];
|
|
4502
|
+
function isValidAliasType(value) {
|
|
4503
|
+
return ALIAS_TYPES2.includes(value);
|
|
4504
|
+
}
|
|
4505
|
+
function getAvailableAliasTypes(clientType) {
|
|
4506
|
+
switch (clientType) {
|
|
4507
|
+
case "P":
|
|
4508
|
+
return [AliasType.MBNO, AliasType.SHID];
|
|
4509
|
+
case "C":
|
|
4510
|
+
case "B":
|
|
4511
|
+
case "G":
|
|
4512
|
+
return [AliasType.SHID, AliasType.MCOD];
|
|
4513
|
+
default:
|
|
4514
|
+
return [];
|
|
4515
|
+
}
|
|
4516
|
+
}
|
|
4517
|
+
|
|
4518
|
+
// src/utils/index.ts
|
|
4519
|
+
function formatAmount(centimes) {
|
|
4520
|
+
const xof = centimes / 100;
|
|
4521
|
+
return new Intl.NumberFormat("fr-FR", {
|
|
4522
|
+
style: "currency",
|
|
4523
|
+
currency: "XOF",
|
|
4524
|
+
minimumFractionDigits: 0,
|
|
4525
|
+
maximumFractionDigits: 0
|
|
4526
|
+
}).format(xof);
|
|
4527
|
+
}
|
|
4528
|
+
function xofToCentimes(xof) {
|
|
4529
|
+
return Math.round(xof * 100);
|
|
4530
|
+
}
|
|
4531
|
+
function centimesToXof(centimes) {
|
|
4532
|
+
return centimes / 100;
|
|
4533
|
+
}
|
|
4534
|
+
function isValidAccountNumber(accountNumber) {
|
|
4535
|
+
return /^[A-Z]{2,3}\d{19,22}$/.test(accountNumber);
|
|
4536
|
+
}
|
|
4537
|
+
function isValidShidAlias(alias) {
|
|
4538
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4539
|
+
return uuidRegex.test(alias);
|
|
4540
|
+
}
|
|
4541
|
+
function isValidPhoneNumber(phoneNumber) {
|
|
4542
|
+
const phoneRegex = /^\+?[1-9]\d{8,12}$/;
|
|
4543
|
+
return phoneRegex.test(phoneNumber.replace(/[\s-]/g, ""));
|
|
4544
|
+
}
|
|
4545
|
+
function getCountryFromAccount(accountNumber) {
|
|
4546
|
+
const countryMap = {
|
|
4547
|
+
CI: "C\xF4te d'Ivoire",
|
|
4548
|
+
SN: "Senegal",
|
|
4549
|
+
BJ: "Benin",
|
|
4550
|
+
BF: "Burkina Faso",
|
|
4551
|
+
ML: "Mali",
|
|
4552
|
+
NE: "Niger",
|
|
4553
|
+
TG: "Togo",
|
|
4554
|
+
GW: "Guinea-Bissau"
|
|
4555
|
+
};
|
|
4556
|
+
const countryCode = accountNumber.substring(0, 2);
|
|
4557
|
+
return countryMap[countryCode] || null;
|
|
4558
|
+
}
|
|
4559
|
+
function sleep(ms) {
|
|
4560
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
4561
|
+
}
|
|
4562
|
+
async function retryWithBackoff(fn, maxRetries = 3, initialDelay = 1e3) {
|
|
4563
|
+
let lastError;
|
|
4564
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
4565
|
+
try {
|
|
4566
|
+
return await fn();
|
|
4567
|
+
} catch (error) {
|
|
4568
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
4569
|
+
if (i < maxRetries - 1) {
|
|
4570
|
+
const delay = initialDelay * Math.pow(2, i);
|
|
4571
|
+
await sleep(delay);
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
throw lastError ?? new Error("Retry failed with unknown error");
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4578
|
+
// src/utils/constants.ts
|
|
4579
|
+
var PI_SPI_ENDPOINTS = {
|
|
4580
|
+
/** Production API endpoint */
|
|
4581
|
+
PRODUCTION: "https://api.pi-bceao.com/piz/v1",
|
|
4582
|
+
/** Sandbox API endpoint */
|
|
4583
|
+
SANDBOX: "https://sandbox.api.pi-bceao.com/piz/v1",
|
|
4584
|
+
/** Default endpoint (sandbox) */
|
|
4585
|
+
DEFAULT: "https://sandbox.api.pi-bceao.com/piz/v1"
|
|
4586
|
+
};
|
|
4587
|
+
var PAYMENT_STATUS = {
|
|
4588
|
+
/** Payment initiated (awaiting confirmation after alias lookup) */
|
|
4589
|
+
INITIE: "INITIE",
|
|
4590
|
+
/** Payment sent (validations passed, PSP has sent the request) */
|
|
4591
|
+
ENVOYE: "ENVOYE",
|
|
4592
|
+
/** Payment is confirmed/irreversible */
|
|
4593
|
+
IRREVOCABLE: "IRREVOCABLE",
|
|
4594
|
+
/** Payment has been rejected */
|
|
4595
|
+
REJETE: "REJETE"
|
|
4596
|
+
};
|
|
4597
|
+
var ACCOUNT_STATUS = {
|
|
4598
|
+
/** Account is open */
|
|
4599
|
+
OPEN: "OUVERT",
|
|
4600
|
+
/** Account is blocked */
|
|
4601
|
+
BLOCKED: "BLOQUE",
|
|
4602
|
+
/** Account is closed */
|
|
4603
|
+
CLOSED: "CLOTURE"
|
|
4604
|
+
};
|
|
4605
|
+
var ACCOUNT_TYPE = {
|
|
4606
|
+
/** Current account */
|
|
4607
|
+
CURRENT: "CACC",
|
|
4608
|
+
/** Savings account */
|
|
4609
|
+
SAVINGS: "SVGS"
|
|
4610
|
+
};
|
|
4611
|
+
var CLIENT_TYPE = {
|
|
4612
|
+
/** Individual person */
|
|
4613
|
+
INDIVIDUAL: "P",
|
|
4614
|
+
/** Merchant */
|
|
4615
|
+
MERCHANT: "C",
|
|
4616
|
+
/** Business */
|
|
4617
|
+
BUSINESS: "B",
|
|
4618
|
+
/** Government */
|
|
4619
|
+
GOVERNMENT: "G"
|
|
4620
|
+
};
|
|
4621
|
+
var UEMOA_COUNTRIES2 = {
|
|
4622
|
+
BENIN: "BJ",
|
|
4623
|
+
BURKINA_FASO: "BF",
|
|
4624
|
+
IVORY_COAST: "CI",
|
|
4625
|
+
GUINEA_BISSAU: "GW",
|
|
4626
|
+
MALI: "ML",
|
|
4627
|
+
NIGER: "NE",
|
|
4628
|
+
SENEGAL: "SN",
|
|
4629
|
+
TOGO: "TG"
|
|
4630
|
+
};
|
|
4631
|
+
var CURRENCY = {
|
|
4632
|
+
/** West African CFA Franc */
|
|
4633
|
+
XOF: "XOF",
|
|
4634
|
+
/** Amounts are specified in centimes (1 XOF = 100 centimes) */
|
|
4635
|
+
CENTIMES_PER_XOF: 100
|
|
4636
|
+
};
|
|
4637
|
+
var DEFAULT_LIMITS = {
|
|
4638
|
+
/** Maximum page size for paginated requests */
|
|
4639
|
+
MAX_PAGE_SIZE: 100,
|
|
4640
|
+
/** Default page size */
|
|
4641
|
+
DEFAULT_PAGE_SIZE: 20,
|
|
4642
|
+
/** Default aliases per account */
|
|
4643
|
+
DEFAULT_ALIASES_PER_ACCOUNT: 20
|
|
4644
|
+
};
|
|
4645
|
+
var WEBHOOK_EVENTS = {
|
|
4646
|
+
/** Payment received */
|
|
4647
|
+
PAIEMENT_RECU: "PAIEMENT_RECU",
|
|
4648
|
+
/** Payment sent */
|
|
4649
|
+
PAIEMENT_ENVOYE: "PAIEMENT_ENVOYE",
|
|
4650
|
+
/** Payment rejected */
|
|
4651
|
+
PAIEMENT_REJETE: "PAIEMENT_REJETE",
|
|
4652
|
+
/** Payment request (RTP) received */
|
|
4653
|
+
RTP_RECU: "RTP_RECU",
|
|
4654
|
+
/** Payment request (RTP) rejected */
|
|
4655
|
+
RTP_REJETE: "RTP_REJETE",
|
|
4656
|
+
/** Cancellation requested */
|
|
4657
|
+
ANNULATION_DEMANDE: "ANNULATION_DEMANDE",
|
|
4658
|
+
/** Cancellation rejected */
|
|
4659
|
+
ANNULATION_REJETE: "ANNULATION_REJETE",
|
|
4660
|
+
/** Fund return sent */
|
|
4661
|
+
RETOUR_ENVOYE: "RETOUR_ENVOYE",
|
|
4662
|
+
/** Fund return rejected */
|
|
4663
|
+
RETOUR_REJETE: "RETOUR_REJETE",
|
|
4664
|
+
/** Fund return received */
|
|
4665
|
+
RETOUR_RECU: "RETOUR_RECU"
|
|
4666
|
+
};
|
|
4667
|
+
|
|
4668
|
+
// src/index.ts
|
|
4669
|
+
init_generated();
|
|
4670
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4671
|
+
0 && (module.exports = {
|
|
4672
|
+
ACCOUNT_STATUS,
|
|
4673
|
+
ACCOUNT_TYPE,
|
|
4674
|
+
ALIAS_TYPES,
|
|
4675
|
+
AliasService,
|
|
4676
|
+
AliasType,
|
|
4677
|
+
AnnulationStatut,
|
|
4678
|
+
ApiError,
|
|
4679
|
+
CLIENT_TYPE,
|
|
4680
|
+
CURRENCY,
|
|
4681
|
+
CancelError,
|
|
4682
|
+
CancelablePromise,
|
|
4683
|
+
CompteOperation,
|
|
4684
|
+
CompteSolde,
|
|
4685
|
+
CompteTransfertIntraReponse,
|
|
4686
|
+
ComptesService,
|
|
4687
|
+
DEFAULT_LIMITS,
|
|
4688
|
+
DEFAULT_PISPI_LOGO_DATA_URL,
|
|
4689
|
+
DemandeAnnulationService,
|
|
4690
|
+
DemandePaiementConfirmationAnnulationRaison,
|
|
4691
|
+
DemandePaiementConfirmationReponse,
|
|
4692
|
+
DemandePaiementConsultationReponse,
|
|
4693
|
+
DemandePaiementEnMasseStatutReponse,
|
|
4694
|
+
DemandePaiementListeItem,
|
|
4695
|
+
DemandePaiementReponseRequest,
|
|
4696
|
+
DemandePaiementRequest,
|
|
4697
|
+
DemandePaiementRequestCategorie,
|
|
4698
|
+
DemandePaiementStatut,
|
|
4699
|
+
DemandePaiementStatutRaison,
|
|
4700
|
+
DemandesDePaiementEnMasseService,
|
|
4701
|
+
DemandesDePaiementService,
|
|
4702
|
+
NotificationService,
|
|
4703
|
+
OpenAPI,
|
|
4704
|
+
PAYMENT_STATUS,
|
|
4705
|
+
PISPI_AMBER_LOGO_DATA_URL,
|
|
4706
|
+
PISPI_QRCODE_LOGO_DATA_URL,
|
|
4707
|
+
PI_SPI_ENDPOINTS,
|
|
4708
|
+
Paiement,
|
|
4709
|
+
PaiementAnnulationMotif,
|
|
4710
|
+
PaiementAnnulationStatutRaison,
|
|
4711
|
+
PaiementEnMasseReponseStatut,
|
|
4712
|
+
PaiementEnMasseService,
|
|
4713
|
+
PaiementImmediatConfirmationReponse,
|
|
4714
|
+
PaiementImmediatReponse,
|
|
4715
|
+
PaiementImmediatService,
|
|
4716
|
+
PaiementStatut,
|
|
4717
|
+
PaiementStatutRaison,
|
|
4718
|
+
PiSpiAuthError,
|
|
4719
|
+
PiSpiError,
|
|
4720
|
+
PiSpiNotFoundError,
|
|
4721
|
+
PiSpiRateLimitError,
|
|
4722
|
+
PiSpiSDK,
|
|
4723
|
+
PiSpiValidationError,
|
|
4724
|
+
QRCode,
|
|
4725
|
+
QueryBuilder,
|
|
4726
|
+
RefDocType,
|
|
4727
|
+
RetourStatut,
|
|
4728
|
+
RetourStatutRaison,
|
|
4729
|
+
RetoursdeFondsService,
|
|
4730
|
+
UEMOA_COUNTRIES,
|
|
4731
|
+
WEBHOOK_EVENTS,
|
|
4732
|
+
WebhookEvent,
|
|
4733
|
+
WebhooksEvents,
|
|
4734
|
+
buildLomiCustomerQr,
|
|
4735
|
+
buildPayloadString,
|
|
4736
|
+
centimesToXof,
|
|
4737
|
+
computeCrc16,
|
|
4738
|
+
createQrPayload,
|
|
4739
|
+
formatAmount,
|
|
4740
|
+
generateQrCodeSvg,
|
|
4741
|
+
getAvailableAliasTypes,
|
|
4742
|
+
getCountryFromAccount,
|
|
4743
|
+
handleApiError,
|
|
4744
|
+
isValidAccountNumber,
|
|
4745
|
+
isValidAliasType,
|
|
4746
|
+
isValidPhoneNumber,
|
|
4747
|
+
isValidPispiQrPayload,
|
|
4748
|
+
isValidShidAlias,
|
|
4749
|
+
parseLomiCustomerQr,
|
|
4750
|
+
retryWithBackoff,
|
|
4751
|
+
serializeLomiCustomerQr,
|
|
4752
|
+
sleep,
|
|
4753
|
+
xofToCentimes
|
|
4754
|
+
});
|