Skip to content

Commit

Permalink
Merge branch 'feature/conversions' into feature/conversions_quote
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/com/mangopay/core/APIs/ApiBase.java
  • Loading branch information
mihaimoiseanu committed Mar 7, 2024
2 parents c5a17fa + 45ff6c0 commit f3b0fc1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/mangopay/core/APIs/ApiBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ protected MangoPayApi getRoot() {
put("deposits_get", new String[]{"/deposit-preauthorizations/%s", RequestType.GET.toString()});
put("deposits_cancel", new String[]{"/deposit-preauthorizations/%s", RequestType.PUT.toString()});

put("get_conversion_rate", new String[]{"/conversion/rate/%s/%s", RequestType.GET.toString()});
put("create_instant_conversion", new String[]{"/instant-conversion", RequestType.POST.toString()});
put("get_instant_conversion", new String[]{"/instant-conversion/%s", RequestType.GET.toString()});
put("get_conversion_rate", new String[]{"/conversions/rate/%s/%s", RequestType.GET.toString()});
put("create_instant_conversion", new String[]{"/conversions/instant-conversion", RequestType.POST.toString()});
put("get_instant_conversion", new String[]{"/conversions/%s", RequestType.GET.toString()});
put("create_conversion_quote", new String[]{"/conversions/quote", RequestType.POST.toString()});
put("get_conversion_quote", new String[]{"/conversions/quote/%s", RequestType.GET.toString()});

Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/mangopay/entities/InstantConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public class InstantConversion extends EntityBase {
@SerializedName("ExecutionDate")
public Long executionDate;

/**
* Information about the fees taken by the platform for
* this transaction (and hence transferred to the Fees Wallet).
*/
@SerializedName("Fees")
public Money fees;

public String getAuthorId() {
return authorId;
}
Expand Down Expand Up @@ -184,6 +191,14 @@ public void setExecutionDate(Long executionDate) {
this.executionDate = executionDate;
}

public Money getFees() {
return fees;
}

public void setFees(Money fees) {
this.fees = fees;
}

@Override
public ArrayList<String> getReadOnlyProperties() {
ArrayList<String> result = super.getReadOnlyProperties();
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/com/mangopay/core/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1629,8 +1629,13 @@ protected InstantConversion createInstantConversion() throws Exception {
debitedFunds.setCurrency(CurrencyIso.EUR);
debitedFunds.setAmount(79);

Money fees = new Money();
fees.setCurrency(CurrencyIso.EUR);
fees.setAmount(9);

instantConversion.setCreditedFunds(creditedFunds);
instantConversion.setDebitedFunds(debitedFunds);
instantConversion.setFees(fees);
instantConversion.setTag("create instant conversion");

return this.api.getConversionsApi().createInstantConversion(instantConversion, null);
Expand Down

0 comments on commit f3b0fc1

Please sign in to comment.