mangopay4-nodejs-sdk 1.64.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/.github/workflows/node.js.yml +32 -0
- package/.github/workflows/npm-publish.yml +26 -0
- package/.jshintrc +16 -0
- package/CHANGELOG.md +946 -0
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/docs/BankAccounts.md +35 -0
- package/docs/BankingAliases.md +108 -0
- package/docs/CardPreAuthorizations.md +55 -0
- package/docs/CardRegistrations.md +55 -0
- package/docs/Cards.md +82 -0
- package/docs/Clients.md +142 -0
- package/docs/DisputeDocuments.md +53 -0
- package/docs/Disputes.md +292 -0
- package/docs/Events.md +23 -0
- package/docs/Hooks.md +68 -0
- package/docs/Idempotency.md +11 -0
- package/docs/KycDocuments.md +52 -0
- package/docs/Mandates.md +125 -0
- package/docs/OptionsHelper.md +32 -0
- package/docs/PayIns.md +72 -0
- package/docs/PayOuts.md +55 -0
- package/docs/README.md +131 -0
- package/docs/Refunds.md +25 -0
- package/docs/Reports.md +63 -0
- package/docs/Repudiations.md +25 -0
- package/docs/Responses.md +33 -0
- package/docs/Transfers.md +72 -0
- package/docs/UboDeclarations.md +70 -0
- package/docs/Users.md +322 -0
- package/docs/Wallets.md +70 -0
- package/docs/templates/class.mustache +11 -0
- package/docs/templates/file.mustache +53 -0
- package/docs/templates/function.mustache +33 -0
- package/docs/templates/index.mustache +26 -0
- package/docs/templates/overview.mustache +1 -0
- package/examples/createUsers.js +112 -0
- package/examples/createWallet.js +28 -0
- package/examples/failedRequest.js +20 -0
- package/examples/getBankAccounts.js +29 -0
- package/examples/getUserEmoney.js +16 -0
- package/examples/getUsers.js +32 -0
- package/examples/readResponseHeaders.js +42 -0
- package/index.js +1 -0
- package/lib/Model.js +58 -0
- package/lib/api.js +467 -0
- package/lib/apiMethods.js +270 -0
- package/lib/config.js +57 -0
- package/lib/log.js +9 -0
- package/lib/mangopay.js +8 -0
- package/lib/models/Address.js +32 -0
- package/lib/models/BankAccount.js +45 -0
- package/lib/models/BankAccountDetails.js +7 -0
- package/lib/models/BankAccountDetailsCA.js +12 -0
- package/lib/models/BankAccountDetailsGB.js +10 -0
- package/lib/models/BankAccountDetailsIBAN.js +10 -0
- package/lib/models/BankAccountDetailsOTHER.js +16 -0
- package/lib/models/BankAccountDetailsUS.js +14 -0
- package/lib/models/BankAccountType.js +8 -0
- package/lib/models/BankingAlias.js +37 -0
- package/lib/models/BankingAliasIBAN.js +27 -0
- package/lib/models/Billing.js +14 -0
- package/lib/models/BinData.js +16 -0
- package/lib/models/Birthplace.js +10 -0
- package/lib/models/BrowserInfo.js +15 -0
- package/lib/models/Card.js +19 -0
- package/lib/models/CardInfo.js +32 -0
- package/lib/models/CardPreAuthorization.js +144 -0
- package/lib/models/CardRegistration.js +29 -0
- package/lib/models/CardValidation.js +19 -0
- package/lib/models/CategorizeUserLegal.js +15 -0
- package/lib/models/CategorizeUserNatural.js +18 -0
- package/lib/models/Check.js +13 -0
- package/lib/models/CheckData.js +8 -0
- package/lib/models/Client.js +62 -0
- package/lib/models/ClientWallet.js +28 -0
- package/lib/models/Conversion.js +19 -0
- package/lib/models/ConversionRate.js +10 -0
- package/lib/models/CountryAuthorization.js +12 -0
- package/lib/models/DebitedBankAccount.js +15 -0
- package/lib/models/DeclaredUbo.js +29 -0
- package/lib/models/DeclaredUboStatus.js +17 -0
- package/lib/models/Deposit.js +29 -0
- package/lib/models/Dispute.js +46 -0
- package/lib/models/DisputeDocument.js +10 -0
- package/lib/models/DisputeDocumentPage.js +12 -0
- package/lib/models/DisputeReason.js +11 -0
- package/lib/models/Document.js +12 -0
- package/lib/models/DocumentPageConsult.js +17 -0
- package/lib/models/EMoney.js +30 -0
- package/lib/models/EntityBase.js +70 -0
- package/lib/models/Hook.js +19 -0
- package/lib/models/IdempotencyResponse.js +11 -0
- package/lib/models/IdentityVerification.js +12 -0
- package/lib/models/KycDocument.js +11 -0
- package/lib/models/KycDocumentStatus.js +7 -0
- package/lib/models/KycDocumentType.js +7 -0
- package/lib/models/KycPage.js +12 -0
- package/lib/models/LegalPersonType.js +7 -0
- package/lib/models/LegalRepresentative.js +16 -0
- package/lib/models/Mandate.js +69 -0
- package/lib/models/MandateStatus.js +7 -0
- package/lib/models/Money.js +16 -0
- package/lib/models/PayByBankSupportedBank.js +7 -0
- package/lib/models/PayIn.js +36 -0
- package/lib/models/PayInExecutionDetails.js +7 -0
- package/lib/models/PayInExecutionDetailsBankingAlias.js +19 -0
- package/lib/models/PayInExecutionDetailsDirect.js +29 -0
- package/lib/models/PayInExecutionDetailsWeb.js +40 -0
- package/lib/models/PayInExecutionType.js +5 -0
- package/lib/models/PayInIntent.js +20 -0
- package/lib/models/PayInIntentSplit.js +14 -0
- package/lib/models/PayInIntentSplits.js +7 -0
- package/lib/models/PayInPaymentDetails.js +7 -0
- package/lib/models/PayInPaymentDetailsApplePay.js +19 -0
- package/lib/models/PayInPaymentDetailsBancontact.js +13 -0
- package/lib/models/PayInPaymentDetailsBankWire.js +23 -0
- package/lib/models/PayInPaymentDetailsBankingAlias.js +18 -0
- package/lib/models/PayInPaymentDetailsBizum.js +23 -0
- package/lib/models/PayInPaymentDetailsBlik.js +17 -0
- package/lib/models/PayInPaymentDetailsCard.js +10 -0
- package/lib/models/PayInPaymentDetailsCardDirect.js +14 -0
- package/lib/models/PayInPaymentDetailsCardWeb.js +28 -0
- package/lib/models/PayInPaymentDetailsDirectDebitDirect.js +22 -0
- package/lib/models/PayInPaymentDetailsDirectDebitWeb.js +13 -0
- package/lib/models/PayInPaymentDetailsGiropay.js +15 -0
- package/lib/models/PayInPaymentDetailsGooglePay.js +35 -0
- package/lib/models/PayInPaymentDetailsIdeal.js +25 -0
- package/lib/models/PayInPaymentDetailsKlarna.js +36 -0
- package/lib/models/PayInPaymentDetailsMbway.js +20 -0
- package/lib/models/PayInPaymentDetailsMultibanco.js +14 -0
- package/lib/models/PayInPaymentDetailsPayByBank.js +71 -0
- package/lib/models/PayInPaymentDetailsPayPal.js +63 -0
- package/lib/models/PayInPaymentDetailsPayconiq.js +23 -0
- package/lib/models/PayInPaymentDetailsPreAuthorized.js +10 -0
- package/lib/models/PayInPaymentDetailsSatispay.js +19 -0
- package/lib/models/PayInPaymentDetailsSwish.js +35 -0
- package/lib/models/PayInPaymentDetailsTwint.js +15 -0
- package/lib/models/PayInPaymentType.js +21 -0
- package/lib/models/PayInRecurringRegistration.js +64 -0
- package/lib/models/PayInTemplateURLOptions.js +10 -0
- package/lib/models/PayOut.js +24 -0
- package/lib/models/PayOutPaymentDetails.js +7 -0
- package/lib/models/PayOutPaymentDetailsBankWire.js +32 -0
- package/lib/models/PayOutPaymentType.js +3 -0
- package/lib/models/PaymentData.js +20 -0
- package/lib/models/PaymentMethodMetadata.js +38 -0
- package/lib/models/PayoutMethods.js +7 -0
- package/lib/models/PendingUserAction.js +16 -0
- package/lib/models/PersonType.js +5 -0
- package/lib/models/PlatformCategorization.js +16 -0
- package/lib/models/PlatformType.js +10 -0
- package/lib/models/Quote.js +11 -0
- package/lib/models/Recipient.js +20 -0
- package/lib/models/RecipientSchema.js +17 -0
- package/lib/models/RecurringPayIn.js +10 -0
- package/lib/models/RecurringPayInCIT.js +32 -0
- package/lib/models/RecurringPayInCurrentState.js +24 -0
- package/lib/models/RecurringPayInMIT.js +27 -0
- package/lib/models/RecurringPayInPut.js +24 -0
- package/lib/models/Refund.js +26 -0
- package/lib/models/RefundReasonDetails.js +10 -0
- package/lib/models/Report.js +54 -0
- package/lib/models/ReportFilter.js +52 -0
- package/lib/models/ReportFilterV2.js +11 -0
- package/lib/models/ReportV2.js +28 -0
- package/lib/models/Repudiation.js +51 -0
- package/lib/models/SecurityInfo.js +12 -0
- package/lib/models/Settlement.js +16 -0
- package/lib/models/SettlementTransfer.js +37 -0
- package/lib/models/Shipping.js +14 -0
- package/lib/models/ShippingAddress.js +25 -0
- package/lib/models/ShippingPreference.js +5 -0
- package/lib/models/Transaction.js +50 -0
- package/lib/models/Transfer.js +13 -0
- package/lib/models/Ubo.js +19 -0
- package/lib/models/UboDeclaration.js +42 -0
- package/lib/models/UboDeclarationRefusedReasonType.js +23 -0
- package/lib/models/UboDeclarationStatus.js +26 -0
- package/lib/models/UboRefusedReasonType.js +14 -0
- package/lib/models/User.js +66 -0
- package/lib/models/UserCategory.js +5 -0
- package/lib/models/UserConsent.js +7 -0
- package/lib/models/UserDataFormatValidation.js +7 -0
- package/lib/models/UserEnrollmentResult.js +7 -0
- package/lib/models/UserLegal.js +65 -0
- package/lib/models/UserLegalOwner.js +66 -0
- package/lib/models/UserLegalPayer.js +66 -0
- package/lib/models/UserLegalSca.js +57 -0
- package/lib/models/UserNatural.js +51 -0
- package/lib/models/UserNaturalCapacity.js +13 -0
- package/lib/models/UserNaturalOwner.js +55 -0
- package/lib/models/UserNaturalPayer.js +55 -0
- package/lib/models/UserNaturalPut.js +49 -0
- package/lib/models/UserNaturalSca.js +56 -0
- package/lib/models/VirtualAccount.js +22 -0
- package/lib/models/Wallet.js +32 -0
- package/lib/models/index.js +102 -0
- package/lib/service.js +14 -0
- package/lib/services/BankAccounts.js +31 -0
- package/lib/services/BankingAliases.js +137 -0
- package/lib/services/CardPreAuthorizations.js +75 -0
- package/lib/services/CardRegistrations.js +64 -0
- package/lib/services/Cards.js +168 -0
- package/lib/services/Clients.js +196 -0
- package/lib/services/Conversions.js +155 -0
- package/lib/services/Deposits.js +109 -0
- package/lib/services/DisputeDocuments.js +65 -0
- package/lib/services/Disputes.js +409 -0
- package/lib/services/Events.js +24 -0
- package/lib/services/Hooks.js +81 -0
- package/lib/services/Idempotency.js +17 -0
- package/lib/services/IdentityVerifications.js +48 -0
- package/lib/services/KycDocuments.js +66 -0
- package/lib/services/Mandates.js +161 -0
- package/lib/services/OptionsHelper.js +20 -0
- package/lib/services/PayIns.js +690 -0
- package/lib/services/PayOuts.js +110 -0
- package/lib/services/Recipients.js +117 -0
- package/lib/services/Refunds.js +29 -0
- package/lib/services/Regulatory.js +29 -0
- package/lib/services/Reports.js +61 -0
- package/lib/services/ReportsV2.js +55 -0
- package/lib/services/Repudiations.js +33 -0
- package/lib/services/Responses.js +23 -0
- package/lib/services/Settlements.js +74 -0
- package/lib/services/Transfers.js +87 -0
- package/lib/services/UboDeclarations.js +135 -0
- package/lib/services/Users.js +831 -0
- package/lib/services/VirtualAccounts.js +99 -0
- package/lib/services/Wallets.js +85 -0
- package/lib/services/index.js +34 -0
- package/lib/utils.js +36 -0
- package/package.json +40 -0
- package/test/TestKycPageFile.png +0 -0
- package/test/helpers.js +1431 -0
- package/test/main.js +10 -0
- package/test/mocha.opts +3 -0
- package/test/services/BankAccounts.js +46 -0
- package/test/services/BankingAliases.js +89 -0
- package/test/services/CardPreAuthorizations.js +70 -0
- package/test/services/CardRegistrations.js +239 -0
- package/test/services/Cards.js +54 -0
- package/test/services/Clients.js +235 -0
- package/test/services/Conversions.js +308 -0
- package/test/services/Deposits.js +148 -0
- package/test/services/Disputes.js +542 -0
- package/test/services/EMoney.js +54 -0
- package/test/services/Events.js +143 -0
- package/test/services/Hooks.js +109 -0
- package/test/services/Idempotency.js +46 -0
- package/test/services/IdentityVerifications.js +68 -0
- package/test/services/KycDocuments.js +73 -0
- package/test/services/Mandates.js +256 -0
- package/test/services/PayIns.js +2553 -0
- package/test/services/PayOuts.js +106 -0
- package/test/services/RateLimit.js +48 -0
- package/test/services/Recipients.js +234 -0
- package/test/services/Refunds.js +123 -0
- package/test/services/Regulatory.js +45 -0
- package/test/services/Reports.js +114 -0
- package/test/services/ReportsV2.js +306 -0
- package/test/services/Repudiations.js +22 -0
- package/test/services/Settlements.js +58 -0
- package/test/services/Tokens.js +55 -0
- package/test/services/Transfers.js +137 -0
- package/test/services/UboDeclarations.js +135 -0
- package/test/services/Users.js +1303 -0
- package/test/services/VirtualAccounts.js +105 -0
- package/test/services/Wallets.js +132 -0
- package/test/settlement_sample.csv +8 -0
- package/typings/base.d.ts +308 -0
- package/typings/enums.d.ts +204 -0
- package/typings/index.d.ts +885 -0
- package/typings/index.test-d.ts +1535 -0
- package/typings/models/address.d.ts +70 -0
- package/typings/models/bankAccount.d.ts +235 -0
- package/typings/models/bankingAlias.d.ts +97 -0
- package/typings/models/billing.d.ts +42 -0
- package/typings/models/birthplace.d.ts +9 -0
- package/typings/models/card.d.ts +119 -0
- package/typings/models/cardPreauthorization.d.ts +157 -0
- package/typings/models/cardRegistration.d.ts +83 -0
- package/typings/models/cardValidation.d.ts +125 -0
- package/typings/models/client.d.ts +208 -0
- package/typings/models/conversion.d.ts +225 -0
- package/typings/models/conversionRate.d.ts +29 -0
- package/typings/models/countryAuthorization.d.ts +16 -0
- package/typings/models/deposit.d.ts +104 -0
- package/typings/models/dispute.d.ts +116 -0
- package/typings/models/disputeDocument.d.ts +119 -0
- package/typings/models/entityBase.d.ts +9 -0
- package/typings/models/event.d.ts +142 -0
- package/typings/models/hook.d.ts +39 -0
- package/typings/models/idempotency.d.ts +36 -0
- package/typings/models/identityVerification.d.ts +98 -0
- package/typings/models/kycDocument.d.ts +114 -0
- package/typings/models/mandate.d.ts +93 -0
- package/typings/models/money.d.ts +45 -0
- package/typings/models/payIn.d.ts +3742 -0
- package/typings/models/payOut.d.ts +144 -0
- package/typings/models/recipient.d.ts +242 -0
- package/typings/models/refund.d.ts +92 -0
- package/typings/models/report.d.ts +234 -0
- package/typings/models/reportV2.d.ts +145 -0
- package/typings/models/repudiation.d.ts +26 -0
- package/typings/models/securityInfo.d.ts +12 -0
- package/typings/models/settlement.d.ts +50 -0
- package/typings/models/settlementTransfer.d.ts +37 -0
- package/typings/models/shipping.d.ts +37 -0
- package/typings/models/shippingAddress.d.ts +15 -0
- package/typings/models/transaction.d.ts +85 -0
- package/typings/models/transfer.d.ts +119 -0
- package/typings/models/uboDeclaration.d.ts +100 -0
- package/typings/models/user.d.ts +1001 -0
- package/typings/models/virtualAccount.d.ts +182 -0
- package/typings/models/wallet.d.ts +46 -0
- package/typings/models.d.ts +74 -0
- package/typings/services/BankAccounts.d.ts +12 -0
- package/typings/services/BankingAliases.d.ts +51 -0
- package/typings/services/CardPreauthorizations.d.ts +44 -0
- package/typings/services/CardRegistrations.d.ts +43 -0
- package/typings/services/Cards.d.ts +80 -0
- package/typings/services/Clients.d.ts +77 -0
- package/typings/services/Conversions.d.ts +23 -0
- package/typings/services/Deposits.d.ts +20 -0
- package/typings/services/DisputeDocuments.d.ts +27 -0
- package/typings/services/Disputes.d.ts +169 -0
- package/typings/services/Events.d.ts +11 -0
- package/typings/services/Hooks.d.ts +33 -0
- package/typings/services/Idempotency.d.ts +7 -0
- package/typings/services/IdentityVerifications.d.ts +29 -0
- package/typings/services/KycDocuments.d.ts +38 -0
- package/typings/services/Mandates.d.ts +59 -0
- package/typings/services/OptionsHelper.d.ts +11 -0
- package/typings/services/PayIns.d.ts +319 -0
- package/typings/services/PayOuts.d.ts +34 -0
- package/typings/services/Recipients.d.ts +55 -0
- package/typings/services/Refunds.d.ts +12 -0
- package/typings/services/Regulatory.d.ts +17 -0
- package/typings/services/Reports.d.ts +26 -0
- package/typings/services/ReportsV2.d.ts +26 -0
- package/typings/services/Repudiations.d.ts +12 -0
- package/typings/services/Responses.d.ts +10 -0
- package/typings/services/Settlements.d.ts +28 -0
- package/typings/services/Transfers.d.ts +38 -0
- package/typings/services/UboDeclarations.d.ts +81 -0
- package/typings/services/Users.d.ts +308 -0
- package/typings/services/VirtualAccounts.d.ts +42 -0
- package/typings/services/Wallets.d.ts +36 -0
- package/typings/tsconfig.json +20 -0
- package/typings/tslint.json +11 -0
- package/typings/types.d.ts +652 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
var Transaction = require('./Transaction');
|
|
3
|
+
|
|
4
|
+
var Transfer = Transaction.extend({
|
|
5
|
+
defaults: _.extend({}, Transaction.prototype.defaults, {
|
|
6
|
+
DebitedWalletId: null,
|
|
7
|
+
CreditedWalletId: null,
|
|
8
|
+
ScaContext: null,
|
|
9
|
+
PendingUserAction: null
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
module.exports = Transfer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var EntityBase = require('./EntityBase');
|
|
2
|
+
var Address = require('./Address');
|
|
3
|
+
var Birthplace = require('./Birthplace');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* UBO entity
|
|
7
|
+
*/
|
|
8
|
+
var Ubo = EntityBase.extend({
|
|
9
|
+
defaults: {
|
|
10
|
+
FirstName: String,
|
|
11
|
+
LastName: String,
|
|
12
|
+
Address: Address,
|
|
13
|
+
Nationality: String,
|
|
14
|
+
Birthday: null,
|
|
15
|
+
Birthplace: Birthplace
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
module.exports = Ubo;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var EntityBase = require('./EntityBase');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UBO declaration entity.
|
|
5
|
+
*/
|
|
6
|
+
var UboDeclaration = EntityBase.extend({
|
|
7
|
+
defaults: {
|
|
8
|
+
/**
|
|
9
|
+
* cannot be modified by clients
|
|
10
|
+
*/
|
|
11
|
+
ProcessedDate: null,
|
|
12
|
+
/**
|
|
13
|
+
* Declaration status (one of UboDeclarationStatus)
|
|
14
|
+
*/
|
|
15
|
+
Status: null,
|
|
16
|
+
/**
|
|
17
|
+
* Array of reasons why the declaration was refused
|
|
18
|
+
* Values as declared in UboDeclarationRefusedReasonType.
|
|
19
|
+
*/
|
|
20
|
+
Reason: null,
|
|
21
|
+
/**
|
|
22
|
+
* Explanation of why the declaration was refused.
|
|
23
|
+
*/
|
|
24
|
+
Message: null,
|
|
25
|
+
/**
|
|
26
|
+
* Table of ubos (declared in Ubo)
|
|
27
|
+
*/
|
|
28
|
+
Ubos: []
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get array with read-only properties
|
|
33
|
+
* @return {Array} List of string properties
|
|
34
|
+
*/
|
|
35
|
+
getReadOnlyProperties: function () {
|
|
36
|
+
var properties = EntityBase.prototype.getReadOnlyProperties();
|
|
37
|
+
properties.push('ProcessedDate', 'Status', 'Reason', 'Message');
|
|
38
|
+
return properties;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
module.exports = UboDeclaration;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of reasons why a UBO declaration could be refused.
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
/**
|
|
6
|
+
* When at least one natural user is missing on the declaration
|
|
7
|
+
*/
|
|
8
|
+
MissingUbo: 'MISSING_UBO',
|
|
9
|
+
|
|
10
|
+
DeclarationDontMatchUboInfo: 'DECLARATION_DO_NOT_MATCH_UBO_INFORMATION',
|
|
11
|
+
|
|
12
|
+
WrongUboInformation: 'WRONG_UBO_INFORMATION',
|
|
13
|
+
|
|
14
|
+
UboIdentityNeeded: 'UBO_IDENTITY_NEEDED',
|
|
15
|
+
|
|
16
|
+
ShareholdersDeclarationNeeded: 'SHAREHOLDERS_DECLARATION_NEEDED',
|
|
17
|
+
|
|
18
|
+
OrganizationChartNeeded: 'ORGANIZATION_CHART_NEEDED',
|
|
19
|
+
|
|
20
|
+
DocumentsNeeded: 'DOCUMENTS_NEEDED',
|
|
21
|
+
|
|
22
|
+
SpecificCase: 'SPECIFIC_CASE'
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UBO declaration possible status enumeration.
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
/**
|
|
6
|
+
* When the UBO declaration was created
|
|
7
|
+
*/
|
|
8
|
+
Created: 'CREATED',
|
|
9
|
+
/**
|
|
10
|
+
* When validation has been requested for the UBO declaration
|
|
11
|
+
*/
|
|
12
|
+
ValidationAsked: 'VALIDATION_ASKED',
|
|
13
|
+
/**
|
|
14
|
+
* When the UBO declaration was validated
|
|
15
|
+
*/
|
|
16
|
+
Validated: 'VALIDATED',
|
|
17
|
+
/**
|
|
18
|
+
* When the UBO declaration was refused
|
|
19
|
+
*/
|
|
20
|
+
Refused: 'REFUSED',
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* When the UBO declaration was incomplete
|
|
24
|
+
*/
|
|
25
|
+
Incomplete: 'INCOMPLETE',
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumerated possible reasons why declaration of a user as UBO could be refused.
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
/**
|
|
6
|
+
* When user should not be declared as UBO
|
|
7
|
+
*/
|
|
8
|
+
InvalidDeclaredUbo: 'INVALID_DECLARED_UBO',
|
|
9
|
+
/**
|
|
10
|
+
* When user declared as UBO was created with wrong
|
|
11
|
+
* details (i.e. date of birth, country of residence)
|
|
12
|
+
*/
|
|
13
|
+
InvalidUboDetails: 'INVALID_UBO_DETAILS'
|
|
14
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
var EntityBase = require('./EntityBase');
|
|
3
|
+
|
|
4
|
+
var User = EntityBase.extend({
|
|
5
|
+
defaults: {
|
|
6
|
+
/**
|
|
7
|
+
* Type of user
|
|
8
|
+
*/
|
|
9
|
+
PersonType: null,
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Email address
|
|
13
|
+
*/
|
|
14
|
+
Email: null,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* KYC Level (LIGHT or REGULAR)
|
|
18
|
+
*/
|
|
19
|
+
KYCLevel: null,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not the user has accepted the MANGOPAY Terms and Conditions.
|
|
23
|
+
*/
|
|
24
|
+
TermsAndConditionsAccepted: null,
|
|
25
|
+
|
|
26
|
+
TermsAndConditionsAcceptedDate: null,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Category of the user. May take one of the following values:
|
|
30
|
+
* PAYER - Users who only use MANGOPAY to give money to other users
|
|
31
|
+
* OWNER - Users who use MANGOPAY to receive funds. Please note that a user needs to be KYC validated to perform payouts
|
|
32
|
+
*/
|
|
33
|
+
UserCategory: null,
|
|
34
|
+
|
|
35
|
+
UserStatus: null
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the person type to the model
|
|
40
|
+
* @param {String} personType
|
|
41
|
+
*/
|
|
42
|
+
setPersonType: function(personType) {
|
|
43
|
+
this.PersonType = personType;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
setUserCategory: function(userCategory) {
|
|
47
|
+
this.UserCategory = userCategory;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get array with read-only properties
|
|
52
|
+
* @return {Array} List of string properties
|
|
53
|
+
*/
|
|
54
|
+
getReadOnlyProperties: function() {
|
|
55
|
+
var properties = EntityBase.prototype.getReadOnlyProperties();
|
|
56
|
+
properties.push('PersonType', 'KYCLevel');
|
|
57
|
+
return properties;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
parse: function() {
|
|
61
|
+
var parsedValues = EntityBase.prototype.parse.call(this, arguments);
|
|
62
|
+
return _.omit(parsedValues, 'CreationDate');
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
module.exports = User;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WORK IN PROGRESS
|
|
3
|
+
*/
|
|
4
|
+
var _ = require('underscore');
|
|
5
|
+
|
|
6
|
+
var PersonType = require('./PersonType');
|
|
7
|
+
|
|
8
|
+
var User = require('./User');
|
|
9
|
+
var Address = require('./Address');
|
|
10
|
+
|
|
11
|
+
var UserLegal = User.extend({
|
|
12
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
13
|
+
Name: null,
|
|
14
|
+
/**
|
|
15
|
+
* Type for legal user. Possible: ‘BUSINESS’, ’ORGANIZATION’, 'SOLETRADER'
|
|
16
|
+
*/
|
|
17
|
+
LegalPersonType: null,
|
|
18
|
+
HeadquartersAddress: null,
|
|
19
|
+
LegalRepresentativeFirstName: null,
|
|
20
|
+
LegalRepresentativeLastName: null,
|
|
21
|
+
LegalRepresentativeAddress: null,
|
|
22
|
+
LegalRepresentativeEmail: null,
|
|
23
|
+
LegalRepresentativeBirthday: null,
|
|
24
|
+
LegalRepresentativeNationality: null,
|
|
25
|
+
LegalRepresentativeCountryOfResidence: null,
|
|
26
|
+
CompanyNumber: null,
|
|
27
|
+
ProofOfIdentity: null,
|
|
28
|
+
Statute: null,
|
|
29
|
+
ProofOfRegistration: null,
|
|
30
|
+
ShareholderDeclaration: null
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Construct
|
|
35
|
+
*/
|
|
36
|
+
initialize: function() {
|
|
37
|
+
User.prototype.initialize.apply(this, arguments);
|
|
38
|
+
this.setPersonType(PersonType.Legal);
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get object with key as object type and value the object class
|
|
43
|
+
* @return {Object} Sub-objects mapping
|
|
44
|
+
*/
|
|
45
|
+
getSubObjects: function() {
|
|
46
|
+
var subObjects = User.prototype.getSubObjects();
|
|
47
|
+
|
|
48
|
+
return _.extend({}, subObjects, {
|
|
49
|
+
HeadquartersAddress: Address,
|
|
50
|
+
LegalRepresentativeAddress: Address
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get array with read-only properties
|
|
56
|
+
* @return {Array} List of string properties
|
|
57
|
+
*/
|
|
58
|
+
getReadOnlyProperties: function() {
|
|
59
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
60
|
+
properties.push('Statute', 'ProofOfRegistration', 'ShareholderDeclaration');
|
|
61
|
+
return properties;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
module.exports = UserLegal;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
var UserCategory = require("./UserCategory");
|
|
8
|
+
|
|
9
|
+
var UserLegalOwner = User.extend({
|
|
10
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
11
|
+
Name: null,
|
|
12
|
+
/**
|
|
13
|
+
* Type for legal user. Possible: ‘BUSINESS’, ’ORGANIZATION’, 'SOLETRADER', 'PARTNERSHIP
|
|
14
|
+
*/
|
|
15
|
+
LegalPersonType: null,
|
|
16
|
+
HeadquartersAddress: null,
|
|
17
|
+
LegalRepresentativeFirstName: null,
|
|
18
|
+
LegalRepresentativeLastName: null,
|
|
19
|
+
LegalRepresentativeAddress: null,
|
|
20
|
+
LegalRepresentativeEmail: null,
|
|
21
|
+
LegalRepresentativeBirthday: null,
|
|
22
|
+
LegalRepresentativeNationality: null,
|
|
23
|
+
LegalRepresentativeCountryOfResidence: null,
|
|
24
|
+
CompanyNumber: null,
|
|
25
|
+
ProofOfIdentity: null,
|
|
26
|
+
Statute: null,
|
|
27
|
+
ProofOfRegistration: null,
|
|
28
|
+
ShareholderDeclaration: null,
|
|
29
|
+
UserCategory: null,
|
|
30
|
+
TermsAndConditionsAccepted: null
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Construct
|
|
35
|
+
*/
|
|
36
|
+
initialize: function() {
|
|
37
|
+
User.prototype.initialize.apply(this, arguments);
|
|
38
|
+
this.setPersonType(PersonType.Legal);
|
|
39
|
+
this.setUserCategory(UserCategory.Owner);
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get object with key as object type and value the object class
|
|
44
|
+
* @return {Object} Sub-objects mapping
|
|
45
|
+
*/
|
|
46
|
+
getSubObjects: function() {
|
|
47
|
+
var subObjects = User.prototype.getSubObjects();
|
|
48
|
+
|
|
49
|
+
return _.extend({}, subObjects, {
|
|
50
|
+
HeadquartersAddress: Address,
|
|
51
|
+
LegalRepresentativeAddress: Address
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get array with read-only properties
|
|
57
|
+
* @return {Array} List of string properties
|
|
58
|
+
*/
|
|
59
|
+
getReadOnlyProperties: function() {
|
|
60
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
61
|
+
properties.push('Statute', 'ProofOfRegistration', 'ShareholderDeclaration');
|
|
62
|
+
return properties;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
module.exports = UserLegalOwner;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
var UserCategory = require("./UserCategory");
|
|
8
|
+
|
|
9
|
+
var UserLegalPayer = User.extend({
|
|
10
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
11
|
+
Name: null,
|
|
12
|
+
/**
|
|
13
|
+
* Type for legal user. Possible: ‘BUSINESS’, ’ORGANIZATION’, 'SOLETRADER'
|
|
14
|
+
*/
|
|
15
|
+
LegalPersonType: null,
|
|
16
|
+
HeadquartersAddress: null,
|
|
17
|
+
LegalRepresentativeFirstName: null,
|
|
18
|
+
LegalRepresentativeLastName: null,
|
|
19
|
+
LegalRepresentativeAddress: null,
|
|
20
|
+
LegalRepresentativeEmail: null,
|
|
21
|
+
LegalRepresentativeBirthday: null,
|
|
22
|
+
LegalRepresentativeNationality: null,
|
|
23
|
+
LegalRepresentativeCountryOfResidence: null,
|
|
24
|
+
CompanyNumber: null,
|
|
25
|
+
ProofOfIdentity: null,
|
|
26
|
+
Statute: null,
|
|
27
|
+
ProofOfRegistration: null,
|
|
28
|
+
ShareholderDeclaration: null,
|
|
29
|
+
UserCategory: null,
|
|
30
|
+
TermsAndConditionsAccepted: null
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Construct
|
|
35
|
+
*/
|
|
36
|
+
initialize: function() {
|
|
37
|
+
User.prototype.initialize.apply(this, arguments);
|
|
38
|
+
this.setPersonType(PersonType.Legal);
|
|
39
|
+
this.setUserCategory(UserCategory.Payer);
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get object with key as object type and value the object class
|
|
44
|
+
* @return {Object} Sub-objects mapping
|
|
45
|
+
*/
|
|
46
|
+
getSubObjects: function() {
|
|
47
|
+
var subObjects = User.prototype.getSubObjects();
|
|
48
|
+
|
|
49
|
+
return _.extend({}, subObjects, {
|
|
50
|
+
HeadquartersAddress: Address,
|
|
51
|
+
LegalRepresentativeAddress: Address
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get array with read-only properties
|
|
57
|
+
* @return {Array} List of string properties
|
|
58
|
+
*/
|
|
59
|
+
getReadOnlyProperties: function() {
|
|
60
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
61
|
+
properties.push('Statute', 'ProofOfRegistration', 'ShareholderDeclaration');
|
|
62
|
+
return properties;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
module.exports = UserLegalPayer;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
var PendingUserAction = require('./PendingUserAction');
|
|
8
|
+
var LegalRepresentative = require('./LegalRepresentative');
|
|
9
|
+
|
|
10
|
+
var UserLegalSca = User.extend({
|
|
11
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
12
|
+
Name: null,
|
|
13
|
+
LegalPersonType: null,
|
|
14
|
+
LegalRepresentative: null,
|
|
15
|
+
ProofOfRegistration: null,
|
|
16
|
+
ShareholderDeclaration: null,
|
|
17
|
+
Statute: null,
|
|
18
|
+
CompanyNumber: null,
|
|
19
|
+
PendingUserAction: null,
|
|
20
|
+
HeadquartersAddress: null,
|
|
21
|
+
LegalRepresentativeAddress: null,
|
|
22
|
+
ScaContext: null
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
initialize: function() {
|
|
26
|
+
User.prototype.initialize.apply(this, arguments);
|
|
27
|
+
this.setPersonType(PersonType.Legal);
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get object with key as object type and value the object class
|
|
32
|
+
* @return {Object} Mapping of sub-objects
|
|
33
|
+
*/
|
|
34
|
+
getSubObjects: function() {
|
|
35
|
+
var subObjects = User.prototype.getSubObjects();
|
|
36
|
+
|
|
37
|
+
return _.extend({}, subObjects, {
|
|
38
|
+
Address: Address,
|
|
39
|
+
HeadquarterAddress: Address,
|
|
40
|
+
LegalRepresentativeAddress: Address,
|
|
41
|
+
PendingUserAction: PendingUserAction,
|
|
42
|
+
LegalRepresentative: LegalRepresentative
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get array with read-only properties
|
|
48
|
+
* @return {Array}
|
|
49
|
+
*/
|
|
50
|
+
getReadOnlyProperties: function() {
|
|
51
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
52
|
+
properties.push('Statute', 'ProofOfRegistration', 'ShareholderDeclaration');
|
|
53
|
+
return properties;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
module.exports = UserLegalSca;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
|
|
8
|
+
var UserNatural = User.extend({
|
|
9
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
10
|
+
FirstName: null,
|
|
11
|
+
LastName: null,
|
|
12
|
+
Address: null,
|
|
13
|
+
Birthday: null,
|
|
14
|
+
Nationality: null,
|
|
15
|
+
CountryOfResidence: null,
|
|
16
|
+
Occupation: null,
|
|
17
|
+
IncomeRange: null,
|
|
18
|
+
ProofOfIdentity: null,
|
|
19
|
+
ProofOfAddress: null,
|
|
20
|
+
Capacity: null
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
initialize: function() {
|
|
24
|
+
User.prototype.initialize.apply(this, arguments);
|
|
25
|
+
this.setPersonType(PersonType.Natural);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get object with key as object type and value the object class
|
|
30
|
+
* @return {Object} Mapping of sub-objects
|
|
31
|
+
*/
|
|
32
|
+
getSubObjects: function() {
|
|
33
|
+
var subObjects = User.prototype.getSubObjects();
|
|
34
|
+
|
|
35
|
+
return _.extend({}, subObjects, {
|
|
36
|
+
Address: Address
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get array with read-only properties
|
|
42
|
+
* @return {Array}
|
|
43
|
+
*/
|
|
44
|
+
getReadOnlyProperties: function() {
|
|
45
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
46
|
+
properties.push('PersonType', 'ProofOfIdentity', 'ProofOfAddress');
|
|
47
|
+
return properties;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
module.exports = UserNatural;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
var UserCategory = require("./UserCategory");
|
|
8
|
+
|
|
9
|
+
var UserNaturalOwner = User.extend({
|
|
10
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
11
|
+
FirstName: null,
|
|
12
|
+
LastName: null,
|
|
13
|
+
Address: null,
|
|
14
|
+
Birthday: null,
|
|
15
|
+
Nationality: null,
|
|
16
|
+
CountryOfResidence: null,
|
|
17
|
+
Occupation: null,
|
|
18
|
+
IncomeRange: null,
|
|
19
|
+
ProofOfIdentity: null,
|
|
20
|
+
ProofOfAddress: null,
|
|
21
|
+
Capacity: null,
|
|
22
|
+
UserCategory: null,
|
|
23
|
+
TermsAndConditionsAccepted: null
|
|
24
|
+
}),
|
|
25
|
+
|
|
26
|
+
initialize: function() {
|
|
27
|
+
User.prototype.initialize.apply(this, arguments);
|
|
28
|
+
this.setPersonType(PersonType.Natural);
|
|
29
|
+
this.setUserCategory(UserCategory.Owner);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get object with key as object type and value the object class
|
|
34
|
+
* @return {Object} Mapping of sub-objects
|
|
35
|
+
*/
|
|
36
|
+
getSubObjects: function() {
|
|
37
|
+
var subObjects = User.prototype.getSubObjects();
|
|
38
|
+
|
|
39
|
+
return _.extend({}, subObjects, {
|
|
40
|
+
Address: Address
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get array with read-only properties
|
|
46
|
+
* @return {Array}
|
|
47
|
+
*/
|
|
48
|
+
getReadOnlyProperties: function() {
|
|
49
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
50
|
+
properties.push('PersonType', 'ProofOfIdentity', 'ProofOfAddress');
|
|
51
|
+
return properties;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = UserNaturalOwner;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var _ = require('underscore');
|
|
2
|
+
|
|
3
|
+
var PersonType = require('./PersonType');
|
|
4
|
+
|
|
5
|
+
var User = require('./User');
|
|
6
|
+
var Address = require('./Address');
|
|
7
|
+
var UserCategory = require("./UserCategory");
|
|
8
|
+
|
|
9
|
+
var UserNaturalPayer = User.extend({
|
|
10
|
+
defaults: _.extend({}, User.prototype.defaults, {
|
|
11
|
+
FirstName: null,
|
|
12
|
+
LastName: null,
|
|
13
|
+
Address: null,
|
|
14
|
+
Birthday: null,
|
|
15
|
+
Nationality: null,
|
|
16
|
+
CountryOfResidence: null,
|
|
17
|
+
Occupation: null,
|
|
18
|
+
IncomeRange: null,
|
|
19
|
+
ProofOfIdentity: null,
|
|
20
|
+
ProofOfAddress: null,
|
|
21
|
+
Capacity: null,
|
|
22
|
+
UserCategory: null,
|
|
23
|
+
TermsAndConditionsAccepted: null
|
|
24
|
+
}),
|
|
25
|
+
|
|
26
|
+
initialize: function() {
|
|
27
|
+
User.prototype.initialize.apply(this, arguments);
|
|
28
|
+
this.setPersonType(PersonType.Natural);
|
|
29
|
+
this.setUserCategory(UserCategory.Payer);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get object with key as object type and value the object class
|
|
34
|
+
* @return {Object} Mapping of sub-objects
|
|
35
|
+
*/
|
|
36
|
+
getSubObjects: function() {
|
|
37
|
+
var subObjects = User.prototype.getSubObjects();
|
|
38
|
+
|
|
39
|
+
return _.extend({}, subObjects, {
|
|
40
|
+
Address: Address
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get array with read-only properties
|
|
46
|
+
* @return {Array}
|
|
47
|
+
*/
|
|
48
|
+
getReadOnlyProperties: function() {
|
|
49
|
+
var properties = User.prototype.getReadOnlyProperties();
|
|
50
|
+
properties.push('PersonType', 'ProofOfIdentity', 'ProofOfAddress');
|
|
51
|
+
return properties;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
module.exports = UserNaturalPayer;
|