mangopay4-nodejs-sdk 1.67.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 (67) hide show
  1. package/CHANGELOG.md +39 -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/apiMethods.js +10 -3
  9. package/lib/models/CardPreAuthorization.js +2 -2
  10. package/lib/models/PayInPaymentType.js +0 -1
  11. package/lib/models/ReportFilterV2.js +2 -1
  12. package/lib/services/Acquiring.js +152 -0
  13. package/lib/services/PayIns.js +0 -18
  14. package/lib/services/index.js +2 -1
  15. package/package.json +16 -24
  16. package/typings/enums.d.ts +0 -1
  17. package/typings/index.d.ts +5 -5
  18. package/typings/index.test-d.ts +0 -15
  19. package/typings/models/acquiring.d.ts +763 -0
  20. package/typings/models/payIn.d.ts +20 -80
  21. package/typings/models/refund.d.ts +1 -0
  22. package/typings/models/reportV2.d.ts +2 -0
  23. package/typings/services/Acquiring.d.ts +44 -0
  24. package/typings/services/PayIns.d.ts +0 -8
  25. package/typings/types.d.ts +0 -2
  26. package/.github/workflows/node.js.yml +0 -32
  27. package/.github/workflows/npm-publish.yml +0 -26
  28. package/.jshintrc +0 -16
  29. package/lib/models/PayInPaymentDetailsPayconiq.js +0 -23
  30. package/test/TestKycPageFile.png +0 -0
  31. package/test/helpers.js +0 -1536
  32. package/test/main.js +0 -10
  33. package/test/mocha.opts +0 -3
  34. package/test/services/BankAccounts.js +0 -46
  35. package/test/services/BankingAliases.js +0 -89
  36. package/test/services/CardPreAuthorizations.js +0 -70
  37. package/test/services/CardRegistrations.js +0 -239
  38. package/test/services/Cards.js +0 -56
  39. package/test/services/Clients.js +0 -235
  40. package/test/services/Conversions.js +0 -319
  41. package/test/services/Deposits.js +0 -148
  42. package/test/services/Disputes.js +0 -542
  43. package/test/services/EMoney.js +0 -54
  44. package/test/services/Events.js +0 -147
  45. package/test/services/Hooks.js +0 -109
  46. package/test/services/Idempotency.js +0 -41
  47. package/test/services/IdentityVerifications.js +0 -68
  48. package/test/services/KycDocuments.js +0 -73
  49. package/test/services/Mandates.js +0 -256
  50. package/test/services/PayIns.js +0 -2748
  51. package/test/services/PayOuts.js +0 -119
  52. package/test/services/RateLimit.js +0 -43
  53. package/test/services/Recipients.js +0 -234
  54. package/test/services/Refunds.js +0 -123
  55. package/test/services/Regulatory.js +0 -45
  56. package/test/services/Reports.js +0 -114
  57. package/test/services/ReportsV2.js +0 -306
  58. package/test/services/Repudiations.js +0 -22
  59. package/test/services/Settlements.js +0 -127
  60. package/test/services/Tokens.js +0 -55
  61. package/test/services/Transfers.js +0 -137
  62. package/test/services/UboDeclarations.js +0 -130
  63. package/test/services/Users.js +0 -1322
  64. package/test/services/VirtualAccounts.js +0 -105
  65. package/test/services/Wallets.js +0 -132
  66. package/test/settlement_sample.csv +0 -8
  67. package/test/settlement_sample_bad.csv +0 -8
@@ -29,7 +29,6 @@ export namespace payIn {
29
29
  | CardWebPayInData
30
30
  | BankWireDirectPayInData
31
31
  | BankWireExternalInstructionPayInData
32
- | PayconiqWebPayInData
33
32
  | DirectDebitDirectPayInData
34
33
  | MbwayWebPayInData
35
34
  | BancontactWebPayInData
@@ -398,6 +397,11 @@ export namespace payIn {
398
397
  * Authentication result
399
398
  */
400
399
  AuthenticationResult?: AuthenticationResult;
400
+
401
+ /**
402
+ * Preferred Card Network
403
+ */
404
+ PreferredCardNetwork?: string;
401
405
  }
402
406
 
403
407
  interface MbwayWebPayInData extends BasePayInData {
@@ -726,6 +730,11 @@ export namespace payIn {
726
730
  * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data.
727
731
  */
728
732
  ProfilingAttemptReference?: string;
733
+
734
+ /**
735
+ * Preferred Card Network
736
+ */
737
+ PreferredCardNetwork?: string;
729
738
  }
730
739
 
731
740
  interface CreateMbwayWebPayIn {
@@ -1158,6 +1167,11 @@ export namespace payIn {
1158
1167
  * The unique identifier of the line item.
1159
1168
  */
1160
1169
  Sku: string;
1170
+
1171
+ /**
1172
+ * The discount applied to the item.
1173
+ */
1174
+ Discount?: number;
1161
1175
  }
1162
1176
 
1163
1177
  interface CreateLineItem {
@@ -1197,6 +1211,11 @@ export namespace payIn {
1197
1211
  * The unique identifier of the line item.
1198
1212
  */
1199
1213
  Sku?: string;
1214
+
1215
+ /**
1216
+ * The discount applied to the item.
1217
+ */
1218
+ Discount?: number;
1200
1219
  }
1201
1220
 
1202
1221
  interface DirectDebitDirectPayInData extends BasePayInData {
@@ -1967,85 +1986,6 @@ export namespace payIn {
1967
1986
  DataCollectionId?: string;
1968
1987
  }
1969
1988
 
1970
- interface PayconiqWebPayInData extends BasePayInData {
1971
- ExecutionType: "WEB";
1972
- PaymentType: "PAYCONIQ";
1973
-
1974
- /**
1975
- * Time in millis when the page consult will expire.
1976
- */
1977
- ExpirationDate: Timestamp;
1978
-
1979
- /**
1980
- * The URL to redirect to after payment (whether successful or not)
1981
- */
1982
- ReturnURL: string;
1983
-
1984
- /**
1985
- * The URL to redirect to user to for them to proceed with the payment
1986
- */
1987
- RedirectURL: string;
1988
-
1989
- /**
1990
- * The URL to be used in App2App workflow
1991
- */
1992
- DeepLinkURL: string;
1993
-
1994
- Country: CountryISO;
1995
-
1996
- QRCodeURL: string;
1997
-
1998
- StatementDescriptor: string;
1999
- }
2000
-
2001
- interface CreatePayconiqWebPayInData {
2002
- ExecutionType: "WEB";
2003
- PaymentType: "PAYCONIQ";
2004
-
2005
- /**
2006
- * Custom data that you can add to this item
2007
- */
2008
- Tag?: string;
2009
-
2010
- /**
2011
- * A user's ID
2012
- */
2013
- AuthorId: string;
2014
-
2015
- /**
2016
- * The ID of the wallet where money will be credited
2017
- */
2018
- CreditedWalletId: string;
2019
-
2020
- /**
2021
- * Information about the funds that are being debited
2022
- */
2023
- DebitedFunds: MoneyData;
2024
-
2025
- /**
2026
- * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet)
2027
- */
2028
- Fees: MoneyData;
2029
-
2030
- /**
2031
- * The URL to redirect to after payment (whether successful or not)
2032
- */
2033
- ReturnURL: string;
2034
-
2035
- /**
2036
- * The Country of the Address
2037
- */
2038
- Country: CountryISO;
2039
-
2040
- StatementDescriptor?: string;
2041
-
2042
- /**
2043
- * The unique reference generated for the profiling session,
2044
- * used by the fraud prevention solution to produce recommendations for the transaction using the profiling data.
2045
- */
2046
- ProfilingAttemptReference?: string;
2047
- }
2048
-
2049
1989
  interface CreateCardPreAuthorizedDepositPayIn {
2050
1990
  AuthorId?: string;
2051
1991
 
@@ -36,6 +36,7 @@ export namespace refund {
36
36
 
37
37
  interface RefundReason {
38
38
  RefundReasonType: RefundReasonType;
39
+ RefundReasonMessage?: string;
39
40
  }
40
41
 
41
42
  interface RefundData extends transaction.TransactionData {
@@ -29,6 +29,8 @@ export namespace reportV2 {
29
29
  ExternalProviderName?: string;
30
30
 
31
31
  Scheduled?: boolean;
32
+
33
+ SettlementId?: string;
32
34
  }
33
35
 
34
36
  interface ReportDataV2 extends entityBase.EntityBaseData {
@@ -0,0 +1,44 @@
1
+ import {acquiring} from "../models/acquiring";
2
+ import {base} from "../base";
3
+ import MethodOverload = base.MethodOverload;
4
+ import TwoArgsMethodOverload = base.TwoArgsMethodOverload;
5
+
6
+ export class Acquiring {
7
+ createPayIn:
8
+ MethodOverload<acquiring.CreateCardDirectPayIn, acquiring.CardDirectPayInData> &
9
+ MethodOverload<acquiring.CreateIdealWebPayIn, acquiring.IdealWebPayInData> &
10
+ MethodOverload<acquiring.CreateApplePayPayIn, acquiring.ApplePayPayInData> &
11
+ MethodOverload<acquiring.CreateGooglePayDirectPayIn, acquiring.GooglePayDirectPayInData> &
12
+ MethodOverload<acquiring.CreatePayPalWebPayIn, acquiring.PayPalWebPayInData>;
13
+
14
+ /**
15
+ * Send key pre-transaction data such as order details, buyer information,
16
+ * and merchant context before initiating a PayPal payment.
17
+ *
18
+ * Given that the payload can be anything, depending on what PayPal needs, there is no defined interface for it.
19
+ *
20
+ * @param dataCollection The data collection to be created
21
+ * @param callback Callback function
22
+ * @param options Request options
23
+ * @returns {Object} Request promise
24
+ */
25
+ createPayPalDataCollection: MethodOverload<any, any>;
26
+
27
+ /**
28
+ * Create refund for pay-in object
29
+ * @param payInId
30
+ * @param refundData
31
+ * @param options
32
+ */
33
+ createPayInRefund: TwoArgsMethodOverload<string, acquiring.CreatePayInRefund, acquiring.RefundData>;
34
+
35
+ /**
36
+ * Create a card validation
37
+ * @param cardId
38
+ * @param cardValidation
39
+ * @param callback
40
+ * @param options
41
+ * @returns {*|Promise}
42
+ */
43
+ createCardValidation: TwoArgsMethodOverload<string, acquiring.CreateCardValidation, acquiring.CardValidationData>;
44
+ }
@@ -18,7 +18,6 @@ export class PayIns {
18
18
  MethodOverload<payIn.CreateCardPreAuthorizedPayIn, payIn.CardPreAuthorizedPayInData> &
19
19
  MethodOverload<payIn.CreateCardWebPayIn, payIn.CardWebPayInData> &
20
20
  MethodOverload<payIn.CreateBankWireDirectPayIn, payIn.BankWireDirectPayInData> &
21
- MethodOverload<payIn.CreatePayconiqWebPayInData, payIn.PayconiqWebPayInData> &
22
21
  MethodOverload<payIn.CreateDirectDebitDirectPayIn, payIn.DirectDebitDirectPayInData> &
23
22
  MethodOverload<payIn.CreateDirectDebitWebPayIn, payIn.DirectDebitWebPayInData> &
24
23
  MethodOverload<payIn.CreateMbwayWebPayIn, payIn.MbwayWebPayInData> &
@@ -170,13 +169,6 @@ export class PayIns {
170
169
  */
171
170
  getCardWebPayInExtendedDetails: MethodOverload<string, payIn.CardWebExtendedPayInData>;
172
171
 
173
- /**
174
- * Create new pay-in Payconiq Web, using the latest API url (/payment-methods/payconiq)
175
- * @param payIn
176
- * @param options
177
- */
178
- createPayconiq: MethodOverload<payIn.CreatePayconiqWebPayInData, payIn.PayconiqWebPayInData>
179
-
180
172
  /**
181
173
  * Create a pay in intent authorization
182
174
  * @param {payIn.CreatePayInIntentAuthorization} payInIntentAuthorization PayInIntentAuthorization object
@@ -65,8 +65,6 @@ export type ApiMethod =
65
65
  | "payins_recurring_registration_put"
66
66
  | "payins_create_recurring_card_direct"
67
67
  | "payins_create_recurring_paypal"
68
- | "payins_payconiq-web_create"
69
- | "payins_payconiqv2-web_create"
70
68
  | "payouts_bankwire_create"
71
69
  | "payouts_bankwire_get"
72
70
  | "payouts_get"
@@ -1,32 +0,0 @@
1
- # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
-
4
- name: mangopay4-nodejs-sdk-ci
5
-
6
- on:
7
- push:
8
- branches:
9
- # push on master branch
10
- - master
11
- pull_request:
12
- branches: [ master ]
13
-
14
- jobs:
15
- build:
16
-
17
- runs-on: ubuntu-latest
18
-
19
- strategy:
20
- matrix:
21
- node-version: [16.x]
22
- # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
23
-
24
- steps:
25
- - uses: actions/checkout@v2
26
- - name: Use Node.js ${{ matrix.node-version }}
27
- uses: actions/setup-node@v2
28
- with:
29
- node-version: ${{ matrix.node-version }}
30
- - run: npm i
31
- - run: npm run build --if-present
32
- - run: npm test && npm run test:types
@@ -1,26 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: mangopay4-nodejs-sdk-cd
5
-
6
- on:
7
- push:
8
- # Sequence of patterns matched against refs/tags
9
- tags:
10
- # It pushes any tags that contain a v. ex: v1.16.1
11
- - '*'
12
-
13
- jobs:
14
- build:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v2
18
- - uses: actions/setup-node@v2
19
- with:
20
- node-version: 16
21
- registry-url: https://registry.npmjs.org/
22
- - run: npm i
23
- - run: npm run build --if-present
24
- - run: npm publish
25
- env:
26
- NODE_AUTH_TOKEN: ${{secrets.NPM_OFFICIEL_TOKEN}}
package/.jshintrc DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "nonew": true,
3
- "curly": true,
4
- "noarg": true,
5
- "forin": true,
6
- "noempty": true,
7
- "node": true,
8
- "eqeqeq": true,
9
- "undef": true,
10
- "bitwise": true,
11
- "esversion": 6,
12
- "browser": true,
13
- "predef": ["require", "module"],
14
- "mocha": true,
15
- "expr": true
16
- }
@@ -1,23 +0,0 @@
1
- var PayInPaymentDetails = require('./PayInPaymentDetails');
2
- var Money = require('./Money');
3
-
4
- var PayInPaymentDetailsPayconiq = PayInPaymentDetails.extend({
5
- defaults: {
6
- Country: null,
7
- AuthorId: null,
8
- DebitedFunds: null,
9
- Fees: null,
10
- DeepLinkURL: null,
11
- StatementDescriptor: null,
12
- QRCodeURL: null
13
- },
14
-
15
- getSubObjects: function() {
16
- return {
17
- 'DebitedFunds': Money,
18
- 'Fees': Money
19
- };
20
- },
21
- });
22
-
23
- module.exports = PayInPaymentDetailsPayconiq;
Binary file