@spreeloop/orange_money 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/logging/src/log_level.d.ts +24 -0
- package/dist/logging/src/log_level.d.ts.map +1 -0
- package/dist/logging/src/log_level.js +34 -0
- package/dist/logging/src/log_level.js.map +1 -0
- package/dist/logging/src/logging.d.ts +50 -0
- package/dist/logging/src/logging.d.ts.map +1 -0
- package/dist/logging/src/logging.js +87 -0
- package/dist/logging/src/logging.js.map +1 -0
- package/dist/logging/src/printer.d.ts +10 -0
- package/dist/logging/src/printer.d.ts.map +1 -0
- package/dist/logging/src/printer.js +3 -0
- package/dist/logging/src/printer.js.map +1 -0
- package/dist/orange_money/index.d.ts +2 -0
- package/dist/orange_money/index.d.ts.map +1 -0
- package/dist/orange_money/index.js +18 -0
- package/dist/orange_money/index.js.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts +62 -0
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.js +84 -0
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.js.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/src/live.d.ts +40 -0
- package/dist/orange_money/src/disbursements/implementations/src/live.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/src/live.js +61 -0
- package/dist/orange_money/src/disbursements/implementations/src/live.js.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts +40 -0
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.js +110 -0
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts +28 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.js +45 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts +2 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js +106 -0
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts +114 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.js +128 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts +2 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js +148 -0
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/transfer.d.ts +44 -0
- package/dist/orange_money/src/disbursements/operations/transfer.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/transfer.js +74 -0
- package/dist/orange_money/src/disbursements/operations/transfer.js.map +1 -0
- package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts +2 -0
- package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/operations/transfer.spec.js +178 -0
- package/dist/orange_money/src/disbursements/operations/transfer.spec.js.map +1 -0
- package/dist/orange_money/src/disbursements/routes/routes.d.ts +38 -0
- package/dist/orange_money/src/disbursements/routes/routes.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/routes/routes.js +53 -0
- package/dist/orange_money/src/disbursements/routes/routes.js.map +1 -0
- package/dist/orange_money/src/disbursements/utils/constants.d.ts +5 -0
- package/dist/orange_money/src/disbursements/utils/constants.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/constants.js +9 -0
- package/dist/orange_money/src/disbursements/utils/constants.js.map +1 -0
- package/{src/disbursements/utils/regex.ts → dist/orange_money/src/disbursements/utils/regex.d.ts} +3 -4
- package/dist/orange_money/src/disbursements/utils/regex.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/regex.js +12 -0
- package/dist/orange_money/src/disbursements/utils/regex.js.map +1 -0
- package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts +2 -0
- package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/regex.spec.js +32 -0
- package/dist/orange_money/src/disbursements/utils/regex.spec.js.map +1 -0
- package/dist/orange_money/src/disbursements/utils/status.d.ts +53 -0
- package/dist/orange_money/src/disbursements/utils/status.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/status.js +58 -0
- package/dist/orange_money/src/disbursements/utils/status.js.map +1 -0
- package/dist/orange_money/src/disbursements/utils/utils.d.ts +9 -0
- package/dist/orange_money/src/disbursements/utils/utils.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/utils.js +26 -0
- package/dist/orange_money/src/disbursements/utils/utils.js.map +1 -0
- package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts +2 -0
- package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts.map +1 -0
- package/dist/orange_money/src/disbursements/utils/utils.spec.js +43 -0
- package/dist/orange_money/src/disbursements/utils/utils.spec.js.map +1 -0
- package/{src/index.ts → dist/orange_money/src/index.d.ts} +3 -8
- package/dist/orange_money/src/index.d.ts.map +1 -0
- package/dist/orange_money/src/index.js +15 -0
- package/dist/orange_money/src/index.js.map +1 -0
- package/dist/orange_money/src/payments/implementations/fake.d.ts +33 -0
- package/dist/orange_money/src/payments/implementations/fake.d.ts.map +1 -0
- package/dist/orange_money/src/payments/implementations/fake.js +110 -0
- package/dist/orange_money/src/payments/implementations/fake.js.map +1 -0
- package/dist/orange_money/src/payments/implementations/live.d.ts +45 -0
- package/dist/orange_money/src/payments/implementations/live.d.ts.map +1 -0
- package/dist/orange_money/src/payments/implementations/live.js +69 -0
- package/dist/orange_money/src/payments/implementations/live.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_access_token.d.ts +11 -0
- package/dist/orange_money/src/payments/operations/get_access_token.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_access_token.js +47 -0
- package/dist/orange_money/src/payments/operations/get_access_token.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts +2 -0
- package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_access_token.spec.js +74 -0
- package/dist/orange_money/src/payments/operations/get_access_token.spec.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.d.ts +12 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.js +43 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts +2 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.js +74 -0
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.d.ts +23 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.js +51 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.js.map +1 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts +2 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.js +101 -0
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.js.map +1 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts +22 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.js +124 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.js.map +1 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts +2 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts.map +1 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js +245 -0
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js.map +1 -0
- package/dist/orange_money/src/payments/payments.d.ts +57 -0
- package/dist/orange_money/src/payments/payments.d.ts.map +1 -0
- package/dist/orange_money/src/payments/payments.js +36 -0
- package/dist/orange_money/src/payments/payments.js.map +1 -0
- package/dist/orange_money/src/payments/routes/routes.d.ts +48 -0
- package/dist/orange_money/src/payments/routes/routes.d.ts.map +1 -0
- package/dist/orange_money/src/payments/routes/routes.js +61 -0
- package/dist/orange_money/src/payments/routes/routes.js.map +1 -0
- package/dist/orange_money/src/payments/utils/constants.d.ts +96 -0
- package/dist/orange_money/src/payments/utils/constants.d.ts.map +1 -0
- package/dist/orange_money/src/payments/utils/constants.js +112 -0
- package/dist/orange_money/src/payments/utils/constants.js.map +1 -0
- package/dist/orange_money/src/payments/utils/joi_schema.d.ts +70 -0
- package/dist/orange_money/src/payments/utils/joi_schema.d.ts.map +1 -0
- package/dist/orange_money/src/payments/utils/joi_schema.js +44 -0
- package/dist/orange_money/src/payments/utils/joi_schema.js.map +1 -0
- package/dist/orange_money/src/payments/utils/request_model.d.ts +75 -0
- package/dist/orange_money/src/payments/utils/request_model.d.ts.map +1 -0
- package/dist/orange_money/src/payments/utils/request_model.js +3 -0
- package/dist/orange_money/src/payments/utils/request_model.js.map +1 -0
- package/dist/orange_money/src/payments/utils/utils.d.ts +15 -0
- package/dist/orange_money/src/payments/utils/utils.d.ts.map +1 -0
- package/dist/orange_money/src/payments/utils/utils.js +27 -0
- package/dist/orange_money/src/payments/utils/utils.js.map +1 -0
- package/dist/orange_money/src/utils/https.d.ts +77 -0
- package/dist/orange_money/src/utils/https.d.ts.map +1 -0
- package/dist/orange_money/src/utils/https.js +240 -0
- package/dist/orange_money/src/utils/https.js.map +1 -0
- package/dist/orange_money/src/utils/https.spec.d.ts +2 -0
- package/dist/orange_money/src/utils/https.spec.d.ts.map +1 -0
- package/dist/orange_money/src/utils/https.spec.js +77 -0
- package/dist/orange_money/src/utils/https.spec.js.map +1 -0
- package/dist/orange_money/src/utils/logging_interface.d.ts +23 -0
- package/dist/orange_money/src/utils/logging_interface.d.ts.map +1 -0
- package/dist/orange_money/src/utils/logging_interface.js +3 -0
- package/dist/orange_money/src/utils/logging_interface.js.map +1 -0
- package/{src/utils/operation_response.ts → dist/orange_money/src/utils/operation_response.d.ts} +9 -10
- package/dist/orange_money/src/utils/operation_response.d.ts.map +1 -0
- package/dist/orange_money/src/utils/operation_response.js +3 -0
- package/dist/orange_money/src/utils/operation_response.js.map +1 -0
- package/dist/orange_money/src/utils/utils.d.ts +6 -0
- package/dist/orange_money/src/utils/utils.d.ts.map +1 -0
- package/dist/orange_money/src/utils/utils.js +10 -0
- package/dist/orange_money/src/utils/utils.js.map +1 -0
- package/package.json +6 -2
- package/.eslintrc.js +0 -47
- package/.prettierrc +0 -6
- package/babel.config.js +0 -3
- package/index.spec.ts +0 -9
- package/index.ts +0 -1
- package/jest.before-test.ts +0 -3
- package/jest.config.ts +0 -54
- package/src/disbursements/implementations/disbursement_service.ts +0 -133
- package/src/disbursements/implementations/src/live.ts +0 -79
- package/src/disbursements/implementations/src/sandbox.ts +0 -124
- package/src/disbursements/operations/create_access_token.spec.ts +0 -87
- package/src/disbursements/operations/create_access_token.ts +0 -83
- package/src/disbursements/operations/get_transfer_status.spec.ts +0 -132
- package/src/disbursements/operations/get_transfer_status.ts +0 -265
- package/src/disbursements/operations/transfer.spec.ts +0 -158
- package/src/disbursements/operations/transfer.ts +0 -125
- package/src/disbursements/routes/routes.ts +0 -54
- package/src/disbursements/utils/constants.ts +0 -4
- package/src/disbursements/utils/regex.spec.ts +0 -39
- package/src/disbursements/utils/status.ts +0 -62
- package/src/disbursements/utils/utils.spec.ts +0 -42
- package/src/disbursements/utils/utils.ts +0 -24
- package/src/payments/implementations/fake.ts +0 -133
- package/src/payments/implementations/live.ts +0 -87
- package/src/payments/operations/get_access_token.spec.ts +0 -60
- package/src/payments/operations/get_access_token.ts +0 -77
- package/src/payments/operations/get_pay_token.spec.ts +0 -65
- package/src/payments/operations/get_pay_token.ts +0 -66
- package/src/payments/operations/get_payment_status.spec.ts +0 -82
- package/src/payments/operations/get_payment_status.ts +0 -78
- package/src/payments/operations/initialize_om_payment.spec.ts +0 -234
- package/src/payments/operations/initialize_om_payment.ts +0 -191
- package/src/payments/payments.ts +0 -86
- package/src/payments/routes/routes.ts +0 -61
- package/src/payments/utils/constants.ts +0 -120
- package/src/payments/utils/joi_schema.ts +0 -117
- package/src/payments/utils/request_model.ts +0 -103
- package/src/payments/utils/utils.ts +0 -31
- package/src/utils/https.spec.ts +0 -101
- package/src/utils/https.ts +0 -266
- package/src/utils/logging_interface.ts +0 -25
- package/src/utils/utils.ts +0 -5
- package/tsconfig.build.json +0 -4
- package/tsconfig.dev.json +0 -4
- package/tsconfig.json +0 -27
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import Joi from 'joi';
|
|
2
|
-
import { DisbursementXTargetEnvironmentType } from '../utils/constants';
|
|
3
|
-
import { LoggerInterface } from '../../utils/logging_interface';
|
|
4
|
-
import { merchantPhoneNumberRegex } from '../utils/regex';
|
|
5
|
-
import { CreateAccessTokenResponse } from '../operations/create_access_token';
|
|
6
|
-
import { TransferRequest, TransferResponse } from '../operations/transfer';
|
|
7
|
-
import {
|
|
8
|
-
GetTransferStatusRequest,
|
|
9
|
-
GetTransferStatusResponse,
|
|
10
|
-
} from '../operations/get_transfer_status';
|
|
11
|
-
import { DisbursementLive } from './src/live';
|
|
12
|
-
import { DisbursementFake } from './src/sandbox';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Interface for DisbursementServiceConfig.
|
|
16
|
-
*/
|
|
17
|
-
export interface DisbursementServiceConfig {
|
|
18
|
-
clientId: string;
|
|
19
|
-
clientSecret: string;
|
|
20
|
-
customerKey: string;
|
|
21
|
-
customerSecret: string;
|
|
22
|
-
channelUserMsisdn: string;
|
|
23
|
-
pin: string;
|
|
24
|
-
environment: DisbursementXTargetEnvironmentType;
|
|
25
|
-
logger: LoggerInterface;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Joi schema for DisbursementServiceConfigSchema.
|
|
30
|
-
*/
|
|
31
|
-
export const DisbursementServiceConfigSchema =
|
|
32
|
-
Joi.object<DisbursementServiceConfig>({
|
|
33
|
-
clientId: Joi.string().required().messages({
|
|
34
|
-
'string.base': '"clientId" should be a type of \'text\'',
|
|
35
|
-
'string.empty': '"clientId" cannot be an empty field',
|
|
36
|
-
'any.required': '"clientId" is a required field',
|
|
37
|
-
}),
|
|
38
|
-
clientSecret: Joi.string().required().messages({
|
|
39
|
-
'string.base': '"clientSecret" should be a type of \'text\'',
|
|
40
|
-
'string.empty': '"clientSecret" cannot be an empty field',
|
|
41
|
-
'any.required': '"clientSecret" is a required field',
|
|
42
|
-
}),
|
|
43
|
-
customerKey: Joi.string().required().messages({
|
|
44
|
-
'string.base': '"customerKey" should be a type of \'text\'',
|
|
45
|
-
'string.empty': '"customerKey" cannot be an empty field',
|
|
46
|
-
'any.required': '"customerKey" is a required field',
|
|
47
|
-
}),
|
|
48
|
-
customerSecret: Joi.string().required().messages({
|
|
49
|
-
'string.base': '"customerSecret" should be a type of \'text\'',
|
|
50
|
-
'string.empty': '"customerSecret" cannot be an empty field',
|
|
51
|
-
'any.required': '"customerSecret" is a required field',
|
|
52
|
-
}),
|
|
53
|
-
channelUserMsisdn: Joi.string()
|
|
54
|
-
.pattern(merchantPhoneNumberRegex)
|
|
55
|
-
.required()
|
|
56
|
-
.messages({
|
|
57
|
-
'string.base': '"channelUserMsisdn" should be a type of \'text\'',
|
|
58
|
-
'string.empty': '"channelUserMsisdn" cannot be an empty field',
|
|
59
|
-
'any.required': '"channelUserMsisdn" is a required field',
|
|
60
|
-
}),
|
|
61
|
-
pin: Joi.string().required().messages({
|
|
62
|
-
'string.base': '"pin" should be a type of \'text\'',
|
|
63
|
-
'string.empty': '"pin" cannot be an empty field',
|
|
64
|
-
'any.required': '"pin" is a required field',
|
|
65
|
-
}),
|
|
66
|
-
environment: Joi.string()
|
|
67
|
-
.valid(...Object.values(DisbursementXTargetEnvironmentType))
|
|
68
|
-
.required()
|
|
69
|
-
.messages({
|
|
70
|
-
'string.base': '"environment" should be a type of \'text\'',
|
|
71
|
-
'string.empty': '"environment" cannot be an empty field',
|
|
72
|
-
'any.required': '"environment" is a required field',
|
|
73
|
-
}),
|
|
74
|
-
logger: Joi.object().required().messages({
|
|
75
|
-
'string.base': '"logger" should be a type of \'object\'',
|
|
76
|
-
'string.empty': '"logger" cannot be an empty field',
|
|
77
|
-
'any.required': '"logger" is a required field',
|
|
78
|
-
}),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Orange Money API Disbursement.
|
|
83
|
-
* @class
|
|
84
|
-
*/
|
|
85
|
-
export interface DisbursementInterface {
|
|
86
|
-
/**
|
|
87
|
-
* Creates an access token.
|
|
88
|
-
*
|
|
89
|
-
* @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
|
|
90
|
-
*/
|
|
91
|
-
createAccessToken(): Promise<CreateAccessTokenResponse>;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Transfers the specified amount of money from one account to another.
|
|
95
|
-
*
|
|
96
|
-
* @param {TransferRequest} params - The parameters for the transfer.
|
|
97
|
-
* @return {Promise<TransferResponse>} - The response from the transfer method.
|
|
98
|
-
*/
|
|
99
|
-
transfer(params: TransferRequest): Promise<TransferResponse>;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Retrieves the status of a transfer.
|
|
103
|
-
*
|
|
104
|
-
* @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
|
|
105
|
-
* @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
|
|
106
|
-
*/
|
|
107
|
-
getTransferStatus(
|
|
108
|
-
params: GetTransferStatusRequest
|
|
109
|
-
): Promise<GetTransferStatusResponse>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Orange Money API Disbursement.
|
|
114
|
-
* @class
|
|
115
|
-
*/
|
|
116
|
-
export class Disbursement {
|
|
117
|
-
/**
|
|
118
|
-
* Creates a new Disbursement object based on the provided configuration.
|
|
119
|
-
*
|
|
120
|
-
* @param {DisbursementServiceConfig} config - The configuration for the Disbursement object.
|
|
121
|
-
* @return {Disbursement} A new Disbursement object based on the provided configuration.
|
|
122
|
-
*/
|
|
123
|
-
static createDisbursement(
|
|
124
|
-
config: DisbursementServiceConfig
|
|
125
|
-
): DisbursementInterface {
|
|
126
|
-
switch (config.environment) {
|
|
127
|
-
case DisbursementXTargetEnvironmentType.prod:
|
|
128
|
-
return new DisbursementLive(config);
|
|
129
|
-
case DisbursementXTargetEnvironmentType.sandbox:
|
|
130
|
-
return new DisbursementFake(config);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TransferRequest,
|
|
3
|
-
TransferResponse,
|
|
4
|
-
transfer,
|
|
5
|
-
} from '../../operations/transfer';
|
|
6
|
-
import {
|
|
7
|
-
CreateAccessTokenResponse,
|
|
8
|
-
createAccessToken,
|
|
9
|
-
} from '../../operations/create_access_token';
|
|
10
|
-
import { Routes } from '../../routes/routes';
|
|
11
|
-
import {
|
|
12
|
-
DisbursementInterface,
|
|
13
|
-
DisbursementServiceConfig,
|
|
14
|
-
} from '../disbursement_service';
|
|
15
|
-
import {
|
|
16
|
-
GetTransferStatusRequest,
|
|
17
|
-
GetTransferStatusResponse,
|
|
18
|
-
getTransferStatus,
|
|
19
|
-
} from '../../operations/get_transfer_status';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Orange Money API Live Disbursement.
|
|
23
|
-
* @class
|
|
24
|
-
*/
|
|
25
|
-
export class DisbursementLive implements DisbursementInterface {
|
|
26
|
-
protected readonly config: DisbursementServiceConfig;
|
|
27
|
-
protected readonly routes: Routes;
|
|
28
|
-
/**
|
|
29
|
-
* Constructs a new {Disbursement}.
|
|
30
|
-
* @constructor
|
|
31
|
-
* @param {DisbursementServiceConfig} config - The required global route configuration.
|
|
32
|
-
*/
|
|
33
|
-
constructor(config: DisbursementServiceConfig) {
|
|
34
|
-
this.routes = new Routes();
|
|
35
|
-
this.config = config;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Creates an access token.
|
|
40
|
-
*
|
|
41
|
-
* @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
|
|
42
|
-
*/
|
|
43
|
-
async createAccessToken(): Promise<CreateAccessTokenResponse> {
|
|
44
|
-
return await createAccessToken({
|
|
45
|
-
configs: this.config,
|
|
46
|
-
endPoint: this.routes.createAccessToken(),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Transfers the specified amount of money from one account to another.
|
|
52
|
-
*
|
|
53
|
-
* @param {TransferRequest} params - The parameters for the transfer.
|
|
54
|
-
* @return {Promise<TransferResponse>} - The response from the transfer method.
|
|
55
|
-
*/
|
|
56
|
-
async transfer(params: TransferRequest): Promise<TransferResponse> {
|
|
57
|
-
return await transfer({
|
|
58
|
-
configs: this.config,
|
|
59
|
-
params: params,
|
|
60
|
-
endPoint: this.routes.transfer(),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Retrieves the status of a transfer.
|
|
66
|
-
*
|
|
67
|
-
* @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
|
|
68
|
-
* @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
|
|
69
|
-
*/
|
|
70
|
-
async getTransferStatus(
|
|
71
|
-
params: GetTransferStatusRequest
|
|
72
|
-
): Promise<GetTransferStatusResponse> {
|
|
73
|
-
return await getTransferStatus({
|
|
74
|
-
configs: this.config,
|
|
75
|
-
params: params,
|
|
76
|
-
endPoint: this.routes.transferStatus(params.messageId),
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { TransferResponse } from '../../operations/transfer';
|
|
2
|
-
import { CreateAccessTokenResponse } from '../../operations/create_access_token';
|
|
3
|
-
import { Routes } from '../../routes/routes';
|
|
4
|
-
import {
|
|
5
|
-
DisbursementInterface,
|
|
6
|
-
DisbursementServiceConfig,
|
|
7
|
-
} from '../disbursement_service';
|
|
8
|
-
import {
|
|
9
|
-
DisbursementStep,
|
|
10
|
-
GetTransferStatusResponse,
|
|
11
|
-
} from '../../operations/get_transfer_status';
|
|
12
|
-
import {
|
|
13
|
-
DisbursementApiRawStatus,
|
|
14
|
-
DisbursementStatus,
|
|
15
|
-
} from '../../utils/status';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Orange Money API Fake Disbursement.
|
|
19
|
-
* @class
|
|
20
|
-
*/
|
|
21
|
-
export class DisbursementFake implements DisbursementInterface {
|
|
22
|
-
protected readonly config: DisbursementServiceConfig;
|
|
23
|
-
protected readonly routes: Routes;
|
|
24
|
-
/**
|
|
25
|
-
* Constructs a new {Disbursement}.
|
|
26
|
-
* @constructor
|
|
27
|
-
* @param {DisbursementServiceConfig} config - The required global route configuration.
|
|
28
|
-
*/
|
|
29
|
-
constructor(config: DisbursementServiceConfig) {
|
|
30
|
-
this.routes = new Routes();
|
|
31
|
-
this.config = config;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Creates an access token.
|
|
36
|
-
*
|
|
37
|
-
* @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
|
|
38
|
-
*/
|
|
39
|
-
async createAccessToken(): Promise<CreateAccessTokenResponse> {
|
|
40
|
-
return {
|
|
41
|
-
data: 'accessToken',
|
|
42
|
-
raw: {
|
|
43
|
-
access_token: 'accessToken',
|
|
44
|
-
token_type: 'Bearer',
|
|
45
|
-
expires_in: '300',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Transfers the specified amount of money from one account to another.
|
|
52
|
-
*
|
|
53
|
-
* @param {TransferRequest} params - The parameters for the transfer.
|
|
54
|
-
* @return {Promise<TransferResponse>} - The response from the transfer method.
|
|
55
|
-
*/
|
|
56
|
-
async transfer(): Promise<TransferResponse> {
|
|
57
|
-
return {
|
|
58
|
-
data: 'f7ec5a39-b1ad-4fa5-a734-60ab4217ba75',
|
|
59
|
-
raw: {
|
|
60
|
-
MD5OfMessageBody: '4b55cf6629b5f0ee3c8ac91435a2eb35',
|
|
61
|
-
MD5OfMessageAttributes: '50e3084aee2bf840dd63b6bbf0a62fa9',
|
|
62
|
-
MessageId: 'f7ec5a39-b1ad-4fa5-a734-60ab4217ba75',
|
|
63
|
-
ResponseMetadata: {
|
|
64
|
-
RequestId: 'bbb43d42-95d1-5a6b-92a7-60c0d420e103',
|
|
65
|
-
HTTPStatusCode: 200,
|
|
66
|
-
HTTPHeaders: {
|
|
67
|
-
'x-amzn-requestid': 'bbb43d42-95d1-5a6b-92a7-60c0d420e103',
|
|
68
|
-
'x-amzn-trace-id':
|
|
69
|
-
'Root=1-65083fb1-37fbf881380338ed3b5fcd2b;Parent=6bfc3c24556c9b27;Sampled=0;Lineage=79e6faf7:0',
|
|
70
|
-
date: 'Mon, 18 Sep 2023 12:16:49 GMT',
|
|
71
|
-
'content-type': 'text/xml',
|
|
72
|
-
'content-length': '459',
|
|
73
|
-
},
|
|
74
|
-
RetryAttempts: 0,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Retrieves the status of a transfer.
|
|
82
|
-
*
|
|
83
|
-
* @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
|
|
84
|
-
* @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
|
|
85
|
-
*/
|
|
86
|
-
async getTransferStatus(): Promise<GetTransferStatusResponse> {
|
|
87
|
-
return {
|
|
88
|
-
data: {
|
|
89
|
-
status: DisbursementStatus.succeeded,
|
|
90
|
-
refundStep: DisbursementStep.TransferSent,
|
|
91
|
-
},
|
|
92
|
-
raw: {
|
|
93
|
-
result: {
|
|
94
|
-
message: 'Cash in performed successfully',
|
|
95
|
-
data: {
|
|
96
|
-
subscriberMsisdn: 'subscriberMsisdn',
|
|
97
|
-
channelUserMsisdn: 'channelUserMsisdn',
|
|
98
|
-
createtime: '1695039280',
|
|
99
|
-
amount: 100,
|
|
100
|
-
payToken: 'C2C2309183CB702A1CBB39ECE32C',
|
|
101
|
-
txnid: 'PP230918.1314.B57973',
|
|
102
|
-
txnmode: 'refundYNote',
|
|
103
|
-
txnstatus: '00068',
|
|
104
|
-
orderId: 'refundYNote',
|
|
105
|
-
status: DisbursementApiRawStatus.succeeded,
|
|
106
|
-
description: 'Remboursement Fond',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
parameters: {
|
|
110
|
-
amount: '100',
|
|
111
|
-
xauth: 'WU5PVEVIRUFEOllOT1RFSEVBRDIwMjA=',
|
|
112
|
-
channel_user_msisdn: 'channel_user_msisdn',
|
|
113
|
-
customer_key: 'customer_key',
|
|
114
|
-
customer_secret: 'customer_secret',
|
|
115
|
-
final_customer_name: 'Steve',
|
|
116
|
-
final_customer_phone: '692232239',
|
|
117
|
-
},
|
|
118
|
-
CreateAt: '09-18-2023 12:14:43',
|
|
119
|
-
MessageId: 'caee8310-02fa-45da-9b22-a1effcada25c',
|
|
120
|
-
RefundStep: DisbursementStep.TransferSent,
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { AxiosError, AxiosResponse } from 'axios';
|
|
2
|
-
import { Logger } from '../../../../logging/src/logging';
|
|
3
|
-
import * as requests from '../../utils/https';
|
|
4
|
-
import { DisbursementXTargetEnvironmentType } from '../utils/constants';
|
|
5
|
-
import { Token, createAccessToken } from './create_access_token';
|
|
6
|
-
|
|
7
|
-
describe('createAccessToken', () => {
|
|
8
|
-
it('Should fail on invalid parameter', async () => {
|
|
9
|
-
const result = await createAccessToken({
|
|
10
|
-
endPoint: '',
|
|
11
|
-
configs: {
|
|
12
|
-
channelUserMsisdn: '',
|
|
13
|
-
clientId: '',
|
|
14
|
-
clientSecret: '',
|
|
15
|
-
customerKey: '',
|
|
16
|
-
customerSecret: '',
|
|
17
|
-
pin: '',
|
|
18
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
19
|
-
logger: new Logger(),
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
expect(result.data).toBeUndefined();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('Should fail on request rejection', async () => {
|
|
26
|
-
const errorMessage = 'mock reject the request';
|
|
27
|
-
const postSpy = jest
|
|
28
|
-
.spyOn(requests, 'postRequest')
|
|
29
|
-
.mockImplementation()
|
|
30
|
-
.mockResolvedValue({ error: new AxiosError(errorMessage) });
|
|
31
|
-
|
|
32
|
-
const result = await createAccessToken({
|
|
33
|
-
endPoint: 'https://route.com/link',
|
|
34
|
-
configs: {
|
|
35
|
-
channelUserMsisdn: '237699947943',
|
|
36
|
-
clientId: 'clientId',
|
|
37
|
-
clientSecret: 'clientSecret',
|
|
38
|
-
customerKey: 'customerKey',
|
|
39
|
-
customerSecret: 'customerSecret',
|
|
40
|
-
pin: 'pin',
|
|
41
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
42
|
-
logger: new Logger(),
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
expect(postSpy).toHaveBeenCalledTimes(1);
|
|
47
|
-
expect(result.data).toBeUndefined();
|
|
48
|
-
expect(result.error).toBeDefined();
|
|
49
|
-
postSpy.mockRestore();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('Should successfully retrieve token', async () => {
|
|
53
|
-
const accessToken = 'THEaCCESStOKEN';
|
|
54
|
-
const postSpy = jest
|
|
55
|
-
.spyOn(requests, 'postRequest')
|
|
56
|
-
.mockImplementation()
|
|
57
|
-
.mockResolvedValue({
|
|
58
|
-
response: <AxiosResponse<Token>>{
|
|
59
|
-
data: {
|
|
60
|
-
access_token: accessToken,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const result = await createAccessToken({
|
|
66
|
-
endPoint: 'https://route.com/link',
|
|
67
|
-
configs: {
|
|
68
|
-
channelUserMsisdn: '237699947943',
|
|
69
|
-
clientId: 'clientId',
|
|
70
|
-
clientSecret: 'clientSecret',
|
|
71
|
-
customerKey: 'customerKey',
|
|
72
|
-
customerSecret: 'customerSecret',
|
|
73
|
-
pin: 'pin',
|
|
74
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
75
|
-
logger: new Logger(),
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
expect(postSpy).toHaveBeenCalledTimes(1);
|
|
80
|
-
expect(result.error).toBeUndefined();
|
|
81
|
-
expect(result.raw).toEqual({
|
|
82
|
-
access_token: accessToken,
|
|
83
|
-
});
|
|
84
|
-
expect(result.data).toBe(accessToken);
|
|
85
|
-
postSpy.mockRestore();
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RequestResponse,
|
|
3
|
-
encodeDataToXFormUrl,
|
|
4
|
-
hash,
|
|
5
|
-
postRequest,
|
|
6
|
-
} from '../../utils/https';
|
|
7
|
-
import { OperationResponse } from '../../utils/operation_response';
|
|
8
|
-
import {
|
|
9
|
-
DisbursementServiceConfig,
|
|
10
|
-
DisbursementServiceConfigSchema,
|
|
11
|
-
} from '../implementations/disbursement_service';
|
|
12
|
-
|
|
13
|
-
export type Token = {
|
|
14
|
-
/**
|
|
15
|
-
* The requested token.
|
|
16
|
-
*/
|
|
17
|
-
access_token: string;
|
|
18
|
-
|
|
19
|
-
scope?: string;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The type of the requested token.
|
|
23
|
-
*/
|
|
24
|
-
token_type: string;
|
|
25
|
-
|
|
26
|
-
/** The time to live in seconds. */
|
|
27
|
-
expires_in: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export type CreateAccessTokenResponse = OperationResponse<string, Token>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Creates an access token.
|
|
34
|
-
*
|
|
35
|
-
* @param {CreateAccessTokenRequest} configs - The disbursement service config.
|
|
36
|
-
* @param {string} endPoint - The end point.
|
|
37
|
-
* @return {CreateAccessTokenResponse} The method response containing the access token and raw response.
|
|
38
|
-
*/
|
|
39
|
-
export async function createAccessToken({
|
|
40
|
-
configs,
|
|
41
|
-
endPoint,
|
|
42
|
-
}: {
|
|
43
|
-
configs: DisbursementServiceConfig;
|
|
44
|
-
endPoint: string;
|
|
45
|
-
}): Promise<CreateAccessTokenResponse> {
|
|
46
|
-
const logger = configs.logger;
|
|
47
|
-
logger.info('createAccessToken is running ...');
|
|
48
|
-
const { error: configsValidationError, value: configValues } =
|
|
49
|
-
DisbursementServiceConfigSchema.validate(configs);
|
|
50
|
-
|
|
51
|
-
if (configsValidationError) {
|
|
52
|
-
logger.error(
|
|
53
|
-
`Invalid DisbursementServiceConfig request parameters. params : ${JSON.stringify(
|
|
54
|
-
configsValidationError.details
|
|
55
|
-
)}`
|
|
56
|
-
);
|
|
57
|
-
return { error: configsValidationError.details };
|
|
58
|
-
}
|
|
59
|
-
const authorization = hash(configValues.clientId, configValues.clientSecret);
|
|
60
|
-
const headers = {
|
|
61
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
62
|
-
Authorization: `Basic ${authorization}`,
|
|
63
|
-
};
|
|
64
|
-
const body = encodeDataToXFormUrl({
|
|
65
|
-
grant_type: 'client_credentials',
|
|
66
|
-
});
|
|
67
|
-
const response: RequestResponse<Token> = await postRequest<Token>({
|
|
68
|
-
logger: logger,
|
|
69
|
-
route: endPoint,
|
|
70
|
-
data: body,
|
|
71
|
-
headers: headers,
|
|
72
|
-
rejectUnauthorized: false,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
if (!response.response) {
|
|
76
|
-
return { error: response.error };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
data: response.response.data.access_token,
|
|
81
|
-
raw: response.response.data,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { Logger } from '../../../../logging/src/logging';
|
|
3
|
-
import * as requests from '../../utils/https';
|
|
4
|
-
import { DisbursementXTargetEnvironmentType } from '../utils/constants';
|
|
5
|
-
import { DisbursementApiRawStatus, DisbursementStatus } from '../utils/status';
|
|
6
|
-
import { DisbursementStep, getTransferStatus } from './get_transfer_status';
|
|
7
|
-
|
|
8
|
-
describe('getTransferStatus', () => {
|
|
9
|
-
it('should fail on invalid parameter provided', async () => {
|
|
10
|
-
const { error, data, raw } = await getTransferStatus({
|
|
11
|
-
configs: {
|
|
12
|
-
channelUserMsisdn: '',
|
|
13
|
-
clientId: '',
|
|
14
|
-
clientSecret: '',
|
|
15
|
-
customerKey: '',
|
|
16
|
-
customerSecret: '',
|
|
17
|
-
pin: '',
|
|
18
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
19
|
-
logger: new Logger(),
|
|
20
|
-
},
|
|
21
|
-
params: {
|
|
22
|
-
token: 55 as unknown as string,
|
|
23
|
-
messageId: 'messageId',
|
|
24
|
-
},
|
|
25
|
-
endPoint: 'https://example.com',
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
expect(data).not.toBeDefined();
|
|
29
|
-
expect(raw).not.toBeDefined();
|
|
30
|
-
expect(error).toBeDefined();
|
|
31
|
-
});
|
|
32
|
-
it('should fail on request failure', async () => {
|
|
33
|
-
const requestSpy = jest
|
|
34
|
-
.spyOn(requests, 'getRequest')
|
|
35
|
-
.mockImplementation()
|
|
36
|
-
.mockResolvedValue({
|
|
37
|
-
error: {},
|
|
38
|
-
});
|
|
39
|
-
const { error, data, raw } = await getTransferStatus({
|
|
40
|
-
configs: {
|
|
41
|
-
channelUserMsisdn: '237699947943',
|
|
42
|
-
clientId: 'clientId',
|
|
43
|
-
clientSecret: 'clientSecret',
|
|
44
|
-
customerKey: 'customerKey',
|
|
45
|
-
customerSecret: 'customerSecret',
|
|
46
|
-
pin: 'pin',
|
|
47
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
48
|
-
logger: new Logger(),
|
|
49
|
-
},
|
|
50
|
-
params: {
|
|
51
|
-
token: 'token',
|
|
52
|
-
messageId: 'messageId',
|
|
53
|
-
},
|
|
54
|
-
endPoint: 'https://example.com',
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
expect(data).not.toBeDefined();
|
|
58
|
-
expect(raw).not.toBeDefined();
|
|
59
|
-
expect(requestSpy).toHaveBeenCalledTimes(1);
|
|
60
|
-
expect(error).toBeDefined();
|
|
61
|
-
});
|
|
62
|
-
it('should succeed on request succeed', async () => {
|
|
63
|
-
const succeedEg = {
|
|
64
|
-
result: {
|
|
65
|
-
message: 'message',
|
|
66
|
-
data: {
|
|
67
|
-
createtime: 'createtime',
|
|
68
|
-
subscriberMsisdn: 'subscriberMsisdn',
|
|
69
|
-
amount: 500,
|
|
70
|
-
payToken: 'payToken',
|
|
71
|
-
txnid: 'txnid',
|
|
72
|
-
txnmode: 'txnmode',
|
|
73
|
-
txnstatus: 'txnstatus',
|
|
74
|
-
orderId: 'orderId',
|
|
75
|
-
status: DisbursementApiRawStatus.succeeded,
|
|
76
|
-
channelUserMsisdn: 'channelUserMsisdn',
|
|
77
|
-
description: 'description',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
parameters: {
|
|
81
|
-
amount: 500,
|
|
82
|
-
xauth: 'xauth',
|
|
83
|
-
channel_user_msisdn: 'channel_user_msisdn',
|
|
84
|
-
customer_key: 'customer_key',
|
|
85
|
-
customer_secret: 'customer_secret',
|
|
86
|
-
final_customer_name: 'final_customer_name',
|
|
87
|
-
final_customer_phone: 'final_customer_phone',
|
|
88
|
-
},
|
|
89
|
-
CreateAt: 'CreateAt',
|
|
90
|
-
MessageId: 'MessageId',
|
|
91
|
-
RefundStep: DisbursementStep.TransferSent,
|
|
92
|
-
};
|
|
93
|
-
const requestSpy = jest
|
|
94
|
-
.spyOn(requests, 'getRequest')
|
|
95
|
-
.mockImplementation()
|
|
96
|
-
.mockResolvedValue({
|
|
97
|
-
response: { data: Object(succeedEg) } as AxiosResponse<
|
|
98
|
-
unknown,
|
|
99
|
-
unknown
|
|
100
|
-
>,
|
|
101
|
-
});
|
|
102
|
-
const { error, data, raw } = await getTransferStatus({
|
|
103
|
-
configs: {
|
|
104
|
-
channelUserMsisdn: '237699947943',
|
|
105
|
-
clientId: 'clientId',
|
|
106
|
-
clientSecret: 'clientSecret',
|
|
107
|
-
customerKey: 'customerKey',
|
|
108
|
-
customerSecret: 'customerSecret',
|
|
109
|
-
pin: 'pin',
|
|
110
|
-
environment: DisbursementXTargetEnvironmentType.sandbox,
|
|
111
|
-
logger: new Logger(),
|
|
112
|
-
},
|
|
113
|
-
params: {
|
|
114
|
-
token: 'token',
|
|
115
|
-
messageId: 'messageId',
|
|
116
|
-
},
|
|
117
|
-
endPoint: 'https://example.com',
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
expect(error).not.toBeDefined();
|
|
121
|
-
expect(requestSpy).toHaveBeenCalledTimes(1);
|
|
122
|
-
expect(raw).toEqual(succeedEg);
|
|
123
|
-
expect(
|
|
124
|
-
(raw as { parameters?: { customer_secret?: unknown } })?.parameters
|
|
125
|
-
?.customer_secret
|
|
126
|
-
).toBeNull();
|
|
127
|
-
expect(data).toStrictEqual({
|
|
128
|
-
status: DisbursementStatus.succeeded,
|
|
129
|
-
refundStep: DisbursementStep.TransferSent,
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|