mangopay4-nodejs-sdk 1.68.0 → 2.1.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 +68 -0
- package/README.md +0 -6
- package/docs/templates/class.mustache +0 -0
- package/docs/templates/file.mustache +0 -0
- package/docs/templates/function.mustache +0 -0
- package/docs/templates/index.mustache +0 -0
- package/docs/templates/overview.mustache +0 -0
- package/lib/apiMethods.js +6 -1
- package/lib/models/CardPreAuthorization.js +2 -2
- package/lib/models/Hook.js +2 -1
- package/lib/models/PayInRecurringRegistration.js +2 -1
- package/lib/models/PayPalDepositPreauthorization.js +21 -0
- package/lib/models/ReportV2.js +2 -1
- package/lib/services/Deposits.js +13 -0
- package/lib/services/PayIns.js +94 -1
- package/package.json +16 -24
- package/typings/enums.d.ts +3 -1
- package/typings/models/cardPreauthorization.d.ts +7 -1
- package/typings/models/deposit.d.ts +165 -0
- package/typings/models/hook.d.ts +7 -2
- package/typings/models/payIn.d.ts +1302 -135
- package/typings/models/reportV2.d.ts +2 -0
- package/typings/models/virtualAccount.d.ts +48 -0
- package/typings/services/Deposits.d.ts +2 -0
- package/typings/services/PayIns.d.ts +63 -6
- package/.github/workflows/node.js.yml +0 -32
- package/.github/workflows/npm-publish.yml +0 -26
- package/.jshintrc +0 -16
- package/test/TestKycPageFile.png +0 -0
- package/test/helpers.js +0 -1537
- package/test/main.js +0 -10
- package/test/mocha.opts +0 -3
- package/test/services/Acquiring.js +0 -338
- package/test/services/BankAccounts.js +0 -46
- package/test/services/BankingAliases.js +0 -89
- package/test/services/CardPreAuthorizations.js +0 -70
- package/test/services/CardRegistrations.js +0 -239
- package/test/services/Cards.js +0 -56
- package/test/services/Clients.js +0 -235
- package/test/services/Conversions.js +0 -319
- package/test/services/Deposits.js +0 -148
- package/test/services/Disputes.js +0 -542
- package/test/services/EMoney.js +0 -54
- package/test/services/Events.js +0 -147
- package/test/services/Hooks.js +0 -109
- package/test/services/Idempotency.js +0 -41
- package/test/services/IdentityVerifications.js +0 -68
- package/test/services/KycDocuments.js +0 -73
- package/test/services/Mandates.js +0 -256
- package/test/services/PayIns.js +0 -2632
- package/test/services/PayOuts.js +0 -119
- package/test/services/RateLimit.js +0 -43
- package/test/services/Recipients.js +0 -234
- package/test/services/Refunds.js +0 -123
- package/test/services/Regulatory.js +0 -45
- package/test/services/Reports.js +0 -114
- package/test/services/ReportsV2.js +0 -306
- package/test/services/Repudiations.js +0 -22
- package/test/services/Settlements.js +0 -127
- package/test/services/Tokens.js +0 -55
- package/test/services/Transfers.js +0 -137
- package/test/services/UboDeclarations.js +0 -130
- package/test/services/Users.js +0 -1322
- package/test/services/VirtualAccounts.js +0 -105
- package/test/services/Wallets.js +0 -132
- package/test/settlement_sample.csv +0 -8
- package/test/settlement_sample_bad.csv +0 -8
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var helpers = require('../helpers');
|
|
3
|
-
var api = require('../main');
|
|
4
|
-
|
|
5
|
-
describe('VirtualAccounts', function() {
|
|
6
|
-
var john = helpers.data.getUserNatural();
|
|
7
|
-
var wallet;
|
|
8
|
-
var virtualAccount;
|
|
9
|
-
|
|
10
|
-
before(function(done){
|
|
11
|
-
api.Users.create(john).then(function(){
|
|
12
|
-
wallet = {
|
|
13
|
-
Owners: [john.Id],
|
|
14
|
-
Currency: 'EUR',
|
|
15
|
-
Description: 'WALLET IN EUR'
|
|
16
|
-
};
|
|
17
|
-
api.Wallets.create(wallet).then(function(){
|
|
18
|
-
done();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
describe('Create', function () {
|
|
24
|
-
before(function(done){
|
|
25
|
-
var virtualAccountCreate = {
|
|
26
|
-
Country: 'FR',
|
|
27
|
-
VirtualAccountPurpose: 'Collection',
|
|
28
|
-
Tag: 'create virtual account tag'
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
api.VirtualAccounts.create(wallet.Id, virtualAccountCreate).then(function(data){
|
|
32
|
-
virtualAccount = data;
|
|
33
|
-
done();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should be correctly created', function () {
|
|
38
|
-
expect(virtualAccount.Id).to.not.be.null;
|
|
39
|
-
expect(wallet.Id).to.equal(virtualAccount.WalletId);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
describe('Get', function () {
|
|
44
|
-
var getVirtualAccount;
|
|
45
|
-
|
|
46
|
-
before(function(done){
|
|
47
|
-
api.VirtualAccounts.get(wallet.Id, virtualAccount.Id).then(function(data){
|
|
48
|
-
getVirtualAccount = data;
|
|
49
|
-
done();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should be correctly fetched', function () {
|
|
54
|
-
expect(virtualAccount.Id).to.equal(getVirtualAccount.Id);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('Get All', function () {
|
|
59
|
-
var allVirtualAccounts;
|
|
60
|
-
|
|
61
|
-
before(function(done){
|
|
62
|
-
api.VirtualAccounts.getAll(wallet.Id).then(function(data){
|
|
63
|
-
allVirtualAccounts = data;
|
|
64
|
-
done();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should be correctly fetched', function () {
|
|
69
|
-
expect(allVirtualAccounts.length).to.equal(1);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
describe('Deactivate', function () {
|
|
74
|
-
var deactivatedVirtualAccount;
|
|
75
|
-
|
|
76
|
-
before(function(done){
|
|
77
|
-
api.VirtualAccounts.deactivate(wallet.Id, virtualAccount.Id).then(function(data){
|
|
78
|
-
deactivatedVirtualAccount = data;
|
|
79
|
-
done();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should be correctly created', function () {
|
|
84
|
-
expect(deactivatedVirtualAccount.Active).to.equal(false);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe.skip('Get Availabilities', function () {
|
|
89
|
-
// TODO
|
|
90
|
-
console.warn("Skipped because of API issues. To be enabled after API is fixed.");
|
|
91
|
-
var availabilities;
|
|
92
|
-
|
|
93
|
-
before(function(done){
|
|
94
|
-
api.VirtualAccounts.getAvailabilities().then(function(data){
|
|
95
|
-
availabilities = data;
|
|
96
|
-
done();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should be correctly fetched', function () {
|
|
101
|
-
expect(availabilities.Collection.length).to.greaterThan(0);
|
|
102
|
-
expect(availabilities.UserOwned.length).to.greaterThan(0);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
package/test/services/Wallets.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var helpers = require('../helpers');
|
|
3
|
-
var api = require('../main');
|
|
4
|
-
|
|
5
|
-
describe('Wallets', function() {
|
|
6
|
-
var john = helpers.data.getUserNatural();
|
|
7
|
-
var wallet;
|
|
8
|
-
|
|
9
|
-
before(function(done){
|
|
10
|
-
api.Users.create(john).then(function(){
|
|
11
|
-
wallet = {
|
|
12
|
-
Owners: [john.Id],
|
|
13
|
-
Currency: 'EUR',
|
|
14
|
-
Description: 'WALLET IN EUR'
|
|
15
|
-
};
|
|
16
|
-
api.Wallets.create(wallet).then(function(){
|
|
17
|
-
done();
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe('Create', function () {
|
|
23
|
-
it('should exist', function () {
|
|
24
|
-
expect(wallet.Id).to.exist;
|
|
25
|
-
expect(wallet.Owners).to.contain(john.Id);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('Get', function () {
|
|
30
|
-
var getWallet;
|
|
31
|
-
|
|
32
|
-
before(function(done){
|
|
33
|
-
api.Wallets.get(wallet.Id).then(function(data){
|
|
34
|
-
getWallet = data;
|
|
35
|
-
done();
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should be correctly fetched', function () {
|
|
40
|
-
expect(wallet.Id).to.equal(getWallet.Id);
|
|
41
|
-
expect(wallet.CreationDate).to.equal(getWallet.CreationDate);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('Get Sca', function () {
|
|
46
|
-
var responseError;
|
|
47
|
-
|
|
48
|
-
before(function (done) {
|
|
49
|
-
api.Wallets.get(wallet.Id, function (data) {},
|
|
50
|
-
{
|
|
51
|
-
parameters: {
|
|
52
|
-
ScaContext: 'USER_PRESENT'
|
|
53
|
-
},
|
|
54
|
-
resolveWithFullResponse: true
|
|
55
|
-
})
|
|
56
|
-
.catch(function (error) {
|
|
57
|
-
responseError = error;
|
|
58
|
-
done();
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('redirectUrl should be present on response headers', function () {
|
|
63
|
-
expect(responseError.headers['www-authenticate']).to.contain("PendingUserAction RedirectUrl");
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
describe('Save', function () {
|
|
68
|
-
var NEW_DESCRIPTION = 'New description to test';
|
|
69
|
-
|
|
70
|
-
before(function(done){
|
|
71
|
-
wallet.description = NEW_DESCRIPTION;
|
|
72
|
-
api.Wallets.update(wallet).then(function(data){
|
|
73
|
-
wallet = data;
|
|
74
|
-
done();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('should be correctly updated', function () {
|
|
79
|
-
expect(wallet.Description).to.equal(NEW_DESCRIPTION);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe('Transactions', function () {
|
|
84
|
-
var transactions;
|
|
85
|
-
|
|
86
|
-
before(function(done){
|
|
87
|
-
helpers.getNewPayInCardWeb(api, john, async function(data){
|
|
88
|
-
// wait 2 seconds for the transactions to be created by the API
|
|
89
|
-
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
90
|
-
await delay(2000);
|
|
91
|
-
|
|
92
|
-
api.Wallets.getTransactions(data.CreditedWalletId, function(data, response){
|
|
93
|
-
transactions = data;
|
|
94
|
-
done();
|
|
95
|
-
}, {
|
|
96
|
-
// parameters: {
|
|
97
|
-
// TYPE: 'PAYIN'
|
|
98
|
-
// },
|
|
99
|
-
page: 1,
|
|
100
|
-
per_page: 50,
|
|
101
|
-
TYPE: 'PAYIN'
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should be correctly updated', function () {
|
|
107
|
-
expect(transactions.length).to.equal(1);
|
|
108
|
-
expect(transactions[0].AuthorId).to.equal(john.Id);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('Transactions Sca', function () {
|
|
113
|
-
var responseError;
|
|
114
|
-
|
|
115
|
-
before(function(done){
|
|
116
|
-
api.Wallets.getTransactions(wallet.Id, function(data, response) {}, {
|
|
117
|
-
page: 1,
|
|
118
|
-
per_page: 50,
|
|
119
|
-
ScaContext: 'USER_PRESENT',
|
|
120
|
-
resolveWithFullResponse: true
|
|
121
|
-
})
|
|
122
|
-
.catch(function (error) {
|
|
123
|
-
responseError = error;
|
|
124
|
-
done();
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('redirectUrl should be present on response headers', function () {
|
|
129
|
-
expect(responseError.headers['www-authenticate']).to.contain("PendingUserAction RedirectUrl");
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
ExternalProviderReference,ExternalPaymentMethod,ExternalTransactionType,ExternalTransactionStatus,ExternalProcessingDate,Amount,Currency,ExternalInitialReference,ExternalProviderFees
|
|
2
|
-
6TU984332A894613W,PAYPAL,PAYMENT,SETTLED,19-06-2025,1000,EUR,,0
|
|
3
|
-
,,,,,,,,
|
|
4
|
-
SettlementDate,19-06-2025,,,,,,,
|
|
5
|
-
ExternalProviderName,Paypal,,,,,,,
|
|
6
|
-
TotalSettlementFeesAmount,0,,,,,,,
|
|
7
|
-
TotalNetSettlementAmount,1000,,,,,,,
|
|
8
|
-
SettlementCurrency,EUR,,,,,,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
ExternalProviderReference,ExternalPaymentMethod,ExternalTransactionType,ExternalTransactionStatus,ExternalProcessingDate,Amount,Currency,ExternalInitialReference,ExternalProviderFees
|
|
2
|
-
6TU984332A894613W,PAYPAL,PAYMENT,SETTLED,19-06-2025,1000,EUR,,0
|
|
3
|
-
,,,,,,,,
|
|
4
|
-
SettlementDate,19-06-2025,,,,,,,
|
|
5
|
-
ExternalProviderName,Paypal,,,,,,,
|
|
6
|
-
TotalSettlementFeesAmount,0,,,,,,,
|
|
7
|
-
TotalNetSettlementAmount,999999,,,,,,,
|
|
8
|
-
SettlementCurrency,EUR,,,,,,
|