diff --git a/lib/apiMethods.js b/lib/apiMethods.js index 939ad67..a7066e8 100644 --- a/lib/apiMethods.js +++ b/lib/apiMethods.js @@ -51,6 +51,8 @@ module.exports = { "payins_satispay-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/satispay", "POST"], "payins_blik-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/blik", "POST"], "payins_klarna-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/klarna", "POST"], + "payins_ideal-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/ideal", "POST"], + "payins_giropay-web_create": ["/${apiVersion}/${clientId}/payins/payment-methods/giropay", "POST"], "payouts_bankwire_create": ["/${apiVersion}/${clientId}/payouts/bankwire/", "POST"], "payouts_bankwire_get": ["/${apiVersion}/${clientId}/payouts/bankwire/${id}", "GET"], @@ -133,8 +135,8 @@ module.exports = { "disputes_repudiation_get_settlement": ["/${apiVersion}/${clientId}/settlements/${id}", "GET"], "disputes_pending_settlement": ["/${apiVersion}/${clientId}/disputes/pendingsettlement", "GET"], - "reports_transaction_create": ["/${apiVersion}/${clientId}/reports/transactions/", "POST"], - "reports_wallet_create": ["/${apiVersion}/${clientId}/reports/wallets/", "POST"], + "reports_transactions_create": ["/${apiVersion}/${clientId}/reports/transactions/", "POST"], + "reports_wallets_create": ["/${apiVersion}/${clientId}/reports/wallets/", "POST"], "reports_get": ["/${apiVersion}/${clientId}/reports/${id}", "GET"], "reports_all": ["/${apiVersion}/${clientId}/reports", "GET"], diff --git a/lib/models/PayInPaymentDetailsGiropay.js b/lib/models/PayInPaymentDetailsGiropay.js new file mode 100644 index 0000000..19de35b --- /dev/null +++ b/lib/models/PayInPaymentDetailsGiropay.js @@ -0,0 +1,15 @@ +var _ = require('underscore'); +var PayInPaymentDetails = require('./PayInPaymentDetails'); + +var PayInPaymentDetailsGiropay = PayInPaymentDetails.extend({ + defaults: { + + /** + * Custom description to show on the user's bank statement. + * It can be up to 10 char alpha-numeric and space. + */ + StatementDescriptor: null + } +}); + +module.exports = PayInPaymentDetailsGiropay; diff --git a/lib/models/PayInPaymentDetailsIdeal.js b/lib/models/PayInPaymentDetailsIdeal.js new file mode 100644 index 0000000..1cb280c --- /dev/null +++ b/lib/models/PayInPaymentDetailsIdeal.js @@ -0,0 +1,25 @@ +var _ = require('underscore'); +var PayInPaymentDetails = require('./PayInPaymentDetails'); + +var PayInPaymentDetailsIdeal = PayInPaymentDetails.extend({ + defaults: { + + /** + * The BIC identifier of the end-user’s bank + */ + Bic: null, + + /** + * Name of the end-user’s bank + */ + BankName: null, + + /** + * Custom description to show on the user's bank statement. + * It can be up to 10 char alpha-numeric and space. + */ + StatementDescriptor: null + } +}); + +module.exports = PayInPaymentDetailsIdeal; \ No newline at end of file diff --git a/lib/models/PayInPaymentDetailsKlarna.js b/lib/models/PayInPaymentDetailsKlarna.js index 92e83e7..00e5f7e 100644 --- a/lib/models/PayInPaymentDetailsKlarna.js +++ b/lib/models/PayInPaymentDetailsKlarna.js @@ -17,7 +17,7 @@ var PayInPaymentDetailsKlarna = PayInPaymentDetails.extend({ Email: null, - MerchantOrderId: null, + Reference: null, /** * Custom description to show on the user's bank statement. diff --git a/lib/models/PayInPaymentType.js b/lib/models/PayInPaymentType.js index 4f7903f..90dce22 100644 --- a/lib/models/PayInPaymentType.js +++ b/lib/models/PayInPaymentType.js @@ -11,5 +11,7 @@ module.exports = { Multibanco: 'MULTIBANCO', Satispay: 'SATISPAY', Blik: 'BLIK', - Klarna: 'KLARNA' + Klarna: 'KLARNA', + Ideal: 'IDEAL', + Giropay: 'GIROPAY' }; diff --git a/lib/models/Refund.js b/lib/models/Refund.js index 168c53a..60b9ed6 100644 --- a/lib/models/Refund.js +++ b/lib/models/Refund.js @@ -11,13 +11,14 @@ var Refund = Transaction.extend({ InitialTransactionType: null, DebitedWalletId: null, CreditedWalletId: null, - RefundReason: null + RefundReason: null, + Reference: null }), getSubObjects: function() { return { 'RefundReason': RefundReasonDetails - } + }; } }); diff --git a/lib/models/Report.js b/lib/models/Report.js index e1a6c8c..bc3ae80 100644 --- a/lib/models/Report.js +++ b/lib/models/Report.js @@ -21,7 +21,7 @@ var Report = EntityBase.extend({ */ DownloadFormat: null, /** - * Report type {TRANSACTION} + * Report type {TRANSACTIONS, WALLETS} */ ReportType: null, /** diff --git a/lib/services/PayIns.js b/lib/services/PayIns.js index a5601e1..e7e2f8f 100644 --- a/lib/services/PayIns.js +++ b/lib/services/PayIns.js @@ -28,6 +28,8 @@ const PayInPaymentDetailsMultibanco = require("../models/PayInPaymentDetailsMult const PayInPaymentDetailsSatispay = require("../models/PayInPaymentDetailsSatispay"); const PayInPaymentDetailsBlik = require("../models/PayInPaymentDetailsBlik"); const PayInPaymentDetailsKlarna = require("../models/PayInPaymentDetailsKlarna"); +const PayInPaymentDetailsIdeal = require("../models/PayInPaymentDetailsIdeal"); +const PayInPaymentDetailsGiropay = require("../models/PayInPaymentDetailsGiropay"); var PayIns = Service.extend({ /** @@ -249,6 +251,8 @@ var PayIns = Service.extend({ if (payIn.PaymentDetails instanceof PayInPaymentDetailsSatispay) return 'satispay'; if (payIn.PaymentDetails instanceof PayInPaymentDetailsBlik) return 'blik'; if (payIn.PaymentDetails instanceof PayInPaymentDetailsKlarna) return 'klarna'; + if (payIn.PaymentDetails instanceof PayInPaymentDetailsIdeal) return 'ideal'; + if (payIn.PaymentDetails instanceof PayInPaymentDetailsGiropay) return 'giropay'; throw new Error('PayIn needs a PaymentType'); }, diff --git a/lib/services/Reports.js b/lib/services/Reports.js index b49bab2..5c72f98 100644 --- a/lib/services/Reports.js +++ b/lib/services/Reports.js @@ -21,7 +21,7 @@ var Reports = Service.extend({ }); if (!report.ReportType) { - throw new Error('Please specify ReportType in the report data (ex: "TRANSACTION", "WALLET")') + throw new Error('Please specify ReportType in the report data (ex: "TRANSACTIONS", "WALLETS")') } var reportType = report.ReportType.toLowerCase(); diff --git a/test/helpers.js b/test/helpers.js index cc0fecb..ebee03f 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -389,6 +389,7 @@ module.exports = { } ], ShippingPreference: "NO_SHIPPING", + Reference: "Reference", Tag: "tag", StatementDescriptor: "test" }; @@ -872,11 +873,70 @@ module.exports = { "Country": "US" } }, - MerchantOrderId: "1234", + Reference: "1234", StatementDescriptor: "test", Tag: "test tag" }; api.PayIns.create(payIn, callback); }); + }, + + getNewPayInIdealWeb: function (api, user, callback) { + var wallet = { + Owners: [user.Id], + Currency: 'EUR', + Description: 'WALLET IN EUR' + }; + + api.Wallets.create(wallet).then(function () { + var payIn = { + PaymentType: 'IDEAL', + ExecutionType: 'WEB', + AuthorId: user.Id, + CreditedWalletId: wallet.Id, + DebitedFunds: { + Amount: 1000, + Currency: 'EUR' + }, + Fees: { + Amount: 0, + Currency: 'EUR' + }, + ReturnURL: 'http://test.com', + Bic: 'SNSBNL2A', + StatementDescriptor: "ideal", + Tag: "test tag" + }; + api.PayIns.create(payIn, callback); + }); + }, + + getNewPayInGiropayWeb: function (api, user, callback) { + var wallet = { + Owners: [user.Id], + Currency: 'EUR', + Description: 'WALLET IN EUR' + }; + + api.Wallets.create(wallet).then(function () { + var payIn = { + PaymentType: 'GIROPAY', + ExecutionType: 'WEB', + AuthorId: user.Id, + CreditedWalletId: wallet.Id, + DebitedFunds: { + Amount: 1000, + Currency: 'EUR' + }, + Fees: { + Amount: 0, + Currency: 'EUR' + }, + ReturnURL: 'http://test.com', + StatementDescriptor: "giropay", + Tag: "test tag" + }; + api.PayIns.create(payIn, callback); + }); } }; diff --git a/test/services/PayIns.js b/test/services/PayIns.js index 90454bd..cf59d49 100644 --- a/test/services/PayIns.js +++ b/test/services/PayIns.js @@ -1164,7 +1164,86 @@ describe('PayIns', function () { }); }); - describe('GooglePay V2', function () { + describe('Ideal Web', function () { + var payIn; + + before(function (done) { + helpers.getNewPayInIdealWeb(api, john, function (data) { + payIn = data; + done(); + }); + }); + + describe('Create', function () { + it('should create the PayIn', function () { + expect(payIn.Id).not.to.be.undefined; + expect(payIn.PaymentType).to.equal('IDEAL'); + expect(payIn.ExecutionType).to.equal('WEB'); + expect(payIn.AuthorId).to.equal(john.Id); + expect(payIn.Type).to.equal('PAYIN'); + expect(payIn.Phone).not.to.be.null; + }); + }); + + describe('Get', function () { + var getPayIn; + before(function (done) { + api.PayIns.get(payIn.Id, function (data, response) { + getPayIn = data; + done() + }); + }); + + it('should get the PayIn', function () { + expect(getPayIn.Id).to.equal(payIn.Id); + expect(getPayIn.PaymentType).to.equal('IDEAL'); + expect(getPayIn.ExecutionType).to.equal('WEB'); + expect(getPayIn.Phone).not.to.be.null; + }); + }); + }); + + describe('Giropay Web', function () { + var payIn; + + before(function (done) { + helpers.getNewPayInGiropayWeb(api, john, function (data) { + payIn = data; + done(); + }); + }); + + describe('Create', function () { + it('should create the PayIn', function () { + expect(payIn.Id).not.to.be.undefined; + expect(payIn.PaymentType).to.equal('GIROPAY'); + expect(payIn.ExecutionType).to.equal('WEB'); + expect(payIn.AuthorId).to.equal(john.Id); + expect(payIn.Type).to.equal('PAYIN'); + expect(payIn.Phone).not.to.be.null; + }); + }); + + describe('Get', function () { + var getPayIn; + before(function (done) { + api.PayIns.get(payIn.Id, function (data, response) { + getPayIn = data; + done() + }); + }); + + it('should get the PayIn', function () { + expect(getPayIn.Id).to.equal(payIn.Id); + expect(getPayIn.PaymentType).to.equal('GIROPAY'); + expect(getPayIn.ExecutionType).to.equal('WEB'); + expect(getPayIn.Phone).not.to.be.null; + }); + }); + }); + + // skip because we cannot generate new paymentData in the tests + describe.skip('GooglePay V2', function () { var googlePayIn, wallet; before(function (done) { diff --git a/test/services/Reports.js b/test/services/Reports.js index 6fb5a1f..0421235 100644 --- a/test/services/Reports.js +++ b/test/services/Reports.js @@ -1,14 +1,60 @@ var expect = require('chai').expect; var helpers = require('../helpers'); +var api = require('../main'); -describe('Reports - Transaction', function() { +describe('Reports - Transactions', function () { var report; - before(function(done) { + before(function (done) { report = { - ReportType: "TRANSACTION" + ReportType: "TRANSACTIONS", + Tag: 'Created with Mangopay NodeJs SDK', + DownloadFormat: 'CSV', + CallbackURL: 'https://mangopay.com/docs/please-ignore', + Sort: 'CreationDate:ASC', + Preview: false, + Filters: + { + BeforeDate: 1658838931, + AfterDate: 1658838931, + Type: ['PAYIN'], + ResultCode: ['000000'], + Status: ['SUCCEEDED'], + Nature: ['REGULAR'], + WalletId: null, + AuthorId: null, + MinDebitedFundsAmount: 10, + MinDebitedFundsCurrency: 'EUR', + MaxDebitedFundsAmount: 12000, + MaxDebitedFundsCurrency: 'EUR', + MinFeesAmount: 10, + MinFeesCurrency: 'EUR', + MaxFeesAmount: 150000, + MaxFeesCurrency: 'EUR', + }, + Columns: [ + 'Id', + 'Tag', + 'CreationDate', + 'ExecutionDate', + 'AuthorId', + 'CreditedUserId', + 'DebitedFundsAmount', + 'DebitedFundsCurrency', + 'CreditedFundsAmount', + 'CreditedFundsCurrency', + 'FeesAmount', + 'FeesCurrency', + 'Status', + 'ResultCode', + 'ResultMessage', + 'Type', + 'Nature', + 'CreditedWalletId', + 'DebitedWalletId', + ] }; - api.Reports.create(report).then(function () { + api.Reports.create(report).then(function (data) { done(); }); }); @@ -20,8 +66,8 @@ describe('Reports - Transaction', function() { describe('Getting created report', function () { var getReport; - before(function(done){ - api.Reports.get(report.Id).then(function(data){ + before(function (done) { + api.Reports.get(report.Id).then(function (data) { getReport = data; done(); }); @@ -34,12 +80,12 @@ describe('Reports - Transaction', function() { }); }); -describe('Reports - Wallet', function() { +describe('Reports - Wallets', function () { var report; - before(function(done) { + before(function (done) { report = { - ReportType: "WALLET" + ReportType: "WALLETS" }; api.Reports.create(report).then(function () { done(); @@ -53,8 +99,8 @@ describe('Reports - Wallet', function() { describe('Getting created report', function () { var getReport; - before(function(done){ - api.Reports.get(report.Id).then(function(data){ + before(function (done) { + api.Reports.get(report.Id).then(function (data) { getReport = data; done(); }); diff --git a/typings/enums.d.ts b/typings/enums.d.ts index 74854ac..5c981f0 100644 --- a/typings/enums.d.ts +++ b/typings/enums.d.ts @@ -17,6 +17,8 @@ export namespace enums { Blik: "BLIK"; GooglePay: "GOOGLE_PAY"; Klarna: "KLARNA"; + Ideal: "IDEAL"; + Giropay: "GIROPAY"; } interface IMandateStatus { diff --git a/typings/index.d.ts b/typings/index.d.ts index 92012bc..e685690 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2,72 +2,72 @@ /// -import {ApiMethod, CountryISO, CurrencyISO, MakeKeysRequired, SecureMode, Timestamp} from "./types"; -import {base} from "./base"; -import {Users} from "./services/Users"; -import {BankAccounts} from "./services/BankAccounts"; -import {BankingAliases} from "./services/BankingAliases"; -import {DisputeDocuments} from "./services/DisputeDocuments"; -import {Wallets} from "./services/Wallets"; -import {KycDocuments} from "./services/KycDocuments"; -import {UboDeclarations} from "./services/UboDeclarations"; -import {Cards} from "./services/Cards"; -import {CardRegistrations} from "./services/CardRegistrations"; -import {CardPreAuthorizations} from "./services/CardPreauthorizations"; -import {PayIns} from "./services/PayIns"; -import {Transfers} from "./services/Transfers"; -import {PayOuts} from "./services/PayOuts"; -import {Refunds} from "./services/Refunds"; -import {Clients} from "./services/Clients"; -import {Disputes} from "./services/Disputes"; -import {Repudiations} from "./services/Repudiations"; -import {Events} from "./services/Events"; -import {Responses} from "./services/Responses"; -import {Mandates} from "./services/Mandates"; -import {Hooks} from "./services/Hooks"; -import {Reports} from "./services/Reports"; -import {Idempotency} from "./services/Idempotency"; -import {address} from "./models/address"; -import {enums} from "./enums"; -import {bankingAlias} from "./models/bankingAlias"; -import {bankAccount} from "./models/bankAccount"; -import {transaction} from "./models/transaction"; -import {wallet} from "./models/wallet"; -import {disputeDocument} from "./models/disputeDocument"; -import {uboDeclaration} from "./models/uboDeclaration"; -import {kycDocument} from "./models/kycDocument"; -import {money} from "./models/money"; -import {conversionRate} from "./models/conversionRate"; -import {instantConversion} from "./models/instantConversion"; -import {cardRegistration} from "./models/cardRegistration"; -import {card} from "./models/card"; -import {cardPreAuthorization} from "./models/cardPreauthorization"; -import {entityBase} from "./models/entityBase"; -import {user} from "./models/user"; -import {payIn} from "./models/payIn"; -import {refund} from "./models/refund"; -import {repudiation} from "./models/repudiation"; -import {client} from "./models/client"; -import {dispute} from "./models/dispute"; -import {settlementTransfer} from "./models/settlementTransfer"; -import {transfer} from "./models/transfer"; -import {shippingAddress} from "./models/shippingAddress"; -import {payOut} from "./models/payOut"; -import {mandate} from "./models/mandate"; -import {hook} from "./models/hook"; -import {report} from "./models/report"; -import {billing} from "./models/billing"; -import {deposit} from "./models/deposit"; -import {birthplace} from "./models/birthplace"; -import {event} from "./models/event"; -import {idempotency} from "./models/idempotency"; -import {securityInfo} from "./models/securityInfo"; -import {shipping} from "./models/shipping"; -import {countryAuthorization} from "./models/countryAuthorization"; -import {Regulatory} from "./services/Regulatory"; -import {Deposits} from "./services/Deposits"; -import {cardValidation} from "./models/cardValidation"; -import {InstantConversions} from "./services/InstantConversions"; +import { ApiMethod, CountryISO, CurrencyISO, MakeKeysRequired, SecureMode, Timestamp } from "./types"; +import { base } from "./base"; +import { Users } from "./services/Users"; +import { BankAccounts } from "./services/BankAccounts"; +import { BankingAliases } from "./services/BankingAliases"; +import { DisputeDocuments } from "./services/DisputeDocuments"; +import { Wallets } from "./services/Wallets"; +import { KycDocuments } from "./services/KycDocuments"; +import { UboDeclarations } from "./services/UboDeclarations"; +import { Cards } from "./services/Cards"; +import { CardRegistrations } from "./services/CardRegistrations"; +import { CardPreAuthorizations } from "./services/CardPreauthorizations"; +import { PayIns } from "./services/PayIns"; +import { Transfers } from "./services/Transfers"; +import { PayOuts } from "./services/PayOuts"; +import { Refunds } from "./services/Refunds"; +import { Clients } from "./services/Clients"; +import { Disputes } from "./services/Disputes"; +import { Repudiations } from "./services/Repudiations"; +import { Events } from "./services/Events"; +import { Responses } from "./services/Responses"; +import { Mandates } from "./services/Mandates"; +import { Hooks } from "./services/Hooks"; +import { Reports } from "./services/Reports"; +import { Idempotency } from "./services/Idempotency"; +import { address } from "./models/address"; +import { enums } from "./enums"; +import { bankingAlias } from "./models/bankingAlias"; +import { bankAccount } from "./models/bankAccount"; +import { transaction } from "./models/transaction"; +import { wallet } from "./models/wallet"; +import { disputeDocument } from "./models/disputeDocument"; +import { uboDeclaration } from "./models/uboDeclaration"; +import { kycDocument } from "./models/kycDocument"; +import { money } from "./models/money"; +import { conversionRate } from "./models/conversionRate"; +import { instantConversion } from "./models/instantConversion"; +import { cardRegistration } from "./models/cardRegistration"; +import { card } from "./models/card"; +import { cardPreAuthorization } from "./models/cardPreauthorization"; +import { entityBase } from "./models/entityBase"; +import { user } from "./models/user"; +import { payIn } from "./models/payIn"; +import { refund } from "./models/refund"; +import { repudiation } from "./models/repudiation"; +import { client } from "./models/client"; +import { dispute } from "./models/dispute"; +import { settlementTransfer } from "./models/settlementTransfer"; +import { transfer } from "./models/transfer"; +import { shippingAddress } from "./models/shippingAddress"; +import { payOut } from "./models/payOut"; +import { mandate } from "./models/mandate"; +import { hook } from "./models/hook"; +import { report } from "./models/report"; +import { billing } from "./models/billing"; +import { deposit } from "./models/deposit"; +import { birthplace } from "./models/birthplace"; +import { event } from "./models/event"; +import { idempotency } from "./models/idempotency"; +import { securityInfo } from "./models/securityInfo"; +import { shipping } from "./models/shipping"; +import { countryAuthorization } from "./models/countryAuthorization"; +import { Regulatory } from "./services/Regulatory"; +import { Deposits } from "./services/Deposits"; +import { cardValidation } from "./models/cardValidation"; +import { InstantConversions } from "./services/InstantConversions"; export = MangoPay; diff --git a/typings/mangopay2-nodejs-sdk-tests.ts b/typings/mangopay2-nodejs-sdk-tests.ts index 460afaf..7467686 100644 --- a/typings/mangopay2-nodejs-sdk-tests.ts +++ b/typings/mangopay2-nodejs-sdk-tests.ts @@ -626,7 +626,7 @@ api.PayIns.create({ PostalCode: "68400" } }, - MerchantOrderId: "1234" + Reference: "1234" }).then(data => { const d = data; // $ExpectType KlarnaWebPayInData }); @@ -674,6 +674,35 @@ api.PayIns.create({ const d = data; // $ExpectType BlikWebPayInData }); +api.PayIns.create({ + PaymentType: "IDEAL", + ExecutionType: "WEB", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + Fees: {Amount: 100, Currency: "GBP"}, + DebitedFunds: {Amount: 2000, Currency: "GBP"}, + ReturnURL: "http://test.com", + StatementDescriptor: "Ideal", + Bic: "RBRBNL21", + Tag: "test" +}).then(data => { + const d = data; // $ExpectType IdealWebPayInData +}); + +api.PayIns.create({ + PaymentType: "GIROPAY", + ExecutionType: "WEB", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + Fees: {Amount: 100, Currency: "GBP"}, + DebitedFunds: {Amount: 2000, Currency: "GBP"}, + ReturnURL: "http://test.com", + StatementDescriptor: "Giropay", + Tag: "test" +}).then(data => { + const d = data; // $ExpectType GiropayWebPayInData +}); + api.PayIns.create({ PaymentType: "CARD", ExecutionType: "WEB", @@ -719,6 +748,7 @@ api.PayIns.createPayPal({ ReturnURL: "http://test.com", Tag: "test tag", StatementDescriptor: "test", + Reference: "Reference", Culture: "FR" }).then(data => { const d = data; // $ExpectType PayPalWebPayInData @@ -1222,7 +1252,7 @@ api.Hooks.getAll().then(data => { /* Reports */ -api.Reports.create({Columns: ["Alias", "AuthorId"], ReportType: "WALLET"}).then(data => { +api.Reports.create({Columns: ["Alias", "AuthorId"], ReportType: "WALLETS"}).then(data => { const d = data; // $ExpectType ReportData }); diff --git a/typings/models/instantConversion.d.ts b/typings/models/instantConversion.d.ts index 83c75c6..57e504a 100644 --- a/typings/models/instantConversion.d.ts +++ b/typings/models/instantConversion.d.ts @@ -1,11 +1,14 @@ -import {entityBase, models, money, transaction} from "mangopay2-nodejs-sdk"; +import { entityBase } from "./entityBase"; +import { money } from "./money"; +import { transaction } from "./transaction"; +import { conversionRate } from "./conversionRate"; export namespace instantConversion { - import ConversionRate = models.ConversionRate; import TransactionStatus = transaction.TransactionStatus; import TransactionType = transaction.TransactionType; import TransactionNature = transaction.TransactionNature; import MoneyData = money.MoneyData; + import ConversionRateData = conversionRate.ConversionRateData; interface InstantConversionData extends entityBase.EntityBaseData { /** @@ -36,7 +39,7 @@ export namespace instantConversion { /** * Real time indicative market rate of a specific currency pair */ - ConversionRate: ConversionRate; + ConversionRate: ConversionRateData; /** * The status of the transaction. diff --git a/typings/models/payIn.d.ts b/typings/models/payIn.d.ts index 2e79dd9..22dafdb 100644 --- a/typings/models/payIn.d.ts +++ b/typings/models/payIn.d.ts @@ -33,7 +33,9 @@ export namespace payIn { | SatispayWebPayInData | BlikWebPayInData | GooglePayDirectPayInData - | KlarnaWebPayInData; + | KlarnaWebPayInData + | IdealWebPayInData + | GiropayWebPayInData; type PayInPaymentType = ValueOf; @@ -355,6 +357,8 @@ export namespace payIn { Culture: CountryISO; ShippingPreference: ShippingPreference; + + Reference: string; } interface MultibancoWebPayInData extends BasePayInData { @@ -581,6 +585,8 @@ export namespace payIn { Culture?: CountryISO; ShippingPreference?: ShippingPreference; + + Reference?: string; } interface CreateMultibancoWebPayIn { @@ -1653,7 +1659,7 @@ export namespace payIn { /** * The merchant order reference */ - MerchantOrderId: string; + Reference: string; /** * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric @@ -1726,7 +1732,7 @@ export namespace payIn { /** * The merchant order reference */ - MerchantOrderId: string; + Reference: string; /** * Custom data that you can add to this item @@ -1749,4 +1755,147 @@ export namespace payIn { */ StatementDescriptor?: string; } + + interface IdealWebPayInData extends BasePayInData { + ExecutionType: "WEB"; + + PaymentType: "IDEAL"; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + + /** + * This is the URL where users are automatically redirected after the payment is validated + */ + ReturnURL: string; + + /** + * Name of the end-user’s bank + */ + BankName: string; + + /** + * The BIC identifier of the end-user’s bank + */ + Bic: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + } + + interface CreateIdealWebPayIn { + ExecutionType: "WEB"; + + PaymentType: "IDEAL"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the debited funds + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet) + */ + Fees: MoneyData; + + /** + * This is the URL where users are automatically redirected after the payment is validated + */ + ReturnURL: string; + + /** + * The BIC identifier of the end-user’s bank + */ + Bic: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + + /** + * Custom data that you can add to this object + */ + Tag?: string; + } + + interface GiropayWebPayInData extends BasePayInData { + ExecutionType: "WEB"; + + PaymentType: "GIROPAY"; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + + /** + * This is the URL where users are automatically redirected after the payment is validated + */ + ReturnURL: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + } + + interface CreateGiropayWebPayIn { + ExecutionType: "WEB"; + + PaymentType: "GIROPAY"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the debited funds + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet) + */ + Fees: MoneyData; + + /** + * This is the URL where users are automatically redirected after the payment is validated + */ + ReturnURL: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + + /** + * Custom data that you can add to this object + */ + Tag?: string; + } } diff --git a/typings/models/report.d.ts b/typings/models/report.d.ts index 4a91a0c..e7d4d62 100644 --- a/typings/models/report.d.ts +++ b/typings/models/report.d.ts @@ -141,7 +141,7 @@ export namespace report { /** * The type of report */ - ReportType: "TRANSACTION" | "WALLET"; + ReportType: "TRANSACTIONS" | "WALLETS"; /** * The column to sort against and direction separated by a `:` diff --git a/typings/models/transaction.d.ts b/typings/models/transaction.d.ts index 41a08bb..eebfb8f 100644 --- a/typings/models/transaction.d.ts +++ b/typings/models/transaction.d.ts @@ -1,6 +1,6 @@ -import {Timestamp} from "../types"; -import {entityBase} from "./entityBase"; -import {money} from "./money"; +import { Timestamp } from "../types"; +import { entityBase } from "./entityBase"; +import { money } from "./money"; export namespace transaction { import MoneyData = money.MoneyData; diff --git a/typings/services/InstantConversions.d.ts b/typings/services/InstantConversions.d.ts index 63d30ff..f2008d3 100644 --- a/typings/services/InstantConversions.d.ts +++ b/typings/services/InstantConversions.d.ts @@ -1,6 +1,6 @@ -import {base} from "mangopay2-nodejs-sdk"; -import {conversionRate} from "../models/conversionRate"; -import {instantConversion} from "../models/instantConversion"; +import { base } from "../base"; +import { conversionRate } from "../models/conversionRate"; +import { instantConversion } from "../models/instantConversion"; import MethodOverload = base.MethodOverload; import TwoArgsMethodOverload = base.TwoArgsMethodOverload; diff --git a/typings/services/PayIns.d.ts b/typings/services/PayIns.d.ts index 3ec1d81..633f128 100644 --- a/typings/services/PayIns.d.ts +++ b/typings/services/PayIns.d.ts @@ -23,7 +23,9 @@ export class PayIns { MethodOverload & MethodOverload & MethodOverload & - MethodOverload; + MethodOverload & + MethodOverload & + MethodOverload; /** * Get pay-in diff --git a/typings/types.d.ts b/typings/types.d.ts index c4ecf20..c12d349 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -127,8 +127,8 @@ export type ApiMethod = | "disputes_repudiation_create_settlement" | "disputes_repudiation_get_settlement" | "disputes_pending_settlement" - | "reports_transaction_create" - | "reports_wallet_create" + | "reports_transactions_create" + | "reports_wallets_create" | "reports_get" | "reports_all" | "mandates_directdebit-web_create" @@ -165,7 +165,9 @@ export type ApiMethod = | "payins_satispay-web_create" | "payins_blik-web_create" | "payins_googlepay-direct_create_v2" - | "payins_klarna-web_create"; + | "payins_klarna-web_create" + | "payins_ideal-web_create" + | "payins_giropay-web_create"; export type CountryISO = | "AD"