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/services/alias.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Aliases service wrapper
|
|
3
|
-
*
|
|
4
|
-
* Provides methods for managing account aliases.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```typescript
|
|
8
|
-
* // Create a SHID alias (available for all client types)
|
|
9
|
-
* const alias = await sdk.alias.create({
|
|
10
|
-
* compte: 'CIC2344256727788288822',
|
|
11
|
-
* type: AliasType.SHID
|
|
12
|
-
* });
|
|
13
|
-
* // Returns: { cle: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f', type: 'SHID', ... }
|
|
14
|
-
*
|
|
15
|
-
* // Create an MCOD alias (business clients only)
|
|
16
|
-
* const merchantAlias = await sdk.alias.create({
|
|
17
|
-
* compte: 'SNC2344256727788288822',
|
|
18
|
-
* type: AliasType.MCOD
|
|
19
|
-
* });
|
|
20
|
-
* // Returns: { cle: 'SNF00_2E4TY', type: 'MCOD', ... }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
import { BaseService } from './base';
|
|
24
|
-
import type { QueryParams } from '../query-builder';
|
|
25
|
-
import type { AliasType } from '../types/alias';
|
|
26
|
-
export declare class AliasService extends BaseService {
|
|
27
|
-
/**
|
|
28
|
-
* Create an account alias
|
|
29
|
-
*
|
|
30
|
-
* **Alias Types:**
|
|
31
|
-
* - `SHID`: System-generated unique payment address (UUID format, 36 chars). Available for all client types (P, C, B, G)
|
|
32
|
-
* - `MCOD`: Merchant code for USSD payments. Available for business clients only (C, B, G)
|
|
33
|
-
* - `MBNO`: Mobile phone number. Available for individuals only (P)
|
|
34
|
-
*
|
|
35
|
-
* **Limits:**
|
|
36
|
-
* - Default: 20 aliases per account
|
|
37
|
-
* - Limit can be increased based on client needs
|
|
38
|
-
*
|
|
39
|
-
* @param alias - Alias creation data
|
|
40
|
-
* @param alias.compte - Account number (e.g., 'CIC2344256727788288822')
|
|
41
|
-
* @param alias.type - Alias type: 'SHID', 'MCOD', or 'MBNO'
|
|
42
|
-
* @returns Created alias with generated `cle` (key) value
|
|
43
|
-
* @throws {PiSpiError} If account not found or limit exceeded
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* // For business clients (C, B, G)
|
|
48
|
-
* await sdk.alias.create({
|
|
49
|
-
* compte: 'SNC2344256727788288822',
|
|
50
|
-
* type: AliasType.SHID
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
create(alias: {
|
|
55
|
-
compte: string;
|
|
56
|
-
type: AliasType;
|
|
57
|
-
}): Promise<{
|
|
58
|
-
cle?: string;
|
|
59
|
-
type?: string;
|
|
60
|
-
compte?: string;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* List aliases for an account
|
|
64
|
-
*
|
|
65
|
-
* @param compte - Account number
|
|
66
|
-
* @param params - Query parameters for pagination
|
|
67
|
-
* @returns Paginated list of aliases
|
|
68
|
-
*/
|
|
69
|
-
list(compte: string, params?: QueryParams): Promise<unknown>;
|
|
70
|
-
/**
|
|
71
|
-
* Delete an alias
|
|
72
|
-
*
|
|
73
|
-
* @param alias - Alias identifier
|
|
74
|
-
*/
|
|
75
|
-
delete(alias: string, compte?: string): Promise<unknown>;
|
|
76
|
-
}
|
package/dist/services/alias.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Aliases service wrapper
|
|
4
|
-
*
|
|
5
|
-
* Provides methods for managing account aliases.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* // Create a SHID alias (available for all client types)
|
|
10
|
-
* const alias = await sdk.alias.create({
|
|
11
|
-
* compte: 'CIC2344256727788288822',
|
|
12
|
-
* type: AliasType.SHID
|
|
13
|
-
* });
|
|
14
|
-
* // Returns: { cle: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f', type: 'SHID', ... }
|
|
15
|
-
*
|
|
16
|
-
* // Create an MCOD alias (business clients only)
|
|
17
|
-
* const merchantAlias = await sdk.alias.create({
|
|
18
|
-
* compte: 'SNC2344256727788288822',
|
|
19
|
-
* type: AliasType.MCOD
|
|
20
|
-
* });
|
|
21
|
-
* // Returns: { cle: 'SNF00_2E4TY', type: 'MCOD', ... }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.AliasService = void 0;
|
|
26
|
-
const base_1 = require("./base");
|
|
27
|
-
class AliasService extends base_1.BaseService {
|
|
28
|
-
/**
|
|
29
|
-
* Create an account alias
|
|
30
|
-
*
|
|
31
|
-
* **Alias Types:**
|
|
32
|
-
* - `SHID`: System-generated unique payment address (UUID format, 36 chars). Available for all client types (P, C, B, G)
|
|
33
|
-
* - `MCOD`: Merchant code for USSD payments. Available for business clients only (C, B, G)
|
|
34
|
-
* - `MBNO`: Mobile phone number. Available for individuals only (P)
|
|
35
|
-
*
|
|
36
|
-
* **Limits:**
|
|
37
|
-
* - Default: 20 aliases per account
|
|
38
|
-
* - Limit can be increased based on client needs
|
|
39
|
-
*
|
|
40
|
-
* @param alias - Alias creation data
|
|
41
|
-
* @param alias.compte - Account number (e.g., 'CIC2344256727788288822')
|
|
42
|
-
* @param alias.type - Alias type: 'SHID', 'MCOD', or 'MBNO'
|
|
43
|
-
* @returns Created alias with generated `cle` (key) value
|
|
44
|
-
* @throws {PiSpiError} If account not found or limit exceeded
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* // For business clients (C, B, G)
|
|
49
|
-
* await sdk.alias.create({
|
|
50
|
-
* compte: 'SNC2344256727788288822',
|
|
51
|
-
* type: AliasType.SHID
|
|
52
|
-
* });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
async create(alias) {
|
|
56
|
-
return this.request('POST', `/comptes/${encodeURIComponent(alias.compte)}/alias`, { type: alias.type });
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* List aliases for an account
|
|
60
|
-
*
|
|
61
|
-
* @param compte - Account number
|
|
62
|
-
* @param params - Query parameters for pagination
|
|
63
|
-
* @returns Paginated list of aliases
|
|
64
|
-
*/
|
|
65
|
-
async list(compte, params) {
|
|
66
|
-
return this.request('GET', `/comptes/${encodeURIComponent(compte)}/alias`, undefined, params);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Delete an alias
|
|
70
|
-
*
|
|
71
|
-
* @param alias - Alias identifier
|
|
72
|
-
*/
|
|
73
|
-
async delete(alias, compte) {
|
|
74
|
-
if (!compte) {
|
|
75
|
-
throw new Error('Account number (compte) is required to delete an alias.');
|
|
76
|
-
}
|
|
77
|
-
return this.request('DELETE', `/comptes/${encodeURIComponent(compte)}/alias/${encodeURIComponent(alias)}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.AliasService = AliasService;
|
package/dist/services/base.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base service class with common error handling and HTTP request capability
|
|
3
|
-
*/
|
|
4
|
-
export interface ApiConfig {
|
|
5
|
-
BASE: string;
|
|
6
|
-
TOKEN?: string;
|
|
7
|
-
HEADERS?: Record<string, string>;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class BaseService {
|
|
10
|
-
protected config: ApiConfig;
|
|
11
|
-
constructor(config: ApiConfig);
|
|
12
|
-
/**
|
|
13
|
-
* Wrap an async operation with error handling
|
|
14
|
-
*/
|
|
15
|
-
protected execute<T>(operation: () => Promise<T>): Promise<T>;
|
|
16
|
-
/**
|
|
17
|
-
* Make an HTTP request
|
|
18
|
-
*/
|
|
19
|
-
protected request<T>(method: string, path: string, body?: any, params?: Record<string, any>): Promise<T>;
|
|
20
|
-
}
|
package/dist/services/base.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Base service class with common error handling and HTTP request capability
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BaseService = void 0;
|
|
7
|
-
const error_handler_1 = require("../error-handler");
|
|
8
|
-
class BaseService {
|
|
9
|
-
constructor(config) {
|
|
10
|
-
this.config = config;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Wrap an async operation with error handling
|
|
14
|
-
*/
|
|
15
|
-
async execute(operation) {
|
|
16
|
-
try {
|
|
17
|
-
return await operation();
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
throw (0, error_handler_1.handleApiError)(error);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Make an HTTP request
|
|
25
|
-
*/
|
|
26
|
-
async request(method, path, body, params) {
|
|
27
|
-
return this.execute(async () => {
|
|
28
|
-
const url = new URL(`${this.config.BASE}${path}`);
|
|
29
|
-
if (params) {
|
|
30
|
-
Object.entries(params).forEach(([key, value]) => {
|
|
31
|
-
if (value !== undefined && value !== null) {
|
|
32
|
-
url.searchParams.append(key, String(value));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const headers = {
|
|
37
|
-
'Content-Type': 'application/json',
|
|
38
|
-
'Accept': 'application/json',
|
|
39
|
-
...this.config.HEADERS,
|
|
40
|
-
};
|
|
41
|
-
if (this.config.TOKEN) {
|
|
42
|
-
headers['Authorization'] = `Bearer ${this.config.TOKEN}`;
|
|
43
|
-
}
|
|
44
|
-
const response = await fetch(url.toString(), {
|
|
45
|
-
method,
|
|
46
|
-
headers,
|
|
47
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
48
|
-
});
|
|
49
|
-
if (!response.ok) {
|
|
50
|
-
// Try to parse error body
|
|
51
|
-
let errorBody;
|
|
52
|
-
try {
|
|
53
|
-
errorBody = await response.json();
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
errorBody = { status: response.status, statusText: response.statusText };
|
|
57
|
-
}
|
|
58
|
-
throw errorBody; // Will be caught by execute/handleApiError
|
|
59
|
-
}
|
|
60
|
-
if (response.status === 204) {
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
return (await response.json());
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.BaseService = BaseService;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Accounts (Comptes) service wrapper
|
|
3
|
-
*
|
|
4
|
-
* Provides methods for managing accounts, viewing balances,
|
|
5
|
-
* listing operations, and performing intra-account transfers.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* // Get account balance and details
|
|
10
|
-
* const account = await sdk.comptes.getAccount('CIC2344256727788288822');
|
|
11
|
-
* console.log('Balance:', account.solde); // Amount in centimes
|
|
12
|
-
* console.log('Status:', account.statut); // 'OUVERT', 'BLOQUE', or 'CLOTURE'
|
|
13
|
-
*
|
|
14
|
-
* // List operations with pagination
|
|
15
|
-
* const operations = await sdk.comptes.listOperations({
|
|
16
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
17
|
-
* page: 1,
|
|
18
|
-
* size: 20
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import { BaseService } from './base';
|
|
23
|
-
import type { QueryParams } from '../query-builder';
|
|
24
|
-
export declare class ComptesService extends BaseService {
|
|
25
|
-
/**
|
|
26
|
-
* Get account details and balance
|
|
27
|
-
*
|
|
28
|
-
* **Returns:**
|
|
29
|
-
* - Account type (CACC, SVGS, etc.)
|
|
30
|
-
* - Account number
|
|
31
|
-
* - Current balance (`solde` in centimes)
|
|
32
|
-
* - Account status (OUVERT, BLOQUE, CLOTURE)
|
|
33
|
-
* - Opening date
|
|
34
|
-
* - Pre-confirmation indicator
|
|
35
|
-
*
|
|
36
|
-
* @param numero - Account number (e.g., 'CIC2344256727788288822')
|
|
37
|
-
* @returns Account details including balance
|
|
38
|
-
* @throws {PiSpiNotFoundError} If account not found
|
|
39
|
-
* @throws {PiSpiAuthError} If authentication fails
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const account = await sdk.comptes.getAccount('CIC2344256727788288822');
|
|
44
|
-
* // Returns: {
|
|
45
|
-
* // type: 'CACC',
|
|
46
|
-
* // numero: 'CIC2344256727788288822',
|
|
47
|
-
* // solde: 150000000, // 1,500,000 XOF in centimes
|
|
48
|
-
* // statut: 'OUVERT',
|
|
49
|
-
* // dateOuverture: '2023-02-21T15:30:01.250Z'
|
|
50
|
-
* // }
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
getAccount(numero: string): Promise<never>;
|
|
54
|
-
/**
|
|
55
|
-
* List account operations (transactions)
|
|
56
|
-
*
|
|
57
|
-
* **Filtering Options:**
|
|
58
|
-
* - Filter by account number (`comptePayeur`, `comptePaye`)
|
|
59
|
-
* - Filter by status (`statut`: INITIE, ENVOYE, IRREVOCABLE, REJETE)
|
|
60
|
-
* - Filter by dates (`dateEnvoi`, `dateIrrevocabilite`)
|
|
61
|
-
* - Use QueryBuilder for advanced filtering
|
|
62
|
-
*
|
|
63
|
-
* @param params - Query parameters for filtering and pagination
|
|
64
|
-
* @param params.comptePayeur - Filter by payer account number
|
|
65
|
-
* @param params.comptePaye - Filter by payee account number
|
|
66
|
-
* @param params.statut - Filter by transaction status
|
|
67
|
-
* @param params.dateEnvoi - Filter by send date
|
|
68
|
-
* @param params.dateIrrevocabilite - Filter by irrevocability date
|
|
69
|
-
* @param params.page - Page number (default: 1)
|
|
70
|
-
* @param params.size - Page size (default: 20, max: 100)
|
|
71
|
-
* @returns Paginated list of operations
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* // List all operations for an account
|
|
76
|
-
* const operations = await sdk.comptes.listOperations({
|
|
77
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
78
|
-
* page: 1,
|
|
79
|
-
* size: 20
|
|
80
|
-
* });
|
|
81
|
-
*
|
|
82
|
-
* // Filter by status
|
|
83
|
-
* const completed = await sdk.comptes.listOperations({
|
|
84
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
85
|
-
* statut: 'IRREVOCABLE'
|
|
86
|
-
* });
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
listOperations(params?: QueryParams & {
|
|
90
|
-
comptePayeur?: string;
|
|
91
|
-
comptePaye?: string;
|
|
92
|
-
statut?: string;
|
|
93
|
-
dateEnvoi?: string;
|
|
94
|
-
dateIrrevocabilite?: string;
|
|
95
|
-
}): Promise<never>;
|
|
96
|
-
/**
|
|
97
|
-
* Transfer funds between accounts owned by the same client
|
|
98
|
-
*
|
|
99
|
-
* **Intra-Account Transfer:**
|
|
100
|
-
* - Transfers between accounts owned by the same legal entity
|
|
101
|
-
* - Accounts must be at the same financial institution
|
|
102
|
-
* - Can use account numbers or aliases
|
|
103
|
-
*
|
|
104
|
-
* **Transfer Methods:**
|
|
105
|
-
* - Using account numbers: `comptePayeur` and `comptePaye`
|
|
106
|
-
* - Using aliases: `payeurAlias` and `payeAlias`
|
|
107
|
-
*
|
|
108
|
-
* @param transfer - Transfer request details
|
|
109
|
-
* @param transfer.comptePayeur - Payer account number (if using account numbers)
|
|
110
|
-
* @param transfer.comptePaye - Payee account number (if using account numbers)
|
|
111
|
-
* @param transfer.payeurAlias - Payer alias (if using aliases)
|
|
112
|
-
* @param transfer.payeAlias - Payee alias (if using aliases)
|
|
113
|
-
* @param transfer.montant - Amount in centimes (e.g., 150000 = 1,500 XOF)
|
|
114
|
-
* @param transfer.motif - Transfer reason/description
|
|
115
|
-
* @param transfer.txId - Unique transaction ID (optional, auto-generated if not provided)
|
|
116
|
-
* @returns Transfer response with status
|
|
117
|
-
* @throws {PiSpiValidationError} If transfer fails validation
|
|
118
|
-
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* // Transfer using account numbers
|
|
123
|
-
* await sdk.comptes.transfer({
|
|
124
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
125
|
-
* comptePaye: 'SNC2344256727788288822',
|
|
126
|
-
* montant: 150000, // 1,500 XOF
|
|
127
|
-
* motif: 'Transfert de fonds',
|
|
128
|
-
* txId: '23511722'
|
|
129
|
-
* });
|
|
130
|
-
*
|
|
131
|
-
* // Transfer using aliases
|
|
132
|
-
* await sdk.comptes.transfer({
|
|
133
|
-
* payeurAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f',
|
|
134
|
-
* payeAlias: '4r5ty499-3e50-435b-b757-ac7a83d67juio',
|
|
135
|
-
* montant: 150000,
|
|
136
|
-
* motif: 'Transfert entre comptes'
|
|
137
|
-
* });
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
transfer(transfer: {
|
|
141
|
-
comptePayeur?: string;
|
|
142
|
-
comptePaye?: string;
|
|
143
|
-
payeurAlias?: string;
|
|
144
|
-
payeAlias?: string;
|
|
145
|
-
montant: number;
|
|
146
|
-
motif?: string;
|
|
147
|
-
txId?: string;
|
|
148
|
-
}): Promise<never>;
|
|
149
|
-
}
|
package/dist/services/comptes.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Accounts (Comptes) service wrapper
|
|
4
|
-
*
|
|
5
|
-
* Provides methods for managing accounts, viewing balances,
|
|
6
|
-
* listing operations, and performing intra-account transfers.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* // Get account balance and details
|
|
11
|
-
* const account = await sdk.comptes.getAccount('CIC2344256727788288822');
|
|
12
|
-
* console.log('Balance:', account.solde); // Amount in centimes
|
|
13
|
-
* console.log('Status:', account.statut); // 'OUVERT', 'BLOQUE', or 'CLOTURE'
|
|
14
|
-
*
|
|
15
|
-
* // List operations with pagination
|
|
16
|
-
* const operations = await sdk.comptes.listOperations({
|
|
17
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
18
|
-
* page: 1,
|
|
19
|
-
* size: 20
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.ComptesService = void 0;
|
|
25
|
-
const base_1 = require("./base");
|
|
26
|
-
// Import generated types and services
|
|
27
|
-
// These will be available after running the generate script
|
|
28
|
-
// import { CompteSolde, CompteTransfertIntraRequest, CompteTransfertIntraReponse } from '../generated';
|
|
29
|
-
// import { DefaultService } from '../generated/services/DefaultService';
|
|
30
|
-
class ComptesService extends base_1.BaseService {
|
|
31
|
-
/**
|
|
32
|
-
* Get account details and balance
|
|
33
|
-
*
|
|
34
|
-
* **Returns:**
|
|
35
|
-
* - Account type (CACC, SVGS, etc.)
|
|
36
|
-
* - Account number
|
|
37
|
-
* - Current balance (`solde` in centimes)
|
|
38
|
-
* - Account status (OUVERT, BLOQUE, CLOTURE)
|
|
39
|
-
* - Opening date
|
|
40
|
-
* - Pre-confirmation indicator
|
|
41
|
-
*
|
|
42
|
-
* @param numero - Account number (e.g., 'CIC2344256727788288822')
|
|
43
|
-
* @returns Account details including balance
|
|
44
|
-
* @throws {PiSpiNotFoundError} If account not found
|
|
45
|
-
* @throws {PiSpiAuthError} If authentication fails
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const account = await sdk.comptes.getAccount('CIC2344256727788288822');
|
|
50
|
-
* // Returns: {
|
|
51
|
-
* // type: 'CACC',
|
|
52
|
-
* // numero: 'CIC2344256727788288822',
|
|
53
|
-
* // solde: 150000000, // 1,500,000 XOF in centimes
|
|
54
|
-
* // statut: 'OUVERT',
|
|
55
|
-
* // dateOuverture: '2023-02-21T15:30:01.250Z'
|
|
56
|
-
* // }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
async getAccount(numero) {
|
|
60
|
-
return this.execute(async () => {
|
|
61
|
-
// This will call the generated service after codegen
|
|
62
|
-
// return await DefaultService.compteSoldeConsulter({ numero });
|
|
63
|
-
throw new Error('Service not yet generated. Run "pnpm run generate" first.');
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* List account operations (transactions)
|
|
68
|
-
*
|
|
69
|
-
* **Filtering Options:**
|
|
70
|
-
* - Filter by account number (`comptePayeur`, `comptePaye`)
|
|
71
|
-
* - Filter by status (`statut`: INITIE, ENVOYE, IRREVOCABLE, REJETE)
|
|
72
|
-
* - Filter by dates (`dateEnvoi`, `dateIrrevocabilite`)
|
|
73
|
-
* - Use QueryBuilder for advanced filtering
|
|
74
|
-
*
|
|
75
|
-
* @param params - Query parameters for filtering and pagination
|
|
76
|
-
* @param params.comptePayeur - Filter by payer account number
|
|
77
|
-
* @param params.comptePaye - Filter by payee account number
|
|
78
|
-
* @param params.statut - Filter by transaction status
|
|
79
|
-
* @param params.dateEnvoi - Filter by send date
|
|
80
|
-
* @param params.dateIrrevocabilite - Filter by irrevocability date
|
|
81
|
-
* @param params.page - Page number (default: 1)
|
|
82
|
-
* @param params.size - Page size (default: 20, max: 100)
|
|
83
|
-
* @returns Paginated list of operations
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```typescript
|
|
87
|
-
* // List all operations for an account
|
|
88
|
-
* const operations = await sdk.comptes.listOperations({
|
|
89
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
90
|
-
* page: 1,
|
|
91
|
-
* size: 20
|
|
92
|
-
* });
|
|
93
|
-
*
|
|
94
|
-
* // Filter by status
|
|
95
|
-
* const completed = await sdk.comptes.listOperations({
|
|
96
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
97
|
-
* statut: 'IRREVOCABLE'
|
|
98
|
-
* });
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
async listOperations(params) {
|
|
102
|
-
return this.execute(async () => {
|
|
103
|
-
// This will call the generated service after codegen
|
|
104
|
-
// return await DefaultService.compteTransfertIntraLister(params);
|
|
105
|
-
throw new Error('Service not yet generated. Run "pnpm run generate" first.');
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Transfer funds between accounts owned by the same client
|
|
110
|
-
*
|
|
111
|
-
* **Intra-Account Transfer:**
|
|
112
|
-
* - Transfers between accounts owned by the same legal entity
|
|
113
|
-
* - Accounts must be at the same financial institution
|
|
114
|
-
* - Can use account numbers or aliases
|
|
115
|
-
*
|
|
116
|
-
* **Transfer Methods:**
|
|
117
|
-
* - Using account numbers: `comptePayeur` and `comptePaye`
|
|
118
|
-
* - Using aliases: `payeurAlias` and `payeAlias`
|
|
119
|
-
*
|
|
120
|
-
* @param transfer - Transfer request details
|
|
121
|
-
* @param transfer.comptePayeur - Payer account number (if using account numbers)
|
|
122
|
-
* @param transfer.comptePaye - Payee account number (if using account numbers)
|
|
123
|
-
* @param transfer.payeurAlias - Payer alias (if using aliases)
|
|
124
|
-
* @param transfer.payeAlias - Payee alias (if using aliases)
|
|
125
|
-
* @param transfer.montant - Amount in centimes (e.g., 150000 = 1,500 XOF)
|
|
126
|
-
* @param transfer.motif - Transfer reason/description
|
|
127
|
-
* @param transfer.txId - Unique transaction ID (optional, auto-generated if not provided)
|
|
128
|
-
* @returns Transfer response with status
|
|
129
|
-
* @throws {PiSpiValidationError} If transfer fails validation
|
|
130
|
-
* @throws {PiSpiError} If account blocked or insufficient funds
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
* // Transfer using account numbers
|
|
135
|
-
* await sdk.comptes.transfer({
|
|
136
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
137
|
-
* comptePaye: 'SNC2344256727788288822',
|
|
138
|
-
* montant: 150000, // 1,500 XOF
|
|
139
|
-
* motif: 'Transfert de fonds',
|
|
140
|
-
* txId: '23511722'
|
|
141
|
-
* });
|
|
142
|
-
*
|
|
143
|
-
* // Transfer using aliases
|
|
144
|
-
* await sdk.comptes.transfer({
|
|
145
|
-
* payeurAlias: '8b1b2499-3e50-435b-b757-ac7a83d8aa7f',
|
|
146
|
-
* payeAlias: '4r5ty499-3e50-435b-b757-ac7a83d67juio',
|
|
147
|
-
* montant: 150000,
|
|
148
|
-
* motif: 'Transfert entre comptes'
|
|
149
|
-
* });
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
async transfer(transfer) {
|
|
153
|
-
return this.execute(async () => {
|
|
154
|
-
// This will call the generated service after codegen
|
|
155
|
-
// return await DefaultService.compteTransfertIntraCreer({
|
|
156
|
-
// requestBody: transfer
|
|
157
|
-
// });
|
|
158
|
-
throw new Error('Service not yet generated. Run "pnpm run generate" first.');
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
exports.ComptesService = ComptesService;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cancellation Requests (Demandes d'Annulation) service wrapper
|
|
3
|
-
*
|
|
4
|
-
* Provides methods for requesting cancellation of sent payments.
|
|
5
|
-
*
|
|
6
|
-
* **Cancellation Rules:**
|
|
7
|
-
* - Can only request cancellation of payments sent by the business
|
|
8
|
-
* - Must be requested within 90 days of original payment
|
|
9
|
-
* - Payee must accept the cancellation for funds to be returned
|
|
10
|
-
* - Payee can reject the cancellation request
|
|
11
|
-
* - Multiple cancellation requests can be sent for the same payment
|
|
12
|
-
*
|
|
13
|
-
* **Cancellation Flow:**
|
|
14
|
-
* 1. Business requests cancellation of a sent payment
|
|
15
|
-
* 2. Payee receives cancellation request
|
|
16
|
-
* 3. Payee can accept (triggers fund return) or reject
|
|
17
|
-
* 4. Business receives notification of payee's decision
|
|
18
|
-
*
|
|
19
|
-
* **Use Cases:**
|
|
20
|
-
* - Payment sent to wrong recipient
|
|
21
|
-
* - Duplicate payment
|
|
22
|
-
* - Service cancellation
|
|
23
|
-
* - Agreement cancellation
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* // Request cancellation of a sent payment
|
|
28
|
-
* const cancellation = await sdk.demandesAnnulation.create({
|
|
29
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
30
|
-
* txId: '23552722', // Original payment transaction ID
|
|
31
|
-
* motif: 'CUST' // Cancellation reason code
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
import { BaseService } from './base';
|
|
36
|
-
import type { QueryParams } from '../query-builder';
|
|
37
|
-
export declare class DemandesAnnulationService extends BaseService {
|
|
38
|
-
/**
|
|
39
|
-
* Create a cancellation request
|
|
40
|
-
*
|
|
41
|
-
* **Cancellation Process:**
|
|
42
|
-
* 1. Business identifies payment to cancel
|
|
43
|
-
* 2. Creates cancellation request (must be within 90 days)
|
|
44
|
-
* 3. Payee receives cancellation request
|
|
45
|
-
* 4. Payee accepts or rejects
|
|
46
|
-
* 5. If accepted, funds are returned via fund return mechanism
|
|
47
|
-
*
|
|
48
|
-
* **Status Values:**
|
|
49
|
-
* - `INITIE`: Cancellation request sent, awaiting payee response
|
|
50
|
-
* - `ACCEPTE`: Payee accepted cancellation (funds returned)
|
|
51
|
-
* - `REJETE`: Payee rejected cancellation request
|
|
52
|
-
*
|
|
53
|
-
* **Rejection Reasons:**
|
|
54
|
-
* - `CUST`: Customer rejection (payee refuses cancellation)
|
|
55
|
-
* - `AM09`: Wrong amount
|
|
56
|
-
* - `AC06`: Blocked account
|
|
57
|
-
* - `FR01`: Fraud suspicion
|
|
58
|
-
*
|
|
59
|
-
* @param request - Cancellation request data
|
|
60
|
-
* @param request.comptePayeur - Business account number (original payer)
|
|
61
|
-
* @param request.txId - Original payment transaction ID to cancel
|
|
62
|
-
* @param request.motif - Cancellation reason code (e.g., 'CUST' for customer request)
|
|
63
|
-
* @returns Cancellation request response
|
|
64
|
-
* @throws {PiSpiValidationError} If cancellation fails validation (e.g., > 90 days, invalid txId)
|
|
65
|
-
* @throws {PiSpiNotFoundError} If payment not found
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* // Request cancellation
|
|
70
|
-
* await sdk.demandesAnnulation.create({
|
|
71
|
-
* comptePayeur: 'CIC2344256727788288822',
|
|
72
|
-
* txId: '23552722', // Payment to cancel
|
|
73
|
-
* motif: 'CUST' // Customer request
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
create(request: {
|
|
78
|
-
comptePayeur: string;
|
|
79
|
-
txId: string;
|
|
80
|
-
motif: string;
|
|
81
|
-
}): Promise<never>;
|
|
82
|
-
/**
|
|
83
|
-
* Get cancellation request details by transaction ID
|
|
84
|
-
*
|
|
85
|
-
* @param id - Cancellation request transaction ID
|
|
86
|
-
* @returns Cancellation request details
|
|
87
|
-
* @throws {PiSpiNotFoundError} If cancellation request not found
|
|
88
|
-
*/
|
|
89
|
-
get(id: string): Promise<never>;
|
|
90
|
-
/**
|
|
91
|
-
* List cancellation requests with filtering and pagination
|
|
92
|
-
*
|
|
93
|
-
* @param params - Query parameters for filtering and pagination
|
|
94
|
-
* @returns Paginated list of cancellation requests
|
|
95
|
-
*/
|
|
96
|
-
list(params?: QueryParams): Promise<never>;
|
|
97
|
-
}
|