Skip to content

Commit

Permalink
Merge pull request #214 from Mangopay/feature/add_fees_param
Browse files Browse the repository at this point in the history
Add fees param to instant conversion
  • Loading branch information
mihaimoiseanu authored Mar 7, 2024
2 parents 988b7d6 + f9ee39e commit ec2f176
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions MangoPay.SDK.Tests/ApiInstantConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -61,6 +63,7 @@ private async Task<InstantConversionDTO> CreateInstantConversion()
creditedWallet.Id,
new Money { Amount = 30, Currency = CurrencyIso.EUR },
new Money { Currency = CurrencyIso.GBP },
new Money { Amount = 9, Currency = CurrencyIso.EUR},
"create instant conversion"
);

Expand Down
5 changes: 5 additions & 0 deletions MangoPay.SDK/Entities/GET/InstantConversionDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ public class InstantConversionDTO: EntityBase
/// The statuses CREATED and FAILED return an ExecutionDate of null</summary>
[JsonConverter(typeof(Core.UnixDateTimeConverter))]
public DateTime ExecutionDate { get; set; }


/// <summary>Information about the fees taken by the platform for
/// this transaction (and hence transferred to the Fees Wallet).</summary>
public Money Fees { get; set; }
}
}
7 changes: 6 additions & 1 deletion MangoPay.SDK/Entities/POST/InstantConversionPostDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ 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;
DebitedWalletId = debitedWalletId;
CreditedWalletId = creditedWalletId;
DebitedFunds = debitedFunds;
CreditedFunds = creditedFunds;
Fees = fees;
Tag = tag;
}

Expand All @@ -29,5 +30,9 @@ public InstantConversionPostDTO(string authorId, string debitedWalletId, string

/// <summary>The buy funds</summary>
public Money CreditedFunds { get; set; }

/// <summary>Information about the fees taken by the platform for
/// this transaction (and hence transferred to the Fees Wallet).</summary>
public Money Fees { get; set; }
}
}

0 comments on commit ec2f176

Please sign in to comment.