From f9ee39e147c00452db8a4161f51d8854b8353d9d Mon Sep 17 00:00:00 2001 From: Mihai Moiseanu Date: Thu, 22 Feb 2024 12:57:01 +0200 Subject: [PATCH] Add fees param to instant conversion --- MangoPay.SDK.Tests/ApiInstantConversionTest.cs | 5 ++++- MangoPay.SDK/Entities/GET/InstantConversionDTO.cs | 5 +++++ MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/MangoPay.SDK.Tests/ApiInstantConversionTest.cs b/MangoPay.SDK.Tests/ApiInstantConversionTest.cs index 8c81ea86..3c8e149f 100644 --- a/MangoPay.SDK.Tests/ApiInstantConversionTest.cs +++ b/MangoPay.SDK.Tests/ApiInstantConversionTest.cs @@ -29,6 +29,7 @@ public async Task Test_CreateInstantConversion() Assert.IsNotNull(createdInstantConversion); Assert.IsNotNull(createdInstantConversion.CreditedFunds.Amount); Assert.IsNotNull(createdInstantConversion.DebitedFunds.Amount); + Assert.IsNotNull(createdInstantConversion.Fees); Assert.AreEqual(createdInstantConversion.Status, TransactionStatus.SUCCEEDED); Assert.AreEqual(createdInstantConversion.Type, TransactionType.CONVERSION); } @@ -42,6 +43,7 @@ public async Task Test_GetInstantConversion() Assert.IsNotNull(returnedInstantConversion); Assert.IsNotNull(returnedInstantConversion.CreditedFunds.Amount); Assert.IsNotNull(returnedInstantConversion.DebitedFunds.Amount); + Assert.IsNotNull(returnedInstantConversion.Fees); Assert.AreEqual(returnedInstantConversion.Status, TransactionStatus.SUCCEEDED); Assert.AreEqual(returnedInstantConversion.Type, TransactionType.CONVERSION); } @@ -59,8 +61,9 @@ private async Task CreateInstantConversion() john.Id, debitedWallet.Id, creditedWallet.Id, - new Money { Amount = 79, Currency = CurrencyIso.EUR }, + new Money { Amount = 30, Currency = CurrencyIso.EUR }, new Money { Currency = CurrencyIso.GBP }, + new Money { Amount = 9, Currency = CurrencyIso.EUR}, "create instant conversion" ); diff --git a/MangoPay.SDK/Entities/GET/InstantConversionDTO.cs b/MangoPay.SDK/Entities/GET/InstantConversionDTO.cs index 72f7d48b..cd492fa3 100644 --- a/MangoPay.SDK/Entities/GET/InstantConversionDTO.cs +++ b/MangoPay.SDK/Entities/GET/InstantConversionDTO.cs @@ -50,5 +50,10 @@ public class InstantConversionDTO: EntityBase /// The statuses CREATED and FAILED return an ExecutionDate of null [JsonConverter(typeof(Core.UnixDateTimeConverter))] public DateTime ExecutionDate { get; set; } + + + /// Information about the fees taken by the platform for + /// this transaction (and hence transferred to the Fees Wallet). + public Money Fees { get; set; } } } \ No newline at end of file diff --git a/MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs b/MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs index 5dccc47a..6ddfb973 100644 --- a/MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs +++ b/MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs @@ -4,7 +4,7 @@ public class InstantConversionPostDTO: EntityPostBase { public InstantConversionPostDTO(string authorId, string debitedWalletId, string creditedWalletId, - Money debitedFunds, Money creditedFunds, + Money debitedFunds, Money creditedFunds, Money fees, string tag = null) { AuthorId = authorId; @@ -12,6 +12,7 @@ public InstantConversionPostDTO(string authorId, string debitedWalletId, string CreditedWalletId = creditedWalletId; DebitedFunds = debitedFunds; CreditedFunds = creditedFunds; + Fees = fees; Tag = tag; } @@ -29,5 +30,9 @@ public InstantConversionPostDTO(string authorId, string debitedWalletId, string /// The buy funds public Money CreditedFunds { get; set; } + + /// Information about the fees taken by the platform for + /// this transaction (and hence transferred to the Fees Wallet). + public Money Fees { get; set; } } } \ No newline at end of file