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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
|
+
## [2.1.0] - 2026-06-24
|
|
2
|
+
This release adds unified recurring pay-ins, PayPal deposit preauthorizations, and several new model fields. Some methods are now marked `@deprecated` in favour of new names.
|
|
3
|
+
|
|
4
|
+
### Added - Unified recurring pay-in method
|
|
5
|
+
- New `PayIns.createRecurringPayIn(recurringPayIn)` method that creates a recurring pay-in for Card, PayPal, Apple Pay, and Google Pay using the same object structure as the non-recurring pay-in methods. It routes to the correct endpoint based on the payment and execution type:
|
|
6
|
+
- `payins/recurring/card/direct`
|
|
7
|
+
- `payins/payment-methods/paypal/recurring`
|
|
8
|
+
- `payins/payment-methods/applepay/recurring`
|
|
9
|
+
- `payins/payment-methods/googlepay/recurring`
|
|
10
|
+
- New recurring registration methods `getRecurringPayInRegistration`, `updateRecurringPayInRegistration`, and `createRecurringPayInRegistration`.
|
|
11
|
+
|
|
12
|
+
### Deprecated - Older recurring pay-in methods
|
|
13
|
+
The following are now deprecated (still functional) in favour of the unified methods above:
|
|
14
|
+
- `createRecurringPayInRegistrationCIT`, `createRecurringPayInRegistrationMIT`, `createRecurringPayPalPayInCIT`, `createRecurringPayPalPayInMIT` → use `createRecurringPayIn`
|
|
15
|
+
- `getRecurringPayin` → use `getRecurringPayInRegistration`
|
|
16
|
+
- `updateRecurringPayin` → use `updateRecurringPayInRegistration`
|
|
17
|
+
- `createRecurringPayment` → use `createRecurringPayInRegistration`
|
|
18
|
+
|
|
19
|
+
### Added - PayPal deposit preauthorization support
|
|
20
|
+
- New `Deposits.createPayPalPreauthorization(deposit)` method, backed by the `deposit-preauthorizations/payment-methods/paypal` endpoint
|
|
21
|
+
- New `PayPalDepositPreauthorization` model and `CreatePayPalDepositPreauthorization` TypeScript typing (fields include `PaypalPayerID`, `PaypalOrderID`, `Buyer*`, `Trackings`, `ShippingPreference`, `LineItems`, `DataCollectionId`, etc.)
|
|
22
|
+
- New `PayIns.createDepositPreauthorizedPayInWithoutComplement(payIn)` method, backed by the `payins/deposit-preauthorized/direct/full-capture` endpoint
|
|
23
|
+
- `PayIns.createCardPreAuthorizedDepositPayIn` is now deprecated in favour of `createDepositPreauthorizedPayInWithoutComplement`
|
|
24
|
+
|
|
25
|
+
### Added - `FlowDescriptor` parameter
|
|
26
|
+
- New `FlowDescriptor` object (`FlowId`, `Beneficiaries[].UserId`) added to pay-in, recurring pay-in registration, card preauthorization, and deposit create/data typings, allowing payment flow and beneficiary information to be passed
|
|
27
|
+
|
|
28
|
+
### Added - `Email` property on Hook
|
|
29
|
+
- The `Hook` model and `hook` typings now support an `Email` property on create and update
|
|
30
|
+
|
|
31
|
+
### Added - `DateRangeBy` on Report V2
|
|
32
|
+
- The Report V2 model (`ReportsV2.create`) now supports the `DateRangeBy` field (e.g. `"ExecutionDate"`), with a matching `DateRangeBy?: string` typing on `ReportV2Data`.
|
|
33
|
+
|
|
34
|
+
### Added - Virtual account local account fields
|
|
35
|
+
- `LocalAccount` typings gained `BankCode`, `BSBCode`, and `BCNumber` fields, with documentation updates to existing local account fields
|
|
36
|
+
|
|
37
|
+
### Changed - Dependency upgrades
|
|
38
|
+
- `axios` `1.16.0` → `1.17.0`
|
|
39
|
+
- `form-data` `4.0.5` → `4.0.6`
|
|
40
|
+
|
|
41
|
+
## [2.0.0] - 2026-05-27
|
|
42
|
+
|
|
43
|
+
> **⚠️ Breaking release.** This version raises the minimum required Node.js version and bumps several dependencies. The runtime API of the SDK is unchanged — no method signatures, models, or TypeScript typings were modified — but please review the notes below before upgrading.
|
|
44
|
+
|
|
45
|
+
### Breaking change - Minimum Node.js version raised to 22
|
|
46
|
+
- `engines.node` is now `>=22.0.0` (previously `>= v0.10.0`).
|
|
47
|
+
- Installing the SDK on Node < 22 will produce an `EBADENGINE` warning and is no longer supported. Upgrade your runtime before installing `2.0.0`.
|
|
48
|
+
- `@types/node` is now pinned to `22.19.18`. Projects on older `@types/node` may see type drift in transitive types and should align their version.
|
|
49
|
+
|
|
50
|
+
### Breaking change - Dependency upgrades
|
|
51
|
+
Runtime and dev dependencies have been bumped to current versions to clear transitive vulnerabilities and align with the new Node 22 baseline:
|
|
52
|
+
|
|
53
|
+
- Runtime: `axios` `1.12.0` → `1.16.0`, `form-data` `4.0.4` → `4.0.5`, `promise` `8.1.x` → `8.3.0`, `underscore` `1.12.x` → `1.13.8`, `@types/node` `14.14.x` → `22.19.18`.
|
|
54
|
+
- Dev: `mocha` `9.2.0` → `11.7.5`, `chai` `4.2.x` → `4.5.0`, `sinon` `9.2.x` → `21.0.1`, `typescript` `4.1.x` → `6.0.3`, `ts-node` `^9.1.1` → `10.9.2`, `tsd` `^0.30.4` → `0.33.0`.
|
|
55
|
+
- Projects that depend on the older transitive versions (for example, code relying on Axios `1.12` request/response shapes) should re-test their integration against `2.0.0`.
|
|
56
|
+
|
|
57
|
+
### Changed - Source repository no longer on GitHub
|
|
58
|
+
- The source repository has been moved off GitHub. The previous `github.com/Mangopay/mangopay2-nodejs-sdk` location is no longer maintained and will not receive new commits, issues, or pull requests.
|
|
59
|
+
- The `repository` field has been removed from `package.json`.
|
|
60
|
+
- This change does not affect consumption: `npm install mangopay4-nodejs-sdk` continues to work exactly as before.
|
|
61
|
+
|
|
62
|
+
### Fixed - Garbled comment in `CardPreAuthorization`
|
|
63
|
+
- Replaced non-UTF-8 characters in the `IpAddress` JSDoc comment of `lib/models/CardPreAuthorization.js`. No behavior change.
|
|
64
|
+
|
|
65
|
+
### Notes for upgraders
|
|
66
|
+
- If your project is on Node 16/18/20, upgrade to Node 22 (or newer) before installing `2.0.0`. The `1.x` line remains available on npm for environments that cannot upgrade their runtime yet.
|
|
67
|
+
- No application code changes are required for SDK callers — all service methods, models, and TypeScript typings are unchanged from `1.68.0`.
|
|
68
|
+
|
|
1
69
|
## [1.68.0] - 2026-03-25
|
|
2
70
|
### Added - Acquiring pay-in service
|
|
3
71
|
- New `Acquiring` service with `createPayIn` (Card, iDEAL, Apple Pay, Google Pay, PayPal), `createPayInRefund`, `createPayPalDataCollection`, and `createCardValidation` methods
|
package/README.md
CHANGED
|
@@ -244,12 +244,6 @@ Sample usage of Mangopay SDK installed with npm in a Node.js project
|
|
|
244
244
|
-------------------------------------------------
|
|
245
245
|
Don't forget to check examples folder !
|
|
246
246
|
|
|
247
|
-
Contributing
|
|
248
|
-
-------------------------------------------------
|
|
249
|
-
npm start // installs dependencies and global mocha for testing and jsdox for documentation
|
|
250
|
-
npm test // runs the mocha tests
|
|
251
|
-
npm run-script documentation // update documentation using jsdox, make sure to have it installed globally
|
|
252
|
-
|
|
253
247
|
Unit Tests
|
|
254
248
|
-------------------------------------------------
|
|
255
249
|
Mocha tests are placed under ``/test/`` folder. To run the tests, make sure you have all dependencies installed.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/apiMethods.js
CHANGED
|
@@ -49,8 +49,12 @@ module.exports = {
|
|
|
49
49
|
"payins_recurring_registration_get": ["/${apiVersion}/${clientId}/recurringpayinregistrations/${id}", "GET"],
|
|
50
50
|
"payins_recurring_registration_put": ["/${apiVersion}/${clientId}/recurringpayinregistrations/${id}", "PUT"],
|
|
51
51
|
"payins_create_recurring_card_direct": ["/${apiVersion}/${clientId}/payins/recurring/card/direct", "POST"],
|
|
52
|
+
"payins_recurring_card-direct_create": ["/${apiVersion}/${clientId}/payins/recurring/card/direct", "POST"],
|
|
52
53
|
"payins_create_recurring_paypal": ["/${apiVersion}/${clientId}/payins/payment-methods/paypal/recurring", "POST"],
|
|
53
|
-
"
|
|
54
|
+
"payins_recurring_paypal-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/paypal/recurring", "POST"],
|
|
55
|
+
"payins_recurring_applepay-direct_create": ["/${apiVersion}/${clientId}/payins/payment-methods/applepay/recurring", "POST"],
|
|
56
|
+
"payins_recurring_googlepay-direct_create": ["/${apiVersion}/${clientId}/payins/payment-methods/googlepay/recurring", "POST"],
|
|
57
|
+
"payins_deposit_preauthorized_without_complement": ["/${apiVersion}/${clientId}/payins/deposit-preauthorized/direct/full-capture", "POST"],
|
|
54
58
|
"payins_deposit_preauthorized_prior_to_complement": ["/${apiVersion}/${clientId}/payins/deposit-preauthorized/direct/capture-with-complement", "POST"],
|
|
55
59
|
"payins_deposit_preauthorized_complement": ["/${apiVersion}/${clientId}/payins/deposit-preauthorized/direct/complement", "POST"],
|
|
56
60
|
"payins_mbway-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/mbway", "POST"],
|
|
@@ -237,6 +241,7 @@ module.exports = {
|
|
|
237
241
|
"countries_get_all": ["/${apiVersion}/countries/authorizations", "GET"],
|
|
238
242
|
|
|
239
243
|
"deposits_create": ["/${apiVersion}/${clientId}/deposit-preauthorizations/card/direct", "POST"],
|
|
244
|
+
"deposits_paypal_create": ["/${apiVersion}/${clientId}/deposit-preauthorizations/payment-methods/paypal", "POST"],
|
|
240
245
|
"deposits_get": ["/${apiVersion}/${clientId}/deposit-preauthorizations/${depositId}", "GET"],
|
|
241
246
|
"deposits_update": ["/${apiVersion}/${clientId}/deposit-preauthorizations/${depositId}", "PUT"],
|
|
242
247
|
"deposits_get_all_for_card": ["/${apiVersion}/${clientId}/cards/${cardId}/deposit-preauthorizations", "GET"],
|
|
@@ -93,8 +93,8 @@ var CardPreAuthorization = Model.extend({
|
|
|
93
93
|
MultiCapture: null,
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
* Is not Mandatory for 3DSv1 (flag
|
|
97
|
-
* Is mandatory when the flag
|
|
96
|
+
* Is not Mandatory for 3DSv1 (flag Use 3DSV2 Scenario OFF)
|
|
97
|
+
* Is mandatory when the flag Use 3DSV2 Scenario is active for (FORCE/DEFAULT/FRICTIONLESS both 3)
|
|
98
98
|
*/
|
|
99
99
|
IpAddress: null,
|
|
100
100
|
|
package/lib/models/Hook.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var Deposit = require('./Deposit');
|
|
2
|
+
|
|
3
|
+
module.exports = Deposit.extend({
|
|
4
|
+
defaults: {
|
|
5
|
+
PaypalPayerID: null,
|
|
6
|
+
PaypalOrderID: null,
|
|
7
|
+
BuyerFirstname: null,
|
|
8
|
+
BuyerLastname: null,
|
|
9
|
+
BuyerPhone: null,
|
|
10
|
+
BuyerCountry: null,
|
|
11
|
+
PaypalBuyerAccountEmail: null,
|
|
12
|
+
CancelURL: null,
|
|
13
|
+
Trackings: null,
|
|
14
|
+
ShippingPreference: null,
|
|
15
|
+
Reference: null,
|
|
16
|
+
LineItems: null,
|
|
17
|
+
RedirectURL: null,
|
|
18
|
+
ReturnURL: null,
|
|
19
|
+
DataCollectionId: null
|
|
20
|
+
}
|
|
21
|
+
});
|
package/lib/models/ReportV2.js
CHANGED
package/lib/services/Deposits.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var Service = require('../service');
|
|
2
2
|
var Deposit = require('../models/Deposit');
|
|
3
|
+
var PayPalDepositPreauthorization = require('../models/PayPalDepositPreauthorization');
|
|
3
4
|
|
|
4
5
|
var Deposits = Service.extend({
|
|
5
6
|
/**
|
|
@@ -14,6 +15,18 @@ var Deposits = Service.extend({
|
|
|
14
15
|
return this._api.method('deposits_create', callback, options);
|
|
15
16
|
},
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Create a PayPal Deposit Preauthorization
|
|
20
|
+
*/
|
|
21
|
+
createPayPalPreauthorization: function(deposit, callback, options) {
|
|
22
|
+
options = this._api._getOptions(callback, options, {
|
|
23
|
+
data: deposit,
|
|
24
|
+
dataClass: PayPalDepositPreauthorization
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return this._api.method('deposits_paypal_create', callback, options);
|
|
28
|
+
},
|
|
29
|
+
|
|
17
30
|
/**
|
|
18
31
|
* Get a Deposit
|
|
19
32
|
*/
|
package/lib/services/PayIns.js
CHANGED
|
@@ -61,12 +61,33 @@ var PayIns = Service.extend({
|
|
|
61
61
|
return this._api.method('payins_' + paymentKey + '-' + executionKey + '_create', callback, options);
|
|
62
62
|
},
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Create new recurring pay-in (Card, ApplePay, GooglePay, PayPal),
|
|
66
|
+
* following the same pattern (object structure) as non-recurring payins
|
|
67
|
+
* @param {Object} recurringPayIn PayIn object
|
|
68
|
+
* @param {Function} callback Callback function
|
|
69
|
+
* @param {Object} options Request options
|
|
70
|
+
* @return {Object} Request promise
|
|
71
|
+
*/
|
|
72
|
+
createRecurringPayIn: function(recurringPayIn, callback, options) {
|
|
73
|
+
options = this._api._getOptions(callback, options, {
|
|
74
|
+
data: recurringPayIn,
|
|
75
|
+
dataClass: RecurringPayIn
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
var paymentKey = this.getPaymentKey(recurringPayIn);
|
|
79
|
+
var executionKey = this.getExecutionKey(recurringPayIn);
|
|
80
|
+
|
|
81
|
+
return this._api.method('payins_recurring_' + paymentKey + '-' + executionKey + '_create', callback, options);
|
|
82
|
+
},
|
|
83
|
+
|
|
64
84
|
/**
|
|
65
85
|
* Get recurring pay-in
|
|
66
86
|
* @param {number} payInId PayIn identifier
|
|
67
87
|
* @param {Function} callback Callback function
|
|
68
88
|
* @param {Object} options Request options
|
|
69
89
|
* @return {Object} Request promise
|
|
90
|
+
* @deprecated Use 'getRecurringPayInRegistration' instead
|
|
70
91
|
*/
|
|
71
92
|
getRecurringPayin: function(payInId, callback, options) {
|
|
72
93
|
options = this._api._getOptions(callback, options, {
|
|
@@ -79,6 +100,24 @@ var PayIns = Service.extend({
|
|
|
79
100
|
return this._api.method('payins_recurring_registration_get', callback, options);
|
|
80
101
|
},
|
|
81
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Get recurring PayIn registration
|
|
105
|
+
* @param {number} recurringPayInRegistrationId Recurring PayIn registration identifier
|
|
106
|
+
* @param {Function} callback Callback function
|
|
107
|
+
* @param {Object} options Request options
|
|
108
|
+
* @return {Object} Request promise
|
|
109
|
+
*/
|
|
110
|
+
getRecurringPayInRegistration: function(recurringPayInRegistrationId, callback, options) {
|
|
111
|
+
options = this._api._getOptions(callback, options, {
|
|
112
|
+
path: {
|
|
113
|
+
id: recurringPayInRegistrationId
|
|
114
|
+
},
|
|
115
|
+
dataClass: PayInRecurringRegistration
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return this._api.method('payins_recurring_registration_get', callback, options);
|
|
119
|
+
},
|
|
120
|
+
|
|
82
121
|
/**
|
|
83
122
|
* Update recurring pay-in
|
|
84
123
|
* @param {number} payInId PayIn identifier
|
|
@@ -86,6 +125,7 @@ var PayIns = Service.extend({
|
|
|
86
125
|
* @param {Function} callback Callback function
|
|
87
126
|
* @param {Object} options Request options
|
|
88
127
|
* @return {Object} Request promise
|
|
128
|
+
* @deprecated Use 'updateRecurringPayInRegistration' instead
|
|
89
129
|
*/
|
|
90
130
|
updateRecurringPayin: function(payInId, toUpdate, callback, options) {
|
|
91
131
|
options = this._api._getOptions(callback, options, {
|
|
@@ -99,12 +139,32 @@ var PayIns = Service.extend({
|
|
|
99
139
|
return this._api.method('payins_recurring_registration_put', callback, options);
|
|
100
140
|
},
|
|
101
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Update recurring PayIn Registration
|
|
144
|
+
* @param {Object} recurringPayInRegistration Object to be updated. Must contain the id.
|
|
145
|
+
* @param {Function} callback Callback function
|
|
146
|
+
* @param {Object} options Request options
|
|
147
|
+
* @return {Object} Request promise
|
|
148
|
+
*/
|
|
149
|
+
updateRecurringPayInRegistration: function(recurringPayInRegistration, callback, options) {
|
|
150
|
+
options = this._api._getOptions(callback, options, {
|
|
151
|
+
path: {
|
|
152
|
+
id: recurringPayInRegistration.Id
|
|
153
|
+
},
|
|
154
|
+
data: recurringPayInRegistration,
|
|
155
|
+
dataClass: PayInRecurringRegistration
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
return this._api.method('payins_recurring_registration_put', callback, options);
|
|
159
|
+
},
|
|
160
|
+
|
|
102
161
|
/**
|
|
103
162
|
* Create Payin Registration
|
|
104
163
|
* @param {Object} payIn PayInRecurringRegistration object
|
|
105
164
|
* @param {Function} callback Callback function
|
|
106
165
|
* @param {Object} options Request options
|
|
107
166
|
* @return {Object} Request promise
|
|
167
|
+
* @deprecated Use 'createRecurringPayInRegistration' instead
|
|
108
168
|
*/
|
|
109
169
|
createRecurringPayment: function(recurringPayin, callback, options) {
|
|
110
170
|
options = this._api._getOptions(callback, options, {
|
|
@@ -115,12 +175,29 @@ var PayIns = Service.extend({
|
|
|
115
175
|
return this._api.method('payins_recurring_registration', callback, options);
|
|
116
176
|
},
|
|
117
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Create Recurring Payin Registration
|
|
180
|
+
* @param {Object} recurringPayinRegistration PayInRecurringRegistration object
|
|
181
|
+
* @param {Function} callback Callback function
|
|
182
|
+
* @param {Object} options Request options
|
|
183
|
+
* @return {Object} Request promise
|
|
184
|
+
*/
|
|
185
|
+
createRecurringPayInRegistration: function(recurringPayinRegistration, callback, options) {
|
|
186
|
+
options = this._api._getOptions(callback, options, {
|
|
187
|
+
data: recurringPayinRegistration,
|
|
188
|
+
dataClass: PayInRecurringRegistration
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return this._api.method('payins_recurring_registration', callback, options);
|
|
192
|
+
},
|
|
193
|
+
|
|
118
194
|
/**
|
|
119
195
|
* Create new recurring pay-in CIT
|
|
120
196
|
* @param {Object} payIn PayIn object
|
|
121
197
|
* @param {Function} callback Callback function
|
|
122
198
|
* @param {Object} options Request options
|
|
123
199
|
* @return {Object} Request promise
|
|
200
|
+
* @deprecated Use 'createRecurringPayIn' instead
|
|
124
201
|
*/
|
|
125
202
|
createRecurringPayInRegistrationCIT: function(payIn, callback, options) {
|
|
126
203
|
options = this._api._getOptions(callback, options, {
|
|
@@ -137,6 +214,7 @@ var PayIns = Service.extend({
|
|
|
137
214
|
* @param {Function} callback Callback function
|
|
138
215
|
* @param {Object} options Request options
|
|
139
216
|
* @return {Object} Request promise
|
|
217
|
+
* @deprecated Use 'createRecurringPayIn' instead
|
|
140
218
|
*/
|
|
141
219
|
createRecurringPayInRegistrationMIT: function(payIn, callback, options) {
|
|
142
220
|
options = this._api._getOptions(callback, options, {
|
|
@@ -153,6 +231,7 @@ var PayIns = Service.extend({
|
|
|
153
231
|
* @param {Function} callback Callback function
|
|
154
232
|
* @param {Object} options Request options
|
|
155
233
|
* @return {Object} Request promise
|
|
234
|
+
* @deprecated Use 'createRecurringPayIn' instead
|
|
156
235
|
*/
|
|
157
236
|
createRecurringPayPalPayInCIT: function(payIn, callback, options) {
|
|
158
237
|
options = this._api._getOptions(callback, options, {
|
|
@@ -169,6 +248,7 @@ var PayIns = Service.extend({
|
|
|
169
248
|
* @param {Function} callback Callback function
|
|
170
249
|
* @param {Object} options Request options
|
|
171
250
|
* @return {Object} Request promise
|
|
251
|
+
* @deprecated Use 'createRecurringPayIn' instead
|
|
172
252
|
*/
|
|
173
253
|
createRecurringPayPalPayInMIT: function(payIn, callback, options) {
|
|
174
254
|
options = this._api._getOptions(callback, options, {
|
|
@@ -239,6 +319,7 @@ var PayIns = Service.extend({
|
|
|
239
319
|
|
|
240
320
|
/**
|
|
241
321
|
* Create new Card PreAuthorized Deposit PayIn without complement
|
|
322
|
+
* @deprecated Use 'createDepositPreauthorizedPayInWithoutComplement' instead
|
|
242
323
|
*/
|
|
243
324
|
createCardPreAuthorizedDepositPayIn: function(payIn, callback, options) {
|
|
244
325
|
options = this._api._getOptions(callback, options, {
|
|
@@ -246,7 +327,19 @@ var PayIns = Service.extend({
|
|
|
246
327
|
dataClass: PayIn
|
|
247
328
|
});
|
|
248
329
|
|
|
249
|
-
return this._api.method('
|
|
330
|
+
return this._api.method('payins_deposit_preauthorized_without_complement', callback, options);
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Create new Deposit PreAuthorized PayIn without complement
|
|
335
|
+
*/
|
|
336
|
+
createDepositPreauthorizedPayInWithoutComplement: function(payIn, callback, options) {
|
|
337
|
+
options = this._api._getOptions(callback, options, {
|
|
338
|
+
data: payIn,
|
|
339
|
+
dataClass: PayIn
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
return this._api.method('payins_deposit_preauthorized_without_complement', callback, options);
|
|
250
343
|
},
|
|
251
344
|
|
|
252
345
|
/**
|
package/package.json
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mangopay4-nodejs-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"types": "./typings/index.d.ts",
|
|
5
5
|
"description": "Mangopay Node.js SDK",
|
|
6
|
-
"repository": "https://github.com/Mangopay/mangopay2-nodejs-sdk.git",
|
|
7
6
|
"license": "MIT",
|
|
8
|
-
"keywords": [
|
|
9
|
-
"mangopay",
|
|
10
|
-
"nodejs",
|
|
11
|
-
"sdk",
|
|
12
|
-
"credit cards",
|
|
13
|
-
"api"
|
|
14
|
-
],
|
|
15
7
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
8
|
+
"node": ">=22.0.0"
|
|
17
9
|
},
|
|
18
10
|
"main": "./index.js",
|
|
19
11
|
"dependencies": {
|
|
20
|
-
"@types/node": "
|
|
21
|
-
"axios": "1.
|
|
22
|
-
"form-data": "4.0.
|
|
23
|
-
"promise": "8.
|
|
24
|
-
"underscore": "1.
|
|
12
|
+
"@types/node": "22.19.18",
|
|
13
|
+
"axios": "1.17.0",
|
|
14
|
+
"form-data": "4.0.6",
|
|
15
|
+
"promise": "8.3.0",
|
|
16
|
+
"underscore": "1.13.8"
|
|
25
17
|
},
|
|
26
18
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"ts-node": "
|
|
32
|
-
"
|
|
19
|
+
"c8": "11.0.0",
|
|
20
|
+
"chai": "4.5.0",
|
|
21
|
+
"mocha": "11.7.5",
|
|
22
|
+
"sinon": "21.0.1",
|
|
23
|
+
"ts-node": "10.9.2",
|
|
24
|
+
"tsd": "0.33.0",
|
|
25
|
+
"typescript": "6.0.3"
|
|
33
26
|
},
|
|
34
27
|
"scripts": {
|
|
35
|
-
"start": "npm install -g mocha && npm install -g jsdox && npm install",
|
|
36
|
-
"documentation": "jsdox -t docs/templates/ -i README -o docs lib/services",
|
|
37
28
|
"test": "mocha 'test/**/*.js' --recursive --timeout 30000 --ui bdd",
|
|
29
|
+
"test:coverage": "c8 --reporter=lcov --reporter=text pnpm test",
|
|
38
30
|
"test:types": "tsd"
|
|
39
31
|
}
|
|
40
|
-
}
|
|
32
|
+
}
|
package/typings/enums.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export namespace cardPreAuthorization {
|
|
|
16
16
|
import ShippingData = shipping.ShippingData;
|
|
17
17
|
import CardInfoData = card.CardInfoData;
|
|
18
18
|
import AuthenticationResult = payIn.AuthenticationResult;
|
|
19
|
+
import FlowDescriptor = payIn.FlowDescriptor;
|
|
19
20
|
|
|
20
21
|
type PreAuthorizationExecutionType = "DIRECT";
|
|
21
22
|
|
|
@@ -24,7 +25,7 @@ export namespace cardPreAuthorization {
|
|
|
24
25
|
type PreAuthorizationStatus = "CREATED" | "SUCCEEDED" | "FAILED";
|
|
25
26
|
|
|
26
27
|
type CreateCardPreAuthorization = PickPartialRequired<CardPreAuthorizationData,
|
|
27
|
-
"Tag" | "Billing" | "SecureMode" | "Culture" | "StatementDescriptor" | "Shipping" | "PaymentCategory", "AuthorId" | "DebitedFunds" | "CardId" | "SecureModeReturnURL" | "IpAddress" | "BrowserInfo">;
|
|
28
|
+
"Tag" | "Billing" | "SecureMode" | "Culture" | "StatementDescriptor" | "Shipping" | "PaymentCategory" | "FlowDescriptor", "AuthorId" | "DebitedFunds" | "CardId" | "SecureModeReturnURL" | "IpAddress" | "BrowserInfo">;
|
|
28
29
|
|
|
29
30
|
type UpdateCardPreAuthorization = PickPartialRequired<CardPreAuthorizationData,
|
|
30
31
|
"Tag",
|
|
@@ -160,5 +161,10 @@ export namespace cardPreAuthorization {
|
|
|
160
161
|
* Authentication result
|
|
161
162
|
*/
|
|
162
163
|
AuthenticationResult?: AuthenticationResult;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Information about the payment flow and its Beneficiaries.
|
|
167
|
+
*/
|
|
168
|
+
FlowDescriptor?: FlowDescriptor;
|
|
163
169
|
}
|
|
164
170
|
}
|