@finverse/sdk-typescript 0.0.378 → 0.0.382
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/api.d.ts +707 -432
- package/dist/api.js +415 -232
- package/package.json +2 -2
- package/dist/test/paymentInstruction.spec.d.ts +0 -1
- package/dist/test/paymentInstruction.spec.js +0 -58
- package/dist/test/responses/paymentInstruction.d.ts +0 -3
- package/dist/test/responses/paymentInstruction.js +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finverse/sdk-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.382",
|
|
4
4
|
"description": "OpenAPI client for @finverse/sdk-typescript",
|
|
5
5
|
"author": "OpenAPI-Generator Contributors",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/node": "12.11.5 - 12.20.42",
|
|
33
33
|
"axios-mock-adapter": "^1.21.2",
|
|
34
34
|
"chai": "^6.2.2",
|
|
35
|
-
"mocha": "^11.7.
|
|
35
|
+
"mocha": "^11.7.6",
|
|
36
36
|
"ts-node": "^10.9.2",
|
|
37
37
|
"typescript": "^4.0 || ^5.0"
|
|
38
38
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const axios_mock_adapter_1 = require("axios-mock-adapter");
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
const config_1 = require("./config");
|
|
15
|
-
const __1 = require("..");
|
|
16
|
-
const api_1 = require("../api");
|
|
17
|
-
const customerToken_1 = require("./responses/customerToken");
|
|
18
|
-
const paymentInstruction_1 = require("./responses/paymentInstruction");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
describe('PaymentInstruction', function () {
|
|
21
|
-
let mock;
|
|
22
|
-
before(() => {
|
|
23
|
-
mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
24
|
-
});
|
|
25
|
-
it('Create paymentInstruction', function () {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
mock.onPost(`${config_1.config.apiHost}/payments/instruction`).reply(200, (0, paymentInstruction_1.createPaymentInstruction)());
|
|
28
|
-
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: customerToken_1.customerToken.access_token });
|
|
29
|
-
const paymentInstruction = {
|
|
30
|
-
type: "DEBIT_AUTHORIZATION",
|
|
31
|
-
user_id: "customer_user1",
|
|
32
|
-
frequency: "MONTHLY",
|
|
33
|
-
start_date: "2022-04-01",
|
|
34
|
-
end_date: "2022-12-01",
|
|
35
|
-
amount: 1000,
|
|
36
|
-
currency: "PHP",
|
|
37
|
-
recipient_name: "HOMECREDIT",
|
|
38
|
-
recipient_account_id: "Recipient Account Id",
|
|
39
|
-
sender_name: "Sender Name",
|
|
40
|
-
sender_account_id: "LOAN102345",
|
|
41
|
-
remarks: "HOME CREDIT REPAYMENT"
|
|
42
|
-
};
|
|
43
|
-
const createPaymentInstructionResponse = yield new api_1.CustomerApi(configuration).createPaymentInstruction(paymentInstruction);
|
|
44
|
-
(0, chai_1.expect)(createPaymentInstructionResponse.data.payment_instruction_id).to.be.ok;
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
it('Get paymentInstruction', function () {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
mock.onGet(`${config_1.config.apiHost}/payments/instruction/stub_payment_instruction_id`).reply(200, (0, paymentInstruction_1.getPaymentInstruction)());
|
|
50
|
-
const configuration = new __1.Configuration({ basePath: config_1.config.apiHost, accessToken: customerToken_1.customerToken.access_token });
|
|
51
|
-
const getPaymentInstructionResponse = yield new api_1.CustomerApi(configuration).getPaymentInstruction("stub_payment_instruction_id");
|
|
52
|
-
(0, chai_1.expect)(getPaymentInstructionResponse.data.payment_instruction).to.be.ok;
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
after(() => {
|
|
56
|
-
mock.restore();
|
|
57
|
-
});
|
|
58
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPaymentInstruction = createPaymentInstruction;
|
|
4
|
-
exports.getPaymentInstruction = getPaymentInstruction;
|
|
5
|
-
function createPaymentInstruction() {
|
|
6
|
-
return {
|
|
7
|
-
payment_instruction_id: "01FYRK0Q1DVFTJRG50J5QT424Y",
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function getPaymentInstruction() {
|
|
11
|
-
return {
|
|
12
|
-
payment_instruction: {
|
|
13
|
-
amount: 1000,
|
|
14
|
-
currency: "PHP",
|
|
15
|
-
end_date: "2022-12-01",
|
|
16
|
-
frequency: "MONTHLY",
|
|
17
|
-
info: {},
|
|
18
|
-
recipient_account_id: "HOMECREDIT",
|
|
19
|
-
recipient_name: "HOMECREDIT",
|
|
20
|
-
reference_id: "01G0KD6Z8P06W4536X4BHEQYAX",
|
|
21
|
-
remarks: "HOME CREDIT REPAYMENT",
|
|
22
|
-
sender_account_id: "LOAN102345",
|
|
23
|
-
sender_name: "Sender Name",
|
|
24
|
-
start_date: "2022-04-01",
|
|
25
|
-
status: "SUBMITTED",
|
|
26
|
-
type: "DEBIT_AUTHORIZATION",
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|