diff --git a/MangoPay.SDK.Tests/ApiPayInsTest.cs b/MangoPay.SDK.Tests/ApiPayInsTest.cs index ae1709e..8d0d8cc 100644 --- a/MangoPay.SDK.Tests/ApiPayInsTest.cs +++ b/MangoPay.SDK.Tests/ApiPayInsTest.cs @@ -452,6 +452,26 @@ public async Task Test_PayIns_Create_GiropayWeb() Assert.Fail(ex.Message); } } + + [Test] + public async Task Test_PayIns_Create_Legacy_IdealWeb() + { + var john = await GetJohn(); + + var wallet = await CreateJohnsWallet(); + PayInCardWebDTO payIn = await CreateLegacyIdealPayInCardWeb(wallet.Id); + + Assert.IsNotNull(payIn.BankName); + Assert.IsTrue(payIn.Id.Length > 0); + Assert.AreEqual(PayInPaymentType.CARD, payIn.PaymentType); + Assert.AreEqual(PayInExecutionType.WEB, payIn.ExecutionType); + Assert.IsTrue(payIn.DebitedFunds is Money); + Assert.IsTrue(payIn.CreditedFunds is Money); + Assert.IsTrue(payIn.Fees is Money); + Assert.AreEqual(TransactionStatus.CREATED, payIn.Status); + Assert.AreEqual(TransactionType.PAYIN, payIn.Type); + Assert.AreEqual(TransactionNature.REGULAR, payIn.Nature); + } [Test] public async Task Test_Payins_CardDirect_Create_WithBilling() diff --git a/MangoPay.SDK.Tests/BaseTest.cs b/MangoPay.SDK.Tests/BaseTest.cs index ea902b4..0c721aa 100644 --- a/MangoPay.SDK.Tests/BaseTest.cs +++ b/MangoPay.SDK.Tests/BaseTest.cs @@ -435,6 +435,25 @@ protected async Task GetNewPayInGiropayWeb() PayInGiropayWebPostDTO payIn = await GetPayInGiropayWebPost(); return await this.Api.PayIns.CreateGiropayWebAsync(payIn); } + + protected async Task CreateLegacyIdealPayInCardWeb(string walletId) + { + var user = await this.GetJohn(); + + var payIn = new PayInCardWebPostDTO( + user.Id, + new Money { Amount = 1000, Currency = CurrencyIso.EUR }, + new Money { Amount = 0, Currency = CurrencyIso.EUR }, + walletId, + "https://test.com", + CultureCode.FR, + CardType.IDEAL, + bic: "REVOLT21" + ); + + return await this.Api.PayIns.CreateCardWebAsync(payIn); + } + /// Creates PayIn Card Direct object. /// User identifier. diff --git a/MangoPay.SDK/Entities/GET/PayInCardWebDTO.cs b/MangoPay.SDK/Entities/GET/PayInCardWebDTO.cs index c970298..a374dcf 100644 --- a/MangoPay.SDK/Entities/GET/PayInCardWebDTO.cs +++ b/MangoPay.SDK/Entities/GET/PayInCardWebDTO.cs @@ -33,5 +33,8 @@ public class PayInCardWebDTO : PayInDTO public string StatementDescriptor { get; set; } public Shipping Shipping { get; set; } + + /// Name of the end-user’s bank + public string BankName { get; set; } } } diff --git a/MangoPay.SDK/Entities/POST/PayInCardWebPostDTO.cs b/MangoPay.SDK/Entities/POST/PayInCardWebPostDTO.cs index d0dae94..a4fd6c6 100644 --- a/MangoPay.SDK/Entities/POST/PayInCardWebPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/PayInCardWebPostDTO.cs @@ -9,7 +9,7 @@ namespace MangoPay.SDK.Entities.POST /// PayIn card web POST entity. public class PayInCardWebPostDTO : EntityPostBase { - public PayInCardWebPostDTO(string authorId, Money debitedFunds, Money fees, string creditedWalletId, string returnUrl, CultureCode culture, CardType cardType, string statementDescriptor = null) + public PayInCardWebPostDTO(string authorId, Money debitedFunds, Money fees, string creditedWalletId, string returnUrl, CultureCode culture, CardType cardType, string statementDescriptor = null, string bic = null) { AuthorId = authorId; DebitedFunds = debitedFunds; @@ -19,6 +19,7 @@ public PayInCardWebPostDTO(string authorId, Money debitedFunds, Money fees, stri Culture = culture; CardType = cardType; StatementDescriptor = statementDescriptor; + Bic = bic; } /// Author identifier. @@ -58,5 +59,8 @@ public PayInCardWebPostDTO(string authorId, Money debitedFunds, Money fees, stri public string StatementDescriptor { get; set; } public Shipping Shipping { get; set; } + + /// The BIC identifier of the end-user’s bank + public string Bic { get; set; } } }