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.
Files changed (353) hide show
  1. package/.github/workflows/node.js.yml +32 -0
  2. package/.github/workflows/npm-publish.yml +26 -0
  3. package/.jshintrc +16 -0
  4. package/CHANGELOG.md +946 -0
  5. package/LICENSE +21 -0
  6. package/README.md +179 -0
  7. package/docs/BankAccounts.md +35 -0
  8. package/docs/BankingAliases.md +108 -0
  9. package/docs/CardPreAuthorizations.md +55 -0
  10. package/docs/CardRegistrations.md +55 -0
  11. package/docs/Cards.md +82 -0
  12. package/docs/Clients.md +142 -0
  13. package/docs/DisputeDocuments.md +53 -0
  14. package/docs/Disputes.md +292 -0
  15. package/docs/Events.md +23 -0
  16. package/docs/Hooks.md +68 -0
  17. package/docs/Idempotency.md +11 -0
  18. package/docs/KycDocuments.md +52 -0
  19. package/docs/Mandates.md +125 -0
  20. package/docs/OptionsHelper.md +32 -0
  21. package/docs/PayIns.md +72 -0
  22. package/docs/PayOuts.md +55 -0
  23. package/docs/README.md +131 -0
  24. package/docs/Refunds.md +25 -0
  25. package/docs/Reports.md +63 -0
  26. package/docs/Repudiations.md +25 -0
  27. package/docs/Responses.md +33 -0
  28. package/docs/Transfers.md +72 -0
  29. package/docs/UboDeclarations.md +70 -0
  30. package/docs/Users.md +322 -0
  31. package/docs/Wallets.md +70 -0
  32. package/docs/templates/class.mustache +11 -0
  33. package/docs/templates/file.mustache +53 -0
  34. package/docs/templates/function.mustache +33 -0
  35. package/docs/templates/index.mustache +26 -0
  36. package/docs/templates/overview.mustache +1 -0
  37. package/examples/createUsers.js +112 -0
  38. package/examples/createWallet.js +28 -0
  39. package/examples/failedRequest.js +20 -0
  40. package/examples/getBankAccounts.js +29 -0
  41. package/examples/getUserEmoney.js +16 -0
  42. package/examples/getUsers.js +32 -0
  43. package/examples/readResponseHeaders.js +42 -0
  44. package/index.js +1 -0
  45. package/lib/Model.js +58 -0
  46. package/lib/api.js +467 -0
  47. package/lib/apiMethods.js +270 -0
  48. package/lib/config.js +57 -0
  49. package/lib/log.js +9 -0
  50. package/lib/mangopay.js +8 -0
  51. package/lib/models/Address.js +32 -0
  52. package/lib/models/BankAccount.js +45 -0
  53. package/lib/models/BankAccountDetails.js +7 -0
  54. package/lib/models/BankAccountDetailsCA.js +12 -0
  55. package/lib/models/BankAccountDetailsGB.js +10 -0
  56. package/lib/models/BankAccountDetailsIBAN.js +10 -0
  57. package/lib/models/BankAccountDetailsOTHER.js +16 -0
  58. package/lib/models/BankAccountDetailsUS.js +14 -0
  59. package/lib/models/BankAccountType.js +8 -0
  60. package/lib/models/BankingAlias.js +37 -0
  61. package/lib/models/BankingAliasIBAN.js +27 -0
  62. package/lib/models/Billing.js +14 -0
  63. package/lib/models/BinData.js +16 -0
  64. package/lib/models/Birthplace.js +10 -0
  65. package/lib/models/BrowserInfo.js +15 -0
  66. package/lib/models/Card.js +19 -0
  67. package/lib/models/CardInfo.js +32 -0
  68. package/lib/models/CardPreAuthorization.js +144 -0
  69. package/lib/models/CardRegistration.js +29 -0
  70. package/lib/models/CardValidation.js +19 -0
  71. package/lib/models/CategorizeUserLegal.js +15 -0
  72. package/lib/models/CategorizeUserNatural.js +18 -0
  73. package/lib/models/Check.js +13 -0
  74. package/lib/models/CheckData.js +8 -0
  75. package/lib/models/Client.js +62 -0
  76. package/lib/models/ClientWallet.js +28 -0
  77. package/lib/models/Conversion.js +19 -0
  78. package/lib/models/ConversionRate.js +10 -0
  79. package/lib/models/CountryAuthorization.js +12 -0
  80. package/lib/models/DebitedBankAccount.js +15 -0
  81. package/lib/models/DeclaredUbo.js +29 -0
  82. package/lib/models/DeclaredUboStatus.js +17 -0
  83. package/lib/models/Deposit.js +29 -0
  84. package/lib/models/Dispute.js +46 -0
  85. package/lib/models/DisputeDocument.js +10 -0
  86. package/lib/models/DisputeDocumentPage.js +12 -0
  87. package/lib/models/DisputeReason.js +11 -0
  88. package/lib/models/Document.js +12 -0
  89. package/lib/models/DocumentPageConsult.js +17 -0
  90. package/lib/models/EMoney.js +30 -0
  91. package/lib/models/EntityBase.js +70 -0
  92. package/lib/models/Hook.js +19 -0
  93. package/lib/models/IdempotencyResponse.js +11 -0
  94. package/lib/models/IdentityVerification.js +12 -0
  95. package/lib/models/KycDocument.js +11 -0
  96. package/lib/models/KycDocumentStatus.js +7 -0
  97. package/lib/models/KycDocumentType.js +7 -0
  98. package/lib/models/KycPage.js +12 -0
  99. package/lib/models/LegalPersonType.js +7 -0
  100. package/lib/models/LegalRepresentative.js +16 -0
  101. package/lib/models/Mandate.js +69 -0
  102. package/lib/models/MandateStatus.js +7 -0
  103. package/lib/models/Money.js +16 -0
  104. package/lib/models/PayByBankSupportedBank.js +7 -0
  105. package/lib/models/PayIn.js +36 -0
  106. package/lib/models/PayInExecutionDetails.js +7 -0
  107. package/lib/models/PayInExecutionDetailsBankingAlias.js +19 -0
  108. package/lib/models/PayInExecutionDetailsDirect.js +29 -0
  109. package/lib/models/PayInExecutionDetailsWeb.js +40 -0
  110. package/lib/models/PayInExecutionType.js +5 -0
  111. package/lib/models/PayInIntent.js +20 -0
  112. package/lib/models/PayInIntentSplit.js +14 -0
  113. package/lib/models/PayInIntentSplits.js +7 -0
  114. package/lib/models/PayInPaymentDetails.js +7 -0
  115. package/lib/models/PayInPaymentDetailsApplePay.js +19 -0
  116. package/lib/models/PayInPaymentDetailsBancontact.js +13 -0
  117. package/lib/models/PayInPaymentDetailsBankWire.js +23 -0
  118. package/lib/models/PayInPaymentDetailsBankingAlias.js +18 -0
  119. package/lib/models/PayInPaymentDetailsBizum.js +23 -0
  120. package/lib/models/PayInPaymentDetailsBlik.js +17 -0
  121. package/lib/models/PayInPaymentDetailsCard.js +10 -0
  122. package/lib/models/PayInPaymentDetailsCardDirect.js +14 -0
  123. package/lib/models/PayInPaymentDetailsCardWeb.js +28 -0
  124. package/lib/models/PayInPaymentDetailsDirectDebitDirect.js +22 -0
  125. package/lib/models/PayInPaymentDetailsDirectDebitWeb.js +13 -0
  126. package/lib/models/PayInPaymentDetailsGiropay.js +15 -0
  127. package/lib/models/PayInPaymentDetailsGooglePay.js +35 -0
  128. package/lib/models/PayInPaymentDetailsIdeal.js +25 -0
  129. package/lib/models/PayInPaymentDetailsKlarna.js +36 -0
  130. package/lib/models/PayInPaymentDetailsMbway.js +20 -0
  131. package/lib/models/PayInPaymentDetailsMultibanco.js +14 -0
  132. package/lib/models/PayInPaymentDetailsPayByBank.js +71 -0
  133. package/lib/models/PayInPaymentDetailsPayPal.js +63 -0
  134. package/lib/models/PayInPaymentDetailsPayconiq.js +23 -0
  135. package/lib/models/PayInPaymentDetailsPreAuthorized.js +10 -0
  136. package/lib/models/PayInPaymentDetailsSatispay.js +19 -0
  137. package/lib/models/PayInPaymentDetailsSwish.js +35 -0
  138. package/lib/models/PayInPaymentDetailsTwint.js +15 -0
  139. package/lib/models/PayInPaymentType.js +21 -0
  140. package/lib/models/PayInRecurringRegistration.js +64 -0
  141. package/lib/models/PayInTemplateURLOptions.js +10 -0
  142. package/lib/models/PayOut.js +24 -0
  143. package/lib/models/PayOutPaymentDetails.js +7 -0
  144. package/lib/models/PayOutPaymentDetailsBankWire.js +32 -0
  145. package/lib/models/PayOutPaymentType.js +3 -0
  146. package/lib/models/PaymentData.js +20 -0
  147. package/lib/models/PaymentMethodMetadata.js +38 -0
  148. package/lib/models/PayoutMethods.js +7 -0
  149. package/lib/models/PendingUserAction.js +16 -0
  150. package/lib/models/PersonType.js +5 -0
  151. package/lib/models/PlatformCategorization.js +16 -0
  152. package/lib/models/PlatformType.js +10 -0
  153. package/lib/models/Quote.js +11 -0
  154. package/lib/models/Recipient.js +20 -0
  155. package/lib/models/RecipientSchema.js +17 -0
  156. package/lib/models/RecurringPayIn.js +10 -0
  157. package/lib/models/RecurringPayInCIT.js +32 -0
  158. package/lib/models/RecurringPayInCurrentState.js +24 -0
  159. package/lib/models/RecurringPayInMIT.js +27 -0
  160. package/lib/models/RecurringPayInPut.js +24 -0
  161. package/lib/models/Refund.js +26 -0
  162. package/lib/models/RefundReasonDetails.js +10 -0
  163. package/lib/models/Report.js +54 -0
  164. package/lib/models/ReportFilter.js +52 -0
  165. package/lib/models/ReportFilterV2.js +11 -0
  166. package/lib/models/ReportV2.js +28 -0
  167. package/lib/models/Repudiation.js +51 -0
  168. package/lib/models/SecurityInfo.js +12 -0
  169. package/lib/models/Settlement.js +16 -0
  170. package/lib/models/SettlementTransfer.js +37 -0
  171. package/lib/models/Shipping.js +14 -0
  172. package/lib/models/ShippingAddress.js +25 -0
  173. package/lib/models/ShippingPreference.js +5 -0
  174. package/lib/models/Transaction.js +50 -0
  175. package/lib/models/Transfer.js +13 -0
  176. package/lib/models/Ubo.js +19 -0
  177. package/lib/models/UboDeclaration.js +42 -0
  178. package/lib/models/UboDeclarationRefusedReasonType.js +23 -0
  179. package/lib/models/UboDeclarationStatus.js +26 -0
  180. package/lib/models/UboRefusedReasonType.js +14 -0
  181. package/lib/models/User.js +66 -0
  182. package/lib/models/UserCategory.js +5 -0
  183. package/lib/models/UserConsent.js +7 -0
  184. package/lib/models/UserDataFormatValidation.js +7 -0
  185. package/lib/models/UserEnrollmentResult.js +7 -0
  186. package/lib/models/UserLegal.js +65 -0
  187. package/lib/models/UserLegalOwner.js +66 -0
  188. package/lib/models/UserLegalPayer.js +66 -0
  189. package/lib/models/UserLegalSca.js +57 -0
  190. package/lib/models/UserNatural.js +51 -0
  191. package/lib/models/UserNaturalCapacity.js +13 -0
  192. package/lib/models/UserNaturalOwner.js +55 -0
  193. package/lib/models/UserNaturalPayer.js +55 -0
  194. package/lib/models/UserNaturalPut.js +49 -0
  195. package/lib/models/UserNaturalSca.js +56 -0
  196. package/lib/models/VirtualAccount.js +22 -0
  197. package/lib/models/Wallet.js +32 -0
  198. package/lib/models/index.js +102 -0
  199. package/lib/service.js +14 -0
  200. package/lib/services/BankAccounts.js +31 -0
  201. package/lib/services/BankingAliases.js +137 -0
  202. package/lib/services/CardPreAuthorizations.js +75 -0
  203. package/lib/services/CardRegistrations.js +64 -0
  204. package/lib/services/Cards.js +168 -0
  205. package/lib/services/Clients.js +196 -0
  206. package/lib/services/Conversions.js +155 -0
  207. package/lib/services/Deposits.js +109 -0
  208. package/lib/services/DisputeDocuments.js +65 -0
  209. package/lib/services/Disputes.js +409 -0
  210. package/lib/services/Events.js +24 -0
  211. package/lib/services/Hooks.js +81 -0
  212. package/lib/services/Idempotency.js +17 -0
  213. package/lib/services/IdentityVerifications.js +48 -0
  214. package/lib/services/KycDocuments.js +66 -0
  215. package/lib/services/Mandates.js +161 -0
  216. package/lib/services/OptionsHelper.js +20 -0
  217. package/lib/services/PayIns.js +690 -0
  218. package/lib/services/PayOuts.js +110 -0
  219. package/lib/services/Recipients.js +117 -0
  220. package/lib/services/Refunds.js +29 -0
  221. package/lib/services/Regulatory.js +29 -0
  222. package/lib/services/Reports.js +61 -0
  223. package/lib/services/ReportsV2.js +55 -0
  224. package/lib/services/Repudiations.js +33 -0
  225. package/lib/services/Responses.js +23 -0
  226. package/lib/services/Settlements.js +74 -0
  227. package/lib/services/Transfers.js +87 -0
  228. package/lib/services/UboDeclarations.js +135 -0
  229. package/lib/services/Users.js +831 -0
  230. package/lib/services/VirtualAccounts.js +99 -0
  231. package/lib/services/Wallets.js +85 -0
  232. package/lib/services/index.js +34 -0
  233. package/lib/utils.js +36 -0
  234. package/package.json +40 -0
  235. package/test/TestKycPageFile.png +0 -0
  236. package/test/helpers.js +1431 -0
  237. package/test/main.js +10 -0
  238. package/test/mocha.opts +3 -0
  239. package/test/services/BankAccounts.js +46 -0
  240. package/test/services/BankingAliases.js +89 -0
  241. package/test/services/CardPreAuthorizations.js +70 -0
  242. package/test/services/CardRegistrations.js +239 -0
  243. package/test/services/Cards.js +54 -0
  244. package/test/services/Clients.js +235 -0
  245. package/test/services/Conversions.js +308 -0
  246. package/test/services/Deposits.js +148 -0
  247. package/test/services/Disputes.js +542 -0
  248. package/test/services/EMoney.js +54 -0
  249. package/test/services/Events.js +143 -0
  250. package/test/services/Hooks.js +109 -0
  251. package/test/services/Idempotency.js +46 -0
  252. package/test/services/IdentityVerifications.js +68 -0
  253. package/test/services/KycDocuments.js +73 -0
  254. package/test/services/Mandates.js +256 -0
  255. package/test/services/PayIns.js +2553 -0
  256. package/test/services/PayOuts.js +106 -0
  257. package/test/services/RateLimit.js +48 -0
  258. package/test/services/Recipients.js +234 -0
  259. package/test/services/Refunds.js +123 -0
  260. package/test/services/Regulatory.js +45 -0
  261. package/test/services/Reports.js +114 -0
  262. package/test/services/ReportsV2.js +306 -0
  263. package/test/services/Repudiations.js +22 -0
  264. package/test/services/Settlements.js +58 -0
  265. package/test/services/Tokens.js +55 -0
  266. package/test/services/Transfers.js +137 -0
  267. package/test/services/UboDeclarations.js +135 -0
  268. package/test/services/Users.js +1303 -0
  269. package/test/services/VirtualAccounts.js +105 -0
  270. package/test/services/Wallets.js +132 -0
  271. package/test/settlement_sample.csv +8 -0
  272. package/typings/base.d.ts +308 -0
  273. package/typings/enums.d.ts +204 -0
  274. package/typings/index.d.ts +885 -0
  275. package/typings/index.test-d.ts +1535 -0
  276. package/typings/models/address.d.ts +70 -0
  277. package/typings/models/bankAccount.d.ts +235 -0
  278. package/typings/models/bankingAlias.d.ts +97 -0
  279. package/typings/models/billing.d.ts +42 -0
  280. package/typings/models/birthplace.d.ts +9 -0
  281. package/typings/models/card.d.ts +119 -0
  282. package/typings/models/cardPreauthorization.d.ts +157 -0
  283. package/typings/models/cardRegistration.d.ts +83 -0
  284. package/typings/models/cardValidation.d.ts +125 -0
  285. package/typings/models/client.d.ts +208 -0
  286. package/typings/models/conversion.d.ts +225 -0
  287. package/typings/models/conversionRate.d.ts +29 -0
  288. package/typings/models/countryAuthorization.d.ts +16 -0
  289. package/typings/models/deposit.d.ts +104 -0
  290. package/typings/models/dispute.d.ts +116 -0
  291. package/typings/models/disputeDocument.d.ts +119 -0
  292. package/typings/models/entityBase.d.ts +9 -0
  293. package/typings/models/event.d.ts +142 -0
  294. package/typings/models/hook.d.ts +39 -0
  295. package/typings/models/idempotency.d.ts +36 -0
  296. package/typings/models/identityVerification.d.ts +98 -0
  297. package/typings/models/kycDocument.d.ts +114 -0
  298. package/typings/models/mandate.d.ts +93 -0
  299. package/typings/models/money.d.ts +45 -0
  300. package/typings/models/payIn.d.ts +3742 -0
  301. package/typings/models/payOut.d.ts +144 -0
  302. package/typings/models/recipient.d.ts +242 -0
  303. package/typings/models/refund.d.ts +92 -0
  304. package/typings/models/report.d.ts +234 -0
  305. package/typings/models/reportV2.d.ts +145 -0
  306. package/typings/models/repudiation.d.ts +26 -0
  307. package/typings/models/securityInfo.d.ts +12 -0
  308. package/typings/models/settlement.d.ts +50 -0
  309. package/typings/models/settlementTransfer.d.ts +37 -0
  310. package/typings/models/shipping.d.ts +37 -0
  311. package/typings/models/shippingAddress.d.ts +15 -0
  312. package/typings/models/transaction.d.ts +85 -0
  313. package/typings/models/transfer.d.ts +119 -0
  314. package/typings/models/uboDeclaration.d.ts +100 -0
  315. package/typings/models/user.d.ts +1001 -0
  316. package/typings/models/virtualAccount.d.ts +182 -0
  317. package/typings/models/wallet.d.ts +46 -0
  318. package/typings/models.d.ts +74 -0
  319. package/typings/services/BankAccounts.d.ts +12 -0
  320. package/typings/services/BankingAliases.d.ts +51 -0
  321. package/typings/services/CardPreauthorizations.d.ts +44 -0
  322. package/typings/services/CardRegistrations.d.ts +43 -0
  323. package/typings/services/Cards.d.ts +80 -0
  324. package/typings/services/Clients.d.ts +77 -0
  325. package/typings/services/Conversions.d.ts +23 -0
  326. package/typings/services/Deposits.d.ts +20 -0
  327. package/typings/services/DisputeDocuments.d.ts +27 -0
  328. package/typings/services/Disputes.d.ts +169 -0
  329. package/typings/services/Events.d.ts +11 -0
  330. package/typings/services/Hooks.d.ts +33 -0
  331. package/typings/services/Idempotency.d.ts +7 -0
  332. package/typings/services/IdentityVerifications.d.ts +29 -0
  333. package/typings/services/KycDocuments.d.ts +38 -0
  334. package/typings/services/Mandates.d.ts +59 -0
  335. package/typings/services/OptionsHelper.d.ts +11 -0
  336. package/typings/services/PayIns.d.ts +319 -0
  337. package/typings/services/PayOuts.d.ts +34 -0
  338. package/typings/services/Recipients.d.ts +55 -0
  339. package/typings/services/Refunds.d.ts +12 -0
  340. package/typings/services/Regulatory.d.ts +17 -0
  341. package/typings/services/Reports.d.ts +26 -0
  342. package/typings/services/ReportsV2.d.ts +26 -0
  343. package/typings/services/Repudiations.d.ts +12 -0
  344. package/typings/services/Responses.d.ts +10 -0
  345. package/typings/services/Settlements.d.ts +28 -0
  346. package/typings/services/Transfers.d.ts +38 -0
  347. package/typings/services/UboDeclarations.d.ts +81 -0
  348. package/typings/services/Users.d.ts +308 -0
  349. package/typings/services/VirtualAccounts.d.ts +42 -0
  350. package/typings/services/Wallets.d.ts +36 -0
  351. package/typings/tsconfig.json +20 -0
  352. package/typings/tslint.json +11 -0
  353. package/typings/types.d.ts +652 -0
@@ -0,0 +1,1535 @@
1
+ import {expectError, expectType} from 'tsd';
2
+ import Mangopay = require("./index");
3
+ import {base} from "./index";
4
+
5
+ // Config tests
6
+ const invalidConfig = {};
7
+ expectError<Mangopay.base.Config>(invalidConfig);
8
+
9
+ const validConfig: Mangopay.base.Config = {
10
+ clientId: "your_client_id",
11
+ clientApiKey: "your_client_api_key",
12
+ baseUrl: "https://api.mangopay.com"
13
+ };
14
+
15
+ // API instance tests
16
+ const api = new Mangopay(validConfig);
17
+ expectType<Mangopay>(api);
18
+
19
+ // Models tests
20
+ const payIn = new api.models.PayIn({});
21
+ expectType<Mangopay.models.PayIn>(payIn);
22
+
23
+ const address = new api.models.Address({});
24
+ expectType<Mangopay.models.Address>(address);
25
+
26
+ // User tests
27
+ const legalUser = new api.models.UserLegal({
28
+ Name: "MangoPay",
29
+ Email: "info@mangopay.com",
30
+ LegalPersonType: "BUSINESS",
31
+ LegalRepresentativeFirstName: "Mango",
32
+ LegalRepresentativeLastName: "Pay",
33
+ LegalRepresentativeEmail: "mango@mangopay.com",
34
+ HeadquartersAddress: new api.models.Address({
35
+ AddressLine1: "4101 Reservoir Rd NW",
36
+ City: "Washington",
37
+ Region: "District of Columbia",
38
+ PostalCode: "20007",
39
+ Country: "US"
40
+ }),
41
+ LegalRepresentativeBirthday: 1300186358,
42
+ LegalRepresentativeNationality: "FR",
43
+ LegalRepresentativeCountryOfResidence: "FR"
44
+ });
45
+ expectType<Mangopay.models.UserLegal>(legalUser);
46
+
47
+ api.Users.create(legalUser).then(data => {
48
+ expectType<Mangopay.user.UserLegalData>(data);
49
+ expectType<"LEGAL">(data.PersonType);
50
+ expectType<Mangopay.models.RateLimit[]>(api.rateLimits);
51
+
52
+ console.log(`${legalUser.Name} user created at ${legalUser.CreationDate}`);
53
+ });
54
+
55
+ api.Users.create(legalUser, {resolveWithFullResponse: true}).then(data => {
56
+ expectType<Mangopay.base.WithResponse<Mangopay.user.UserLegalData>>(data);
57
+ expectType<Mangopay.user.UserLegalData>(data.body);
58
+ });
59
+
60
+ api.Users.create(
61
+ {
62
+ PersonType: "LEGAL",
63
+ Name: "MangoPay",
64
+ Email: "info@mangopay.com",
65
+ LegalPersonType: "BUSINESS",
66
+ LegalRepresentativeFirstName: "Mango",
67
+ LegalRepresentativeLastName: "Pay",
68
+ LegalRepresentativeEmail: "mango@mangopay.com",
69
+ HeadquartersAddress: new api.models.Address({
70
+ AddressLine1: "4101 Reservoir Rd NW",
71
+ AddressLine2: "",
72
+ City: "Washington",
73
+ Region: "District of Columbia",
74
+ PostalCode: "20007",
75
+ Country: "US"
76
+ }),
77
+ LegalRepresentativeAddress: new api.models.Address({
78
+ AddressLine1: "4101 Reservoir Rd NW",
79
+ AddressLine2: "",
80
+ City: "Washington",
81
+ Region: "District of Columbia",
82
+ PostalCode: "20007",
83
+ Country: "US"
84
+ }),
85
+ LegalRepresentativeBirthday: 1300186358,
86
+ LegalRepresentativeNationality: "FR",
87
+ LegalRepresentativeCountryOfResidence: "FR",
88
+ Tag: "custom tag",
89
+ TermsAndConditionsAccepted: true
90
+ },
91
+ {headers: {}}
92
+ ).then(data => {
93
+ expectType<Mangopay.user.UserLegalData>(data);
94
+ });
95
+
96
+ const naturalUser = new api.models.UserNatural({
97
+ Email: "info@mangopay.com",
98
+ Birthday: 1300186358,
99
+ FirstName: "Sara",
100
+ LastName: "McNick",
101
+ CountryOfResidence: "GB",
102
+ Nationality: "US"
103
+ });
104
+
105
+ api.Users.create(naturalUser, {}).then(data => {
106
+ expectType<Mangopay.user.UserNaturalData>(data);
107
+ expectType<"NATURAL">(data.PersonType);
108
+ });
109
+
110
+ api.Users.create(
111
+ {
112
+ PersonType: "NATURAL",
113
+ Email: "info@mangopay.com",
114
+ Birthday: 1300186358,
115
+ FirstName: "Sara",
116
+ LastName: "McNick",
117
+ CountryOfResidence: "GB",
118
+ Nationality: "US",
119
+ Tag: "natural-user",
120
+ TermsAndConditionsAccepted: true
121
+ },
122
+ data => {
123
+ expectType<Mangopay.user.UserNaturalData>(data);
124
+ }
125
+ );
126
+
127
+ // create User Natural Payer with mandatory props
128
+ const userNaturalPayer = new api.models.UserNaturalPayer({
129
+ UserCategory: "PAYER",
130
+ FirstName: "Sara",
131
+ LastName: "McNick",
132
+ Email: "info@mangopay.com"
133
+ });
134
+
135
+ api.Users.create(userNaturalPayer,
136
+ data => {
137
+ expectType<Mangopay.user.UserNaturalData>(data);
138
+ }
139
+ );
140
+
141
+ // create User Natural Owner with mandatory props
142
+ const userNaturalOwner = new api.models.UserNaturalOwner({
143
+ PersonType: "NATURAL",
144
+ UserCategory: "OWNER",
145
+ FirstName: "Sara",
146
+ LastName: "McNick",
147
+ Email: "info@mangopay.com",
148
+ Birthday: 1300186358,
149
+ CountryOfResidence: "GB",
150
+ Nationality: "US",
151
+ TermsAndConditionsAccepted: false
152
+ });
153
+
154
+ api.Users.create(userNaturalOwner,
155
+ data => {
156
+ expectType<Mangopay.user.UserNaturalData>(data);
157
+ }
158
+ );
159
+
160
+ // create User Legal Payer with mandatory props
161
+ const userLegalPayer = new api.models.UserLegalPayer({
162
+ UserCategory: "PAYER",
163
+ PersonType: "LEGAL",
164
+ Name: "MangoPay",
165
+ Email: "info@mangopay.com",
166
+ LegalPersonType: "BUSINESS",
167
+ LegalRepresentativeFirstName: "Mango",
168
+ LegalRepresentativeLastName: "Pay",
169
+ LegalRepresentativeEmail: "mango@mangopay.com"
170
+ });
171
+
172
+ api.Users.create(userLegalPayer,
173
+ data => {
174
+ expectType<Mangopay.user.UserLegalData>(data);
175
+ }
176
+ );
177
+
178
+ // create User Legal Owner with mandatory props
179
+ const userLegalOwner = new api.models.UserLegalOwner({
180
+ UserCategory: "OWNER",
181
+ Name: "MangoPay",
182
+ Email: "info@mangopay.com",
183
+ LegalPersonType: "BUSINESS",
184
+ LegalRepresentativeFirstName: "Mango",
185
+ LegalRepresentativeLastName: "Pay",
186
+ HeadquartersAddress: new api.models.Address({
187
+ AddressLine1: "4101 Reservoir Rd NW",
188
+ AddressLine2: "",
189
+ City: "Washington",
190
+ Region: "District of Columbia",
191
+ PostalCode: "20007",
192
+ Country: "US"
193
+ }),
194
+ LegalRepresentativeBirthday: 1300186358,
195
+ LegalRepresentativeNationality: "FR",
196
+ LegalRepresentativeCountryOfResidence: "FR",
197
+ CompanyNumber: "12345",
198
+ TermsAndConditionsAccepted: false
199
+ });
200
+
201
+ api.Users.create(userLegalOwner,
202
+ data => {
203
+ expectType<Mangopay.user.UserLegalData>(data);
204
+ }
205
+ );
206
+
207
+ api.Users.get("1234").then(data => {
208
+ expectType<Mangopay.user.UserLegalData | Mangopay.user.UserNaturalData>(data);
209
+ if (data.PersonType === "LEGAL") {
210
+ expectType<Mangopay.user.UserLegalData>(data);
211
+ } else {
212
+ expectType<Mangopay.user.UserNaturalData>(data);
213
+ }
214
+ });
215
+
216
+ api.Users.getAll().then(users => {
217
+ users.forEach(user => {
218
+ expectType<Mangopay.user.UserLegalData | Mangopay.user.UserNaturalData>(user);
219
+ if (user.PersonType === "LEGAL") {
220
+ expectType<Mangopay.user.UserLegalData>(user);
221
+ } else {
222
+ expectType<Mangopay.user.UserNaturalData>(user);
223
+ }
224
+ });
225
+ });
226
+
227
+ api.Users.update({
228
+ Id: "1234",
229
+ PersonType: "NATURAL",
230
+ Email: "info@mangopay.com",
231
+ Birthday: 1300186358,
232
+ FirstName: "Sara",
233
+ LastName: "McNick",
234
+ CountryOfResidence: "GB",
235
+ Nationality: "US",
236
+ TermsAndConditionsAccepted: true
237
+ }).then(data => {
238
+ expectType<Mangopay.user.UserNaturalData>(data);
239
+ });
240
+
241
+ api.Users.update({
242
+ Id: "1234",
243
+ PersonType: "LEGAL",
244
+ Tag: "custom meta",
245
+ TermsAndConditionsAccepted: true
246
+ }).then(data => {
247
+ expectType<Mangopay.user.UserLegalData>(data);
248
+ });
249
+
250
+ api.Users.createBankAccount("user-id", {
251
+ Type: "GB",
252
+ AccountNumber: "12345678",
253
+ SortCode: "123456",
254
+ OwnerAddress: "",
255
+ OwnerName: ""
256
+ }).then(data => {
257
+ expectType<Mangopay.bankAccount.GBData>(data);
258
+ });
259
+
260
+ api.Users.getBankAccount("user-id", "bankAccount-id").then(data => {
261
+ expectType<Mangopay.bankAccount.Data>(data);
262
+ });
263
+
264
+ api.Users.getBankAccounts("user-id", {parameters: {Sort: "CreationDate:ASC"}}).then(data => {
265
+ expectType<Mangopay.bankAccount.Data[]>(data);
266
+ });
267
+
268
+ api.Users.deactivateBankAccount("user-id", "bankAccount-id").then(data => {
269
+ expectType<Mangopay.bankAccount.Data>(data);
270
+ });
271
+
272
+ api.Users.getTransactions("user-id").then(data => {
273
+ expectType<Mangopay.transaction.TransactionData[]>(data);
274
+ });
275
+
276
+ api.Users.getWallets("user-id").then(data => {
277
+ expectType<Mangopay.wallet.WalletData[]>(data);
278
+ });
279
+
280
+ api.Users.getCards("user-id").then(data => {
281
+ expectType<Mangopay.card.CardData[]>(data);
282
+ });
283
+
284
+ api.Users.createKycDocument("user-id", {Type: "ADDRESS_PROOF", Tag: "custom meta"}).then(data => {
285
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
286
+ });
287
+
288
+ api.Users.getKycDocuments("user-id").then(data => {
289
+ expectType<Mangopay.kycDocument.KycDocumentData[]>(data);
290
+ });
291
+
292
+ api.Users.getKycDocument("user-id", "kycDocument-id").then(data => {
293
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
294
+ });
295
+
296
+ api.Users.updateKycDocument("user-id", {Status: "VALIDATION_ASKED", Id: "kycDocument-id"}).then(
297
+ data => {
298
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
299
+ }
300
+ );
301
+
302
+ api.Users.createKycPage("user-id", "kycDocument-id", {
303
+ File: "...base64data..."
304
+ }).then(data => {
305
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
306
+ });
307
+
308
+ api.Users.createKycPageFromFile(
309
+ "user-id",
310
+ "kyc-document-id",
311
+ "path/to/file"
312
+ ).then(data => {
313
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
314
+ });
315
+
316
+ // MangoPay.
317
+ api.Users.getEMoney("user-id").then(data => {
318
+ expectType<Mangopay.money.EMoneyData>(data);
319
+ });
320
+
321
+ api.Users.getPreAuthorizations("user-id").then(data => {
322
+ expectType<Mangopay.cardPreAuthorization.CardPreAuthorizationData[]>(data);
323
+ });
324
+
325
+ /* KycDocuments */
326
+ api.KycDocuments.getAll().then(data => {
327
+ expectType<Mangopay.kycDocument.KycDocumentData[]>(data);
328
+ });
329
+
330
+ api.KycDocuments.get("kyc-id").then(data => {
331
+ expectType<Mangopay.kycDocument.KycDocumentData>(data);
332
+ });
333
+
334
+ api.KycDocuments.createKycDocumentConsult("kyc-id").then(data => {
335
+ expectType<any>(data); // TODO unsure of expected type from docs
336
+ });
337
+
338
+ /* UboDeclarations */
339
+ api.UboDeclarations.get("userId", "id").then(data => {
340
+ expectType<Mangopay.uboDeclaration.UboDeclarationData>(data);
341
+ });
342
+
343
+ api.UboDeclarations.update("userId", {
344
+ Id: "uboId",
345
+ Ubos: ["user1", "user2"]
346
+ }).then(data => {
347
+ expectType<Mangopay.uboDeclaration.UboDeclarationData>(data);
348
+ });
349
+
350
+ api.UboDeclarations.create("userId").then(data => {
351
+ expectType<Mangopay.uboDeclaration.UboDeclarationData>(data);
352
+ });
353
+
354
+
355
+ api.UboDeclarations.createUbo("userId", "uboDeclarationId", {
356
+ Address: address,
357
+ Birthday: 1300186358,
358
+ FirstName: "John",
359
+ LastName: "Silver",
360
+ Nationality: "US",
361
+ Birthplace: {
362
+ City: "Brasov",
363
+ Country: "RO"
364
+ }
365
+ }).then(data => {
366
+ expectType<Mangopay.uboDeclaration.UboData>(data);
367
+ });
368
+
369
+ api.UboDeclarations.getAll("userId").then((data => {
370
+ expectType<Mangopay.uboDeclaration.UboDeclarationData[]>(data);
371
+ }));
372
+
373
+ api.UboDeclarations.getUbo("userId", "uboDeclarationId", "uboId").then(data => {
374
+ expectType<Mangopay.uboDeclaration.UboData>(data);
375
+ });
376
+
377
+ api.UboDeclarations.updateUbo("userId", "uboDeclarationId", {
378
+ Id: "uboId",
379
+ Address: address,
380
+ Birthday: 1300186358,
381
+ FirstName: "John",
382
+ LastName: "Silver",
383
+ Nationality: "US",
384
+ Birthplace: {
385
+ City: "Brasov",
386
+ Country: "RO"
387
+ }
388
+ }).then(data => {
389
+ expectType<Mangopay.uboDeclaration.UboData>(data);
390
+ });
391
+
392
+ /* BankAccounts */
393
+ api.BankAccounts.getTransactions("account-id").then(data => {
394
+ expectType<Mangopay.transaction.TransactionData[]>(data);
395
+ });
396
+
397
+ /* Wallets */
398
+ api.Wallets.create({
399
+ Currency: "GBP",
400
+ Description: "A description",
401
+ Owners: ["user-id"]
402
+ }).then(data => {
403
+ expectType<Mangopay.wallet.WalletData>(data);
404
+ });
405
+
406
+ const wallet = new api.models.Wallet({
407
+ Currency: "EUR",
408
+ Description: "A description",
409
+ Owners: ["user-id"]
410
+ });
411
+
412
+ api.Wallets.create(wallet).then(data => {
413
+ expectType<Mangopay.wallet.WalletData>(data);
414
+ });
415
+
416
+ api.Wallets.update({
417
+ Description: "A description"
418
+ }).then(data => {
419
+ expectType<Mangopay.wallet.WalletData>(data);
420
+ });
421
+
422
+ api.Wallets.get("wallet-id").then(data => {
423
+ expectType<Mangopay.wallet.WalletData>(data);
424
+ });
425
+
426
+ api.Wallets.getTransactions("wallet-id").then(data => {
427
+ expectType<Mangopay.transaction.TransactionData[]>(data);
428
+ });
429
+
430
+ /* Cards */
431
+ api.Cards.get("card-id").then(data => {
432
+ expectType<Mangopay.card.CardData>(data);
433
+ });
434
+
435
+ api.Cards.getByFingerprint("fingerprinthash").then(data => {
436
+ expectType<Mangopay.card.CardData[]>(data);
437
+ });
438
+
439
+ api.Cards.update({Active: false, Id: "card-id"}).then(data => {
440
+ expectType<Mangopay.card.CardData>(data);
441
+ });
442
+
443
+ api.Cards.getTransactions("card-id").then(data => {
444
+ expectType<Mangopay.transaction.TransactionData[]>(data);
445
+ });
446
+
447
+ api.Cards.validate(
448
+ "id",
449
+ {
450
+ AuthorId: "placeholder",
451
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
452
+ BrowserInfo: {
453
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
454
+ ColorDepth: 4,
455
+ JavaEnabled: true,
456
+ JavascriptEnabled: true,
457
+ Language: 'FR-FR',
458
+ ScreenHeight: 1800,
459
+ ScreenWidth: 400,
460
+ TimeZoneOffset: "+60",
461
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
462
+ },
463
+ SecureModeReturnURL: "http://example.com"
464
+ }
465
+ ).then(data => {
466
+ expectType<Mangopay.cardValidation.CardValidationData>(data);
467
+ });
468
+
469
+ api.Cards.getCardValidation(
470
+ "cardId",
471
+ "cardValidationId"
472
+ ).then(data => {
473
+ expectType<Mangopay.cardValidation.CardValidationData>(data);
474
+ });
475
+
476
+ /* CardRegistrations */
477
+ api.CardRegistrations.create({
478
+ CardType: "BCMC",
479
+ Currency: "GBP",
480
+ UserId: "user-id"
481
+ }).then(data => {
482
+ expectType<Mangopay.cardRegistration.CardRegistrationData>(data);
483
+ });
484
+
485
+ api.CardRegistrations.get("reg-id").then(data => {
486
+ expectType<Mangopay.cardRegistration.CardRegistrationData>(data);
487
+ });
488
+
489
+ api.CardRegistrations.update({RegistrationData: "hmmm", Id: "Id"}).then(data => {
490
+ expectType<Mangopay.cardRegistration.CardRegistrationData>(data);
491
+ });
492
+
493
+ /* CardPreAuthorizations */
494
+ api.CardPreAuthorizations.create({
495
+ AuthorId: "user",
496
+ CardId: "card-id",
497
+ DebitedFunds: {Currency: "AUD", Amount: 4000},
498
+ SecureModeReturnURL: "https://secureurl.com",
499
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
500
+ BrowserInfo: {
501
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
502
+ ColorDepth: 4,
503
+ JavaEnabled: true,
504
+ JavascriptEnabled: true,
505
+ Language: 'FR-FR',
506
+ ScreenHeight: 1800,
507
+ ScreenWidth: 400,
508
+ TimeZoneOffset: "+60",
509
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
510
+ }
511
+ }).then(data => {
512
+ expectType<Mangopay.cardPreAuthorization.CardPreAuthorizationData>(data);
513
+ });
514
+
515
+ api.CardPreAuthorizations.get("auth-id").then(data => {
516
+ expectType<Mangopay.cardPreAuthorization.CardPreAuthorizationData>(data);
517
+ });
518
+
519
+ api.CardPreAuthorizations.update({
520
+ Id: "auth-id",
521
+ PaymentStatus: "CANCELED"
522
+ }).then(data => {
523
+ expectType<Mangopay.cardPreAuthorization.CardPreAuthorizationData>(data);
524
+ });
525
+
526
+ /* Refunds */
527
+ api.Refunds.get("refund-id").then(data => {
528
+ expectType<Mangopay.refund.RefundData>(data);
529
+ });
530
+
531
+ /* PayIns */
532
+ api.PayIns.create({
533
+ PaymentType: "CARD",
534
+ ExecutionType: "DIRECT",
535
+ AuthorId: "user-id",
536
+ CardId: "card-id",
537
+ CreditedWalletId: "wallet-id",
538
+ Fees: {Amount: 100, Currency: "GBP"},
539
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
540
+ SecureModeReturnURL: "https://secure-return.co"
541
+ }).then(data => {
542
+ expectType<Mangopay.payIn.CardDirectPayInData>(data);
543
+ });
544
+
545
+ api.PayIns.create({
546
+ PaymentType: "MBWAY",
547
+ ExecutionType: "WEB",
548
+ AuthorId: "user-id",
549
+ CreditedWalletId: "wallet-id",
550
+ Fees: {Amount: 100, Currency: "GBP"},
551
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
552
+ Phone: "351#269458236",
553
+ Tag: "test tag",
554
+ StatementDescriptor: "test"
555
+ }).then(data => {
556
+ expectType<Mangopay.payIn.MbwayWebPayInData>(data);
557
+ });
558
+
559
+ api.PayIns.create({
560
+ PaymentType: "KLARNA",
561
+ ExecutionType: "WEB",
562
+ AuthorId: "user-id",
563
+ CreditedWalletId: "wallet-id",
564
+ Fees: {Amount: 100, Currency: "GBP"},
565
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
566
+ ReturnURL: "http://test.com",
567
+ LineItems: [
568
+ {
569
+ Name: "test",
570
+ Quantity: 100,
571
+ TaxAmount: undefined,
572
+ UnitAmount: 10,
573
+ Description: "placeholder"
574
+ }
575
+ ],
576
+ Country: "FR",
577
+ Phone: "351#269458236",
578
+ Email: "test@test.com",
579
+ AdditionalData: "{}",
580
+ Billing: {
581
+ FirstName: "John",
582
+ LastName: "Doe",
583
+ Address: {
584
+ AddressLine1: "test addr1",
585
+ AddressLine2: undefined,
586
+ City: "Paris",
587
+ Country: "FR",
588
+ Region: "Europe",
589
+ PostalCode: "68400"
590
+ }
591
+ },
592
+ Reference: "1234"
593
+ }).then(data => {
594
+ expectType<Mangopay.payIn.KlarnaWebPayInData>(data);
595
+ });
596
+
597
+ api.PayIns.create({
598
+ PaymentType: "MULTIBANCO",
599
+ ExecutionType: "WEB",
600
+ AuthorId: "user-id",
601
+ Fees: {Amount: 100, Currency: "GBP"},
602
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
603
+ CreditedWalletId: "123",
604
+ ReturnURL: "http://test.com",
605
+ Tag: "test tag",
606
+ StatementDescriptor: "test"
607
+ }).then(data => {
608
+ expectType<Mangopay.payIn.MultibancoWebPayInData>(data);
609
+ });
610
+
611
+ api.PayIns.create({
612
+ PaymentType: "SATISPAY",
613
+ ExecutionType: "WEB",
614
+ AuthorId: "user-id",
615
+ Fees: {Amount: 100, Currency: "GBP"},
616
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
617
+ CreditedWalletId: "123",
618
+ ReturnURL: "http://test.com",
619
+ Country: "IT",
620
+ Tag: "test tag",
621
+ StatementDescriptor: "test"
622
+ }).then(data => {
623
+ expectType<Mangopay.payIn.SatispayWebPayInData>(data);
624
+ });
625
+
626
+ api.PayIns.create({
627
+ PaymentType: "BLIK",
628
+ ExecutionType: "WEB",
629
+ AuthorId: "user-id",
630
+ Fees: {Amount: 100, Currency: "GBP"},
631
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
632
+ CreditedWalletId: "123",
633
+ ReturnURL: "http://test.com",
634
+ Tag: "test tag",
635
+ StatementDescriptor: "test"
636
+ }).then(data => {
637
+ expectType<Mangopay.payIn.BlikWebPayInData>(data);
638
+ });
639
+
640
+ api.PayIns.create({
641
+ PaymentType: "IDEAL",
642
+ ExecutionType: "WEB",
643
+ AuthorId: "user-id",
644
+ CreditedWalletId: "wallet-id",
645
+ Fees: {Amount: 100, Currency: "GBP"},
646
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
647
+ ReturnURL: "http://test.com",
648
+ StatementDescriptor: "Ideal",
649
+ Bic: "RBRBNL21",
650
+ Tag: "test"
651
+ }).then(data => {
652
+ expectType<Mangopay.payIn.IdealWebPayInData>(data);
653
+ });
654
+
655
+ api.PayIns.create({
656
+ PaymentType: "GIROPAY",
657
+ ExecutionType: "WEB",
658
+ AuthorId: "user-id",
659
+ CreditedWalletId: "wallet-id",
660
+ Fees: {Amount: 100, Currency: "GBP"},
661
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
662
+ ReturnURL: "http://test.com",
663
+ StatementDescriptor: "Giropay",
664
+ Tag: "test"
665
+ }).then(data => {
666
+ expectType<Mangopay.payIn.GiropayWebPayInData>(data);
667
+ });
668
+
669
+ api.PayIns.create({
670
+ PaymentType: "SWISH",
671
+ ExecutionType: "WEB",
672
+ AuthorId: "user-id",
673
+ CreditedWalletId: "wallet-id",
674
+ Fees: {Amount: 0, Currency: "SEK"},
675
+ DebitedFunds: {Amount: 100, Currency: "SEK"},
676
+ ReturnURL: "http://test.com",
677
+ StatementDescriptor: "Swish",
678
+ Tag: "test",
679
+ PaymentFlow: "WEB"
680
+ }).then(data => {
681
+ expectType<Mangopay.payIn.SwishWebPayInData>(data);
682
+ });
683
+
684
+ api.PayIns.create({
685
+ PaymentType: "CARD",
686
+ ExecutionType: "WEB",
687
+ AuthorId: "user-id",
688
+ CreditedWalletId: "wallet-id",
689
+ Fees: {Amount: 100, Currency: "GBP"},
690
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
691
+ ReturnURL: "https://secure-return.co",
692
+ Culture: "FR",
693
+ Bic: "RBRBNL21",
694
+ CardType: "IDEAL"
695
+ }).then(data => {
696
+ expectType<Mangopay.payIn.CardWebPayInData>(data);
697
+ });
698
+
699
+ api.PayIns.create({
700
+ PaymentType: "CARD",
701
+ ExecutionType: "WEB",
702
+ AuthorId: "user-id",
703
+ CreditedWalletId: "wallet-id",
704
+ Fees: {Amount: 100, Currency: "GBP"},
705
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
706
+ ReturnURL: "https://secure-return.co",
707
+ Culture: "AD",
708
+ CardType: "MAESTRO"
709
+ }).then(data => {
710
+ expectType<Mangopay.payIn.CardWebPayInData>(data);
711
+ });
712
+
713
+ api.PayIns.createPayPal({
714
+ PaymentType: "PAYPAL",
715
+ ExecutionType: "WEB",
716
+ AuthorId: "user-id",
717
+ CreditedWalletId: "wallet-id",
718
+ Fees: {Amount: 100, Currency: "GBP"},
719
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
720
+ LineItems: [
721
+ {
722
+ Name: "test",
723
+ Quantity: 100,
724
+ TaxAmount: undefined,
725
+ UnitAmount: 10,
726
+ Description: "placeholder"
727
+ }
728
+ ],
729
+ Shipping: {
730
+ FirstName: "John",
731
+ LastName: "Doe",
732
+ Address: {
733
+ AddressLine1: "test addr1",
734
+ AddressLine2: undefined,
735
+ City: "Paris",
736
+ Country: "FR",
737
+ Region: "Europe",
738
+ PostalCode: "68400"
739
+ }
740
+ },
741
+ ReturnURL: "http://test.com",
742
+ Tag: "test tag",
743
+ StatementDescriptor: "test",
744
+ Reference: "Reference",
745
+ Culture: "FR"
746
+ }).then(data => {
747
+ expectType<Mangopay.payIn.PayPalWebPayInData>(data);
748
+ });
749
+
750
+ api.PayIns.addPayPalTrackingInformation(
751
+ "payInId",
752
+ {
753
+ TrackingNumber: "123456789",
754
+ Carrier: "DHL",
755
+ NotifyBuyer: true
756
+ }).then(data => {
757
+ expectType<Mangopay.payIn.PayPalWebPayInData>(data);
758
+ });
759
+
760
+ api.PayIns.createGooglePay({
761
+ PaymentType: "GOOGLE_PAY",
762
+ ExecutionType: "DIRECT",
763
+ AuthorId: "user-id",
764
+ CreditedWalletId: "wallet-id",
765
+ Fees: {Amount: 100, Currency: "GBP"},
766
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
767
+ SecureModeReturnURL: "http://test.com",
768
+ BrowserInfo: {
769
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
770
+ ColorDepth: 4,
771
+ JavaEnabled: true,
772
+ JavascriptEnabled: true,
773
+ Language: 'FR-FR',
774
+ ScreenHeight: 1800,
775
+ ScreenWidth: 400,
776
+ TimeZoneOffset: "+60",
777
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
778
+ },
779
+ IpAddress: "1234",
780
+ PaymentData: "placeholder"
781
+ }).then(data => {
782
+ expectType<Mangopay.payIn.GooglePayDirectPayInData>(data);
783
+ });
784
+
785
+ api.PayIns.create({
786
+ PaymentType: "BANK_WIRE",
787
+ ExecutionType: "DIRECT",
788
+ AuthorId: "user-id",
789
+ CreditedWalletId: "wallet-id",
790
+ DeclaredDebitedFunds: {Amount: 10000, Currency: "GBP"},
791
+ DeclaredFees: {Amount: 500, Currency: "GBP"}
792
+ }).then(data => {
793
+ expectType<Mangopay.payIn.BankWireDirectPayInData>(data);
794
+ });
795
+
796
+ // create Payconiq PayIn
797
+ api.PayIns.create({
798
+ PaymentType: "PAYCONIQ",
799
+ ExecutionType: "WEB",
800
+ Tag: "custom meta",
801
+ AuthorId: "user-id",
802
+ CreditedWalletId: "wallet-id",
803
+ DebitedFunds: {Amount: 500, Currency: "GBP"},
804
+ Fees: {Amount: 500, Currency: "GBP"},
805
+ ReturnURL: "http://www.my-site.com/returnURL",
806
+ Country: "BE"
807
+ }).then(data => {
808
+ expectType<Mangopay.payIn.PayconiqWebPayInData>(data);
809
+ });
810
+
811
+ api.PayIns.create({
812
+ PaymentType: "DIRECT_DEBIT",
813
+ ExecutionType: "DIRECT",
814
+ AuthorId: "user-id",
815
+ CreditedUserId: "user-id",
816
+ CreditedWalletId: "wallet-id",
817
+ Fees: {Amount: 100, Currency: "GBP"},
818
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
819
+ StatementDescriptor: "placeholder",
820
+ MandateId: "mandate-id"
821
+ }).then(data => {
822
+ expectType<Mangopay.payIn.DirectDebitDirectPayInData>(data);
823
+ });
824
+
825
+ api.PayIns.create({
826
+ PaymentType: "DIRECT_DEBIT",
827
+ ExecutionType: "WEB",
828
+ AuthorId: "user-id",
829
+ CreditedWalletId: "wallet-id",
830
+ Fees: {Amount: 100, Currency: "GBP"},
831
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
832
+ ReturnURL: "placeholder",
833
+ DirectDebitType: "GIROPAY",
834
+ Culture: "EN"
835
+ }).then(data => {
836
+ expectType<Mangopay.payIn.DirectDebitWebPayInData>(data);
837
+ });
838
+
839
+ api.PayIns.get("payin-id").then(data => {
840
+ expectType<Mangopay.payIn.PayInData>(data);
841
+ });
842
+
843
+ api.PayIns.createRefund("payin-id", {AuthorId: "user-id"}).then(data => {
844
+ expectType<Mangopay.refund.RefundData>(data);
845
+ });
846
+
847
+ api.PayIns.createRefund("payin-id", {
848
+ AuthorId: "user-id",
849
+ DebitedFunds: {Amount: 100, Currency: "EUR"},
850
+ Fees: {Amount: 15, Currency: "EUR"}
851
+ }).then(data => {
852
+ expectType<Mangopay.refund.RefundData>(data);
853
+ });
854
+
855
+ api.PayIns.getRefunds("payin-id").then(data => {
856
+ expectType<Mangopay.refund.RefundData[]>(data);
857
+ });
858
+
859
+ api.PayIns.createRecurringPayment({
860
+ AuthorId: "author-id",
861
+ CardId: "card-id",
862
+ CreditedUserId: "credited-user-id",
863
+ CreditedWalletId: "credited-wallet-id",
864
+ FirstTransactionDebitedFunds: {Amount: 10000, Currency: "EUR"},
865
+ FirstTransactionFees: {Amount: 10000, Currency: "EUR"},
866
+ Billing: {
867
+ FirstName: "FN", LastName: "LN", Address: {
868
+ AddressLine1: "20 T Street",
869
+ AddressLine2: "",
870
+ City: "London",
871
+ Country: "AD",
872
+ PostalCode: "FR43 2WE",
873
+ Region: "London"
874
+ }
875
+ },
876
+ Shipping: {
877
+ FirstName: "FN", LastName: "LN", Address: {
878
+ AddressLine1: "20 T Street",
879
+ AddressLine2: "",
880
+ City: "London",
881
+ Country: "AD",
882
+ PostalCode: "FR43 2WE",
883
+ Region: "London"
884
+ }
885
+ },
886
+ EndDate: 1234,
887
+ Frequency: "Monthly",
888
+ FixedNextAmount: false,
889
+ FractionedPayment: false,
890
+ Migration: false,
891
+ NextTransactionDebitedFunds: {Amount: 10000, Currency: "EUR"},
892
+ NextTransactionFees: {Amount: 10000, Currency: "EUR"},
893
+ FreeCycles: 0
894
+ }).then(data => {
895
+ expectType<Mangopay.payIn.PayInRecurringRegistrationData>(data);
896
+ });
897
+
898
+ api.PayIns.getRecurringPayin("payin-id").then(data => {
899
+ expectType<Mangopay.payIn.PayInRecurringRegistrationData>(data);
900
+ });
901
+
902
+ api.PayIns.updateRecurringPayin("payin-id", {
903
+ CardId: "card-id",
904
+ Billing: {
905
+ FirstName: "FN", LastName: "LN", Address: {
906
+ AddressLine1: "20 T Street",
907
+ AddressLine2: "",
908
+ City: "London",
909
+ Country: "AD",
910
+ PostalCode: "FR43 2WE",
911
+ Region: "London"
912
+ }
913
+ },
914
+ Shipping: {
915
+ FirstName: "FN", LastName: "LN", Address: {
916
+ AddressLine1: "20 T Street",
917
+ AddressLine2: "",
918
+ City: "London",
919
+ Country: "AD",
920
+ PostalCode: "FR43 2WE",
921
+ Region: "London"
922
+ }
923
+ }
924
+ }).then(data => {
925
+ expectType<Mangopay.payIn.PayInRecurringRegistrationData>(data);
926
+ });
927
+
928
+ api.PayIns.createRecurringPayInRegistrationCIT({
929
+ RecurringPayinRegistrationId: "recurring-payin-reg-id",
930
+ BrowserInfo: {
931
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
932
+ ColorDepth: 4,
933
+ JavaEnabled: true,
934
+ JavascriptEnabled: true,
935
+ Language: 'FR-FR',
936
+ ScreenHeight: 1800,
937
+ ScreenWidth: 400,
938
+ TimeZoneOffset: "+60",
939
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
940
+ },
941
+ IpAddress: "1234",
942
+ SecureModeReturnURL: "http://www.my-site.com/returnURL",
943
+ DebitedFunds: {Amount: 100, Currency: "EUR"},
944
+ Fees: {Amount: 100, Currency: "EUR"},
945
+ StatementDescriptor: "lorem",
946
+ Tag: "custom meta"
947
+ }).then(data => {
948
+ expectType<Mangopay.payIn.RecurringPayInData>(data);
949
+ });
950
+
951
+ api.PayIns.createRecurringPayInRegistrationMIT({
952
+ RecurringPayinRegistrationId: "recurring-payin-reg-id",
953
+ DebitedFunds: {Amount: 100, Currency: "EUR"},
954
+ Fees: {Amount: 100, Currency: "EUR"},
955
+ StatementDescriptor: "lorem",
956
+ Tag: "custom meta"
957
+ }).then(data => {
958
+ expectType<Mangopay.payIn.RecurringPayInData>(data);
959
+ });
960
+
961
+ api.PayIns.getPaymentMethodMetadata({
962
+ Type: "BIN",
963
+ Bin: "1234"
964
+ }).then(data => {
965
+ expectType<Mangopay.payIn.PaymentMethodMetadata>(data);
966
+ });
967
+
968
+ /* Clients */
969
+ api.Clients.get().then(data => {
970
+ expectType<Mangopay.client.ClientData>(data);
971
+ });
972
+
973
+ api.Clients.update({PlatformType: "CROWDFUNDING_DONATION"}).then(data => {
974
+ expectType<Mangopay.client.ClientData>(data);
975
+ });
976
+
977
+ api.Clients.uploadLogo("...logobase64...").then(data => {
978
+ expectType<Mangopay.client.ClientData>(data);
979
+ });
980
+
981
+ api.Clients.uploadLogoFromFile("path/to/file").then(data => {
982
+ expectType<Mangopay.client.ClientData>(data);
983
+ });
984
+
985
+ api.Clients.getClientWallets().then(data => {
986
+ expectType<Mangopay.wallet.ClientWalletData[]>(data);
987
+ });
988
+
989
+ api.Clients.getClientWallet("CREDIT", "GBP").then(data => {
990
+ expectType<Mangopay.wallet.ClientWalletData>(data);
991
+ });
992
+
993
+ api.Clients.getClientWalletsByFundsType("FEES").then(data => {
994
+ expectType<Mangopay.wallet.ClientWalletData[]>(data);
995
+ });
996
+
997
+ api.Clients.getClientWalletTransactions("CREDIT", "GBP").then(data => {
998
+ expectType<Mangopay.transaction.TransactionData[]>(data);
999
+ });
1000
+
1001
+ /* PayOuts */
1002
+ api.PayOuts.create({
1003
+ Fees: {Amount: 0, Currency: "GBP"},
1004
+ AuthorId: "user-id",
1005
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
1006
+ BankAccountId: "bank-id",
1007
+ DebitedWalletId: "wallet-id",
1008
+ BankWireRef: "placeholder",
1009
+ Tag: "placeholder",
1010
+ PaymentType: api.models.PayOutPaymentType.BankWire
1011
+ }).then(data => {
1012
+ expectType<Mangopay.payOut.PayOutData>(data);
1013
+ });
1014
+
1015
+ api.PayOuts.get("payout-id").then(data => {
1016
+ expectType<Mangopay.payOut.PayOutData>(data);
1017
+ });
1018
+
1019
+ api.PayOuts.getRefunds("payout-id").then(data => {
1020
+ expectType<Mangopay.refund.RefundData[]>(data);
1021
+ });
1022
+
1023
+ api.PayOuts.checkEligibility({
1024
+ AuthorId: "user-id",
1025
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
1026
+ BankAccountId: "bank-id",
1027
+ PayoutModeRequested: "INSTANT_PAYMENT",
1028
+ DebitedWalletId: "wallet_id",
1029
+ PaymentType: api.models.PayOutPaymentType.BankWire
1030
+ }).then(data => {
1031
+ expectType<Mangopay.payOut.CheckPayOutEligibilityData>(data);
1032
+ });
1033
+
1034
+ /* Transfers */
1035
+ api.Transfers.create({
1036
+ Fees: {Amount: 0, Currency: "GBP"},
1037
+ AuthorId: "user-id",
1038
+ DebitedFunds: {Amount: 2000, Currency: "GBP"},
1039
+ DebitedWalletId: "debit-wallet-id",
1040
+ CreditedWalletId: "credit-wallet-id"
1041
+ }).then(data => {
1042
+ expectType<Mangopay.transfer.TransferData>(data);
1043
+ });
1044
+
1045
+ api.Transfers.get("transfer-id").then(data => {
1046
+ expectType<Mangopay.transfer.TransferData>(data);
1047
+ });
1048
+
1049
+ api.Transfers.createRefund("transfer-id", {AuthorId: "user-id"}).then(
1050
+ data => {
1051
+ expectType<Mangopay.refund.RefundData>(data);
1052
+ }
1053
+ );
1054
+
1055
+ api.Transfers.getRefunds("transfer-id").then(data => {
1056
+ expectType<Mangopay.refund.RefundData[]>(data);
1057
+ });
1058
+
1059
+ /* BankingAliases */
1060
+ api.BankingAliases.create({
1061
+ Country: "GB",
1062
+ OwnerName: "owner-id",
1063
+ Type: 'IBAN',
1064
+ WalletId: '1234'
1065
+ }).then(data => {
1066
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData>(data);
1067
+ });
1068
+
1069
+ api.BankingAliases.get("alias-id").then(data => {
1070
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData>(data);
1071
+ });
1072
+
1073
+ api.BankingAliases.getAll("1234").then(data => {
1074
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData[]>(data);
1075
+ });
1076
+
1077
+ api.BankingAliases.update({
1078
+ Id: '1234',
1079
+ Active: false
1080
+ }).then(data => {
1081
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData>(data);
1082
+ });
1083
+
1084
+ api.BankingAliases.deactivate("alias-id").then(data => {
1085
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData>(data);
1086
+ });
1087
+
1088
+ api.BankingAliases.activate("alias-id").then(data => {
1089
+ expectType<Mangopay.bankingAlias.IBANBankingAliasData>(data);
1090
+ });
1091
+
1092
+ /* DisputeDocuments */
1093
+ api.DisputeDocuments.getAll().then(data => {
1094
+ expectType<Mangopay.disputeDocument.DisputeDocumentData[]>(data);
1095
+ });
1096
+
1097
+ api.DisputeDocuments.get("dispute-doc-id").then(data => {
1098
+ expectType<Mangopay.disputeDocument.DisputeDocumentData>(data);
1099
+ });
1100
+
1101
+ api.DisputeDocuments.createDisputeDocumentConsult("dispute-doc-id").then(
1102
+ data => {
1103
+ expectType<any>(data); // TODO unsure of expected type from docs
1104
+ }
1105
+ );
1106
+
1107
+ /* Repudiations */
1108
+ api.Repudiations.getRefunds("repudiation-id").then(data => {
1109
+ expectType<Mangopay.refund.RefundData[]>(data);
1110
+ });
1111
+
1112
+ /* Disputes */
1113
+ api.Disputes.get("dispute-id").then(data => {
1114
+ expectType<Mangopay.dispute.DisputeData>(data);
1115
+ });
1116
+
1117
+ api.Disputes.getAll().then(data => {
1118
+ expectType<Mangopay.dispute.DisputeData[]>(data);
1119
+ });
1120
+
1121
+ api.Disputes.update({Tag: "any tags"}).then(data => {
1122
+ expectType<Mangopay.dispute.DisputeData>(data);
1123
+ });
1124
+
1125
+ api.Disputes.contestDispute("dispute-id", {
1126
+ Amount: 1000,
1127
+ Currency: "GBP"
1128
+ }).then(data => {
1129
+ expectType<Mangopay.dispute.DisputeData>(data);
1130
+ });
1131
+
1132
+ api.Disputes.resubmitDispute("dispute-id").then(data => {
1133
+ expectType<Mangopay.dispute.DisputeData>(data);
1134
+ });
1135
+
1136
+ api.Disputes.closeDispute("dispute-id").then(data => {
1137
+ expectType<Mangopay.dispute.DisputeData>(data);
1138
+ });
1139
+
1140
+ api.Disputes.getTransactions("dispute-id").then(data => {
1141
+ expectType<Mangopay.transaction.TransactionData[]>(data);
1142
+ });
1143
+
1144
+ api.Disputes.getDisputesForWallet("wallet-id").then(data => {
1145
+ expectType<Mangopay.dispute.DisputeData[]>(data);
1146
+ });
1147
+
1148
+ api.Disputes.getDisputesForUser("user-id").then(data => {
1149
+ expectType<Mangopay.dispute.DisputeData[]>(data);
1150
+ });
1151
+
1152
+ api.Disputes.getRepudiation("repudiation-id").then(data => {
1153
+ expectType<Mangopay.repudiation.RepudiationData>(data);
1154
+ });
1155
+
1156
+ api.Disputes.createSettlementTransfer(
1157
+ {
1158
+ AuthorId: "user-id",
1159
+ DebitedFunds: {Amount: 1000, Currency: "GBP"},
1160
+ Fees: {Amount: 200, Currency: "GBP"}
1161
+ },
1162
+ "repudiation-id"
1163
+ ).then(data => {
1164
+ expectType<Mangopay.settlementTransfer.SettlementTransferData>(data);
1165
+ });
1166
+
1167
+ api.Disputes.getSettlementTransfer("settlement-id").then(data => {
1168
+ expectType<Mangopay.settlementTransfer.SettlementTransferData>(data);
1169
+ });
1170
+
1171
+ api.Disputes.getDocumentsForDispute("dispute-id").then(data => {
1172
+ expectType<Mangopay.disputeDocument.DisputeDocumentData[]>(data);
1173
+ });
1174
+
1175
+ api.Disputes.updateDisputeDocument("dispute-id", {Tag: "update"}).then(
1176
+ data => {
1177
+ expectType<Mangopay.disputeDocument.DisputeDocumentData>(data);
1178
+ }
1179
+ );
1180
+
1181
+ api.Disputes.createDisputeDocument("dispute-id", {
1182
+ Type: "DELIVERY_PROOF"
1183
+ }).then(data => {
1184
+ expectType<Mangopay.disputeDocument.DisputeDocumentData>(data);
1185
+ });
1186
+
1187
+ api.Disputes.createDisputeDocumentPage("dispute-id", "dispute-doc-id", {
1188
+ File: "...base64string..."
1189
+ }).then(data => {
1190
+ expectType<Mangopay.disputeDocument.DisputeDocumentData>(data);
1191
+ });
1192
+
1193
+ api.Disputes.createDisputeDocumentPageFromFile(
1194
+ "dispute-id",
1195
+ "dispute-doc-id",
1196
+ "path/to/file"
1197
+ ).then(data => {
1198
+ expectType<Mangopay.disputeDocument.DisputeDocumentData>(data);
1199
+ });
1200
+
1201
+ api.Disputes.getPendingSettlement().then(data => {
1202
+ expectType<Mangopay.dispute.DisputeData[]>(data);
1203
+ });
1204
+
1205
+ /* Events */
1206
+ api.Events.getAll().then(data => {
1207
+ expectType<Mangopay.event.EventData[]>(data);
1208
+ });
1209
+
1210
+ /* Responses */
1211
+ api.Responses.get().then(data => {
1212
+ expectType<any[]>(data);
1213
+ });
1214
+
1215
+ /* Mandates */
1216
+ api.Mandates.create({
1217
+ BankAccountId: "bank-account-id",
1218
+ ReturnURL: "https://return-url.com",
1219
+ Culture: "EN"
1220
+ }).then(data => {
1221
+ expectType<Mangopay.mandate.MandateData>(data);
1222
+ });
1223
+
1224
+ api.Mandates.getAll().then(data => {
1225
+ expectType<Mangopay.mandate.MandateData[]>(data);
1226
+ });
1227
+
1228
+ api.Mandates.get("mandate-id").then(data => {
1229
+ expectType<Mangopay.mandate.MandateData>(data);
1230
+ });
1231
+
1232
+ api.Mandates.cancel("mandate-id").then(data => {
1233
+ expectType<Mangopay.mandate.MandateData>(data);
1234
+ });
1235
+
1236
+ api.Mandates.getMandatesForUser("user-id").then(data => {
1237
+ expectType<Mangopay.mandate.MandateData[]>(data);
1238
+ });
1239
+
1240
+ api.Mandates.getMandatesForBankAccount("user-id", "bank-account-id").then(
1241
+ data => {
1242
+ expectType<Mangopay.mandate.MandateData[]>(data);
1243
+ }
1244
+ );
1245
+ api.Mandates.getTransactions("mandate-id").then(data => {
1246
+ expectType<Mangopay.transaction.TransactionData[]>(data);
1247
+ });
1248
+
1249
+ /* Hooks */
1250
+ api.Hooks.create({
1251
+ Url: "https://hook-url.com",
1252
+ EventType: "DISPUTE_ACTION_REQUIRED"
1253
+ }).then(data => {
1254
+ expectType<Mangopay.hook.HookData>(data);
1255
+ });
1256
+
1257
+ api.Hooks.get("hook-id").then(data => {
1258
+ expectType<Mangopay.hook.HookData>(data);
1259
+ });
1260
+
1261
+ api.Hooks.update({Id: "hook-id", Url: "https://new-hook.com/hooks"}).then(
1262
+ data => {
1263
+ expectType<Mangopay.hook.HookData>(data);
1264
+ }
1265
+ );
1266
+
1267
+ api.Hooks.getAll().then(data => {
1268
+ expectType<Mangopay.hook.HookData[]>(data);
1269
+ });
1270
+
1271
+ /* Reports */
1272
+ api.Reports.create({Columns: ["Alias", "AuthorId"], ReportType: "WALLETS"}).then(data => {
1273
+ expectType<Mangopay.report.ReportData>(data);
1274
+ });
1275
+
1276
+ api.Reports.get("report-id").then(data => {
1277
+ expectType<Mangopay.report.ReportData>(data);
1278
+ });
1279
+
1280
+ api.Reports.getAll().then(data => {
1281
+ expectType<Mangopay.report.ReportData[]>(data);
1282
+ });
1283
+
1284
+ api.Idempotency.get("idempotency-key").then(data => {
1285
+ expectType<Mangopay.idempotency.IdempotencyData>(data);
1286
+ });
1287
+
1288
+ api.Regulatory.getCountryAuthorizations("FR").then(data => {
1289
+ expectType<Mangopay.countryAuthorization.CountryAuthorizationData>(data);
1290
+ });
1291
+
1292
+ api.Regulatory.getAllCountriesAuthorizations().then(data => {
1293
+ expectType<Mangopay.countryAuthorization.CountryAuthorizationData[]>(data);
1294
+ });
1295
+
1296
+ api.Deposits.create(new api.models.Deposit({
1297
+ AuthorId: "placeholder",
1298
+ DebitedFunds: {
1299
+ Amount: 1000,
1300
+ Currency: "EUR"
1301
+ },
1302
+ CardId: "placeholder",
1303
+ SecureModeReturnURL: "https://lorem",
1304
+ IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C",
1305
+ BrowserInfo: {
1306
+ AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
1307
+ ColorDepth: 4,
1308
+ JavaEnabled: true,
1309
+ JavascriptEnabled: true,
1310
+ Language: 'FR-FR',
1311
+ ScreenHeight: 1800,
1312
+ ScreenWidth: 400,
1313
+ TimeZoneOffset: "+60",
1314
+ UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
1315
+ }
1316
+ }), data => {
1317
+ expectType<Mangopay.deposit.DepositData>(data);
1318
+ });
1319
+
1320
+ api.Deposits.get("placeholder", data => {
1321
+ expectType<Mangopay.deposit.DepositData>(data);
1322
+ });
1323
+
1324
+ api.Deposits.cancel("placeholder", data => {
1325
+ expectType<Mangopay.deposit.DepositData>(data);
1326
+ });
1327
+
1328
+ api.PayIns.createCardPreAuthorizedDepositPayIn({
1329
+ CreditedWalletId: "placeholder",
1330
+ DebitedFunds: {
1331
+ Amount: 1000,
1332
+ Currency: "EUR"
1333
+ },
1334
+ Fees: {
1335
+ Amount: 1000,
1336
+ Currency: "EUR"
1337
+ },
1338
+ DepositId: "placeholder"
1339
+ }, data => {
1340
+ expectType<Mangopay.payIn.CardPreAuthorizedDepositPayInData>(data);
1341
+ });
1342
+
1343
+ api.Conversions.getConversionRate("EUR", "GBP")
1344
+ .then(data => {
1345
+ expectType<Mangopay.conversionRate.ConversionRateData>(data);
1346
+ });
1347
+
1348
+ api.Conversions.createInstantConversion(
1349
+ {
1350
+ AuthorId: "author-id",
1351
+ CreditedWalletId: "credited-wallet-id",
1352
+ DebitedWalletId: "debited-wallet-id",
1353
+ CreditedFunds: {
1354
+ Amount: 0,
1355
+ Currency: "GBP"
1356
+ },
1357
+ DebitedFunds: {
1358
+ Amount: 79,
1359
+ Currency: "EUR"
1360
+ }
1361
+ }
1362
+ ).then(data => {
1363
+ expectType<Mangopay.conversion.ConversionData>(data);
1364
+ });
1365
+
1366
+ api.Conversions.createQuotedConversion(
1367
+ {
1368
+ QuoteId: "quote-id",
1369
+ AuthorId: "author-id",
1370
+ CreditedWalletId: "credited-wallet-id",
1371
+ DebitedWalletId: "debited-wallet-id"
1372
+ }
1373
+ ).then(data => {
1374
+ expectType<Mangopay.conversion.ConversionData>(data);
1375
+ });
1376
+
1377
+ api.Conversions.getConversion("conversion-id")
1378
+ .then(data => {
1379
+ expectType<Mangopay.conversion.ConversionData>(data);
1380
+ });
1381
+
1382
+ api.Conversions.createQuote(
1383
+ {
1384
+ CreditedFunds: {
1385
+ Amount: 0,
1386
+ Currency: "GBP"
1387
+ },
1388
+ DebitedFunds: {
1389
+ Amount: 79,
1390
+ Currency: "EUR"
1391
+ },
1392
+ Duration: 60
1393
+ }
1394
+ ).then(data => {
1395
+ expectType<Mangopay.conversion.QuoteData>(data);
1396
+ });
1397
+
1398
+ api.Conversions.getQuote("quote-id")
1399
+ .then(data => {
1400
+ expectType<Mangopay.conversion.QuoteData>(data);
1401
+ });
1402
+
1403
+ api.OptionsHelper.withIdempotency({}, "1234")
1404
+ .then(data => {
1405
+ expectType<base.MethodOptions>(data);
1406
+ })
1407
+
1408
+ api.PayIns.partialCancelPayInIntent("intentId", {Amount: 0, LineItems: [], ExternalData: {}})
1409
+ .then(data => {
1410
+ expectType<Mangopay.payIn.PayInIntentData>(data);
1411
+ })
1412
+
1413
+ api.PayIns.fullCancelPayInIntent("intentId", {ExternalData: {}})
1414
+ .then(data => {
1415
+ expectType<Mangopay.payIn.PayInIntentData>(data);
1416
+ })
1417
+
1418
+ /* Namespace Access */
1419
+ const bankAccountType: Mangopay.bankAccount.BankAccountType = "CA";
1420
+
1421
+ const bankingAliasType: Mangopay.bankingAlias.BankingAliasType = "IBAN";
1422
+
1423
+ const billingData: Mangopay.billing.BillingData = {
1424
+ Address: address
1425
+ };
1426
+
1427
+ const birthplace: Mangopay.birthplace.Birthplace = {
1428
+ City: "palceholder",
1429
+ Country: "FR"
1430
+ };
1431
+
1432
+ const cardType: Mangopay.card.CardType = "CB_VISA_MASTERCARD";
1433
+
1434
+ const paymentStatus: Mangopay.cardPreAuthorization.PaymentStatus = "CANCELED";
1435
+
1436
+ const createCardRegistration: Mangopay.cardRegistration.CreateCardRegistration = {
1437
+ UserId: "placeholder",
1438
+ Currency: "AFN"
1439
+ };
1440
+
1441
+ const businessType: Mangopay.client.BusinessType = "CROWDFUNDING";
1442
+
1443
+ const disputeReasonType: Mangopay.dispute.DisputeReasonType = "AUTHORISATION_DISPUTED";
1444
+
1445
+ const disputeDocumentType: Mangopay.disputeDocument.DisputeDocumentType = "DELIVERY_PROOF";
1446
+
1447
+ const eventType: Mangopay.event.EventType = "DISPUTE_ACTION_REQUIRED";
1448
+
1449
+ const hookStatus: Mangopay.hook.HookStatus = "ENABLED";
1450
+
1451
+ const idempotency: Mangopay.idempotency.IdempotencyData = {
1452
+ Id: "placeholder",
1453
+ Tag: "placeholder",
1454
+ ContentLength: "123",
1455
+ ContentType: "placeholder",
1456
+ CreationDate: 1234,
1457
+ Date: 1234,
1458
+ RequestURL: "placeholder",
1459
+ Resource: undefined,
1460
+ StatusCode: "1234"
1461
+ };
1462
+
1463
+ const kycDocumentType: Mangopay.kycDocument.KycDocumentType = "ADDRESS_PROOF";
1464
+
1465
+ const mandateStatus: Mangopay.mandate.MandateStatus = "CREATED";
1466
+
1467
+ const moneyData: Mangopay.money.MoneyData = {
1468
+ Currency: "AFN",
1469
+ Amount: 1234
1470
+ };
1471
+
1472
+ const directDebitType: Mangopay.payIn.DirectDebitType = "GIROPAY";
1473
+
1474
+ const payoutModeRequestedType: Mangopay.payOut.PayoutModeRequestedType = "INSTANT_PAYMENT";
1475
+
1476
+ const refundReasonType: Mangopay.refund.RefundReasonType = "BANKACCOUNT_HAS_BEEN_CLOSED";
1477
+
1478
+ const reportColumn: Mangopay.report.Column = "Tag";
1479
+
1480
+ const avsResult: Mangopay.securityInfo.AVSResult = "ADDRESS_MATCH_ONLY";
1481
+
1482
+ const createSettlementTransfer: Mangopay.settlementTransfer.CreateSettlementTransfer = {
1483
+ AuthorId: "placeholder",
1484
+ DebitedFunds: {
1485
+ Amount: 1234,
1486
+ Currency: "AFN"
1487
+ },
1488
+ Fees: {
1489
+ Amount: 1234,
1490
+ Currency: "AFN"
1491
+ }
1492
+ };
1493
+
1494
+ const shippingData: Mangopay.shipping.ShippingData = {
1495
+ Address: address,
1496
+ FirstName: "placeholder",
1497
+ LastName: "placeholder"
1498
+ };
1499
+
1500
+ const shippingAddressData: Mangopay.shippingAddress.ShippingAddressData = {
1501
+ Address: address,
1502
+ RecipientName: "placeholder"
1503
+ };
1504
+
1505
+ const transactionType: Mangopay.transaction.TransactionType = "TRANSFER";
1506
+
1507
+ const createTransfer: Mangopay.transfer.CreateTransfer = {
1508
+ AuthorId: "placeholder",
1509
+ Fees: {
1510
+ Amount: 1234,
1511
+ Currency: "AFN"
1512
+ },
1513
+ DebitedFunds: {
1514
+ Amount: 1234,
1515
+ Currency: "AFN"
1516
+ },
1517
+ CreditedWalletId: "placeholder",
1518
+ DebitedWalletId: "placeholder"
1519
+ };
1520
+
1521
+ const createUboDeclaration: Mangopay.uboDeclaration.CreateUboDeclaration = {
1522
+ Ubos: []
1523
+ };
1524
+
1525
+ const personType: Mangopay.user.PersonType = Mangopay.models.PersonType.Legal;
1526
+
1527
+ const clientFundsType: Mangopay.wallet.ClientFundsType = "CREDIT";
1528
+
1529
+ const timestamp: Mangopay.Timestamp = 1234;
1530
+
1531
+ const secureMode: Mangopay.SecureMode = "DEFAULT";
1532
+
1533
+ const countryISO: Mangopay.CountryISO = "FR";
1534
+
1535
+ const currencyISO: Mangopay.CurrencyISO = "EUR";