mangopay4-nodejs-sdk 1.68.0 → 2.0.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +0 -6
  3. package/docs/templates/class.mustache +0 -0
  4. package/docs/templates/file.mustache +0 -0
  5. package/docs/templates/function.mustache +0 -0
  6. package/docs/templates/index.mustache +0 -0
  7. package/docs/templates/overview.mustache +0 -0
  8. package/lib/models/CardPreAuthorization.js +2 -2
  9. package/package.json +16 -24
  10. package/.github/workflows/node.js.yml +0 -32
  11. package/.github/workflows/npm-publish.yml +0 -26
  12. package/.jshintrc +0 -16
  13. package/test/TestKycPageFile.png +0 -0
  14. package/test/helpers.js +0 -1537
  15. package/test/main.js +0 -10
  16. package/test/mocha.opts +0 -3
  17. package/test/services/Acquiring.js +0 -338
  18. package/test/services/BankAccounts.js +0 -46
  19. package/test/services/BankingAliases.js +0 -89
  20. package/test/services/CardPreAuthorizations.js +0 -70
  21. package/test/services/CardRegistrations.js +0 -239
  22. package/test/services/Cards.js +0 -56
  23. package/test/services/Clients.js +0 -235
  24. package/test/services/Conversions.js +0 -319
  25. package/test/services/Deposits.js +0 -148
  26. package/test/services/Disputes.js +0 -542
  27. package/test/services/EMoney.js +0 -54
  28. package/test/services/Events.js +0 -147
  29. package/test/services/Hooks.js +0 -109
  30. package/test/services/Idempotency.js +0 -41
  31. package/test/services/IdentityVerifications.js +0 -68
  32. package/test/services/KycDocuments.js +0 -73
  33. package/test/services/Mandates.js +0 -256
  34. package/test/services/PayIns.js +0 -2632
  35. package/test/services/PayOuts.js +0 -119
  36. package/test/services/RateLimit.js +0 -43
  37. package/test/services/Recipients.js +0 -234
  38. package/test/services/Refunds.js +0 -123
  39. package/test/services/Regulatory.js +0 -45
  40. package/test/services/Reports.js +0 -114
  41. package/test/services/ReportsV2.js +0 -306
  42. package/test/services/Repudiations.js +0 -22
  43. package/test/services/Settlements.js +0 -127
  44. package/test/services/Tokens.js +0 -55
  45. package/test/services/Transfers.js +0 -137
  46. package/test/services/UboDeclarations.js +0 -130
  47. package/test/services/Users.js +0 -1322
  48. package/test/services/VirtualAccounts.js +0 -105
  49. package/test/services/Wallets.js +0 -132
  50. package/test/settlement_sample.csv +0 -8
  51. 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
- });
@@ -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,,,,,,