diff --git a/src/main/java/com/mercadopago/client/payment/PaymentAmountsRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentAmountsRequest.java new file mode 100644 index 00000000..458aa7e9 --- /dev/null +++ b/src/main/java/com/mercadopago/client/payment/PaymentAmountsRequest.java @@ -0,0 +1,15 @@ +package com.mercadopago.client.payment; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PaymentAmountsRequest { + + /** Payer amount. */ + private PaymentUserAmountRequest payer; + + /** Collector amount. */ + private PaymentUserAmountRequest collector; +} diff --git a/src/main/java/com/mercadopago/client/payment/PaymentCounterCurrencyRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentCounterCurrencyRequest.java new file mode 100644 index 00000000..76017ab3 --- /dev/null +++ b/src/main/java/com/mercadopago/client/payment/PaymentCounterCurrencyRequest.java @@ -0,0 +1,11 @@ +package com.mercadopago.client.payment; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PaymentCounterCurrencyRequest { + /** Currency ID. ISO_4217 code. */ + private String currencyId; +} diff --git a/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java index ec2cfd79..9353ceca 100644 --- a/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java +++ b/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java @@ -12,7 +12,8 @@ @Builder public class PaymentCreateRequest { /** - * Data that could improve fraud analysis and conversion rates. Try to send as much information as + * Data that could improve fraud analysis and conversion rates. Try to send as + * much information as * possible. */ private final PaymentAdditionalInfoRequest additionalInfo; @@ -21,7 +22,8 @@ public class PaymentCreateRequest { private final BigDecimal applicationFee; /** - * When set to true, the payment can only be approved or rejected. Otherwise in_process status is + * When set to true, the payment can only be approved or rejected. Otherwise + * in_process status is * added. */ private final Boolean binaryMode; @@ -32,7 +34,9 @@ public class PaymentCreateRequest { /** Discount campaign ID. */ private final Long campaignId; - /** Determines if the payment should be captured (true) or just reserved (false). */ + /** + * Determines if the payment should be captured (true) or just reserved (false). + */ private final Boolean capture; /** Amount of the coupon discount. */ @@ -65,13 +69,19 @@ public class PaymentCreateRequest { /** Merchant services. */ private final PaymentMerchantServicesRequest merchantServices; - /** Data that can be attached to the payment to record additional attributes of the merchant. */ + /** + * Data that can be attached to the payment to record additional attributes of + * the merchant. + */ private final Map metadata; /** Net amount. */ private final BigDecimal netAmount; - /** URL where mercadopago will send notifications associated to changes in this payment. */ + /** + * URL where mercadopago will send notifications associated to changes in this + * payment. + */ private final String notificationUrl; /** Order identifier. */ @@ -118,4 +128,10 @@ public class PaymentCreateRequest { /** 3DS. */ private final String threeDSecureMode; + + /** Amounts. */ + private final PaymentAmountsRequest amounts; + + /** Counter currency. */ + private final PaymentCounterCurrencyRequest counterCurrency; } diff --git a/src/main/java/com/mercadopago/client/payment/PaymentUserAmountRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentUserAmountRequest.java new file mode 100644 index 00000000..f6011515 --- /dev/null +++ b/src/main/java/com/mercadopago/client/payment/PaymentUserAmountRequest.java @@ -0,0 +1,16 @@ +package com.mercadopago.client.payment; + +import java.math.BigDecimal; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PaymentUserAmountRequest { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + + /** Transaction amount. */ + private BigDecimal transaction; +} diff --git a/src/main/java/com/mercadopago/client/preference/PreferenceAmountsRequest.java b/src/main/java/com/mercadopago/client/preference/PreferenceAmountsRequest.java new file mode 100644 index 00000000..3335634a --- /dev/null +++ b/src/main/java/com/mercadopago/client/preference/PreferenceAmountsRequest.java @@ -0,0 +1,17 @@ +package com.mercadopago.client.preference; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PreferenceAmountsRequest { + /** Counter currency. */ + private PreferenceCounterCurrencyRequest counterCurrency; + + /** Payer amount. */ + private PreferenceUserAmountRequest payer; + + /** Collector amount. */ + private PreferenceUserAmountRequest collector; +} \ No newline at end of file diff --git a/src/main/java/com/mercadopago/client/preference/PreferenceCounterCurrencyRequest.java b/src/main/java/com/mercadopago/client/preference/PreferenceCounterCurrencyRequest.java new file mode 100644 index 00000000..6503c049 --- /dev/null +++ b/src/main/java/com/mercadopago/client/preference/PreferenceCounterCurrencyRequest.java @@ -0,0 +1,11 @@ +package com.mercadopago.client.preference; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PreferenceCounterCurrencyRequest { + /** Currency ID. ISO_4217 code. */ + private String currencyId; +} diff --git a/src/main/java/com/mercadopago/client/preference/PreferenceRequest.java b/src/main/java/com/mercadopago/client/preference/PreferenceRequest.java index 7772b68f..5d17d6d0 100644 --- a/src/main/java/com/mercadopago/client/preference/PreferenceRequest.java +++ b/src/main/java/com/mercadopago/client/preference/PreferenceRequest.java @@ -15,7 +15,8 @@ public class PreferenceRequest { private final String additionalInfo; /** - * If specified, your buyers will be redirected back to your site immediately after completing the + * If specified, your buyers will be redirected back to your site immediately + * after completing the * purchase. */ private final String autoReturn; @@ -24,7 +25,8 @@ public class PreferenceRequest { private final PreferenceBackUrlsRequest backUrls; /** - * When set to true, the payment can only be approved or rejected. Otherwise in_process status is + * When set to true, the payment can only be approved or rejected. Otherwise + * in_process status is * added. */ private final Boolean binaryMode; @@ -57,7 +59,8 @@ public class PreferenceRequest { private final BigDecimal marketplaceFee; /** - * Data that can be attached to the preference to record additional attributes of the merchant. + * Data that can be attached to the preference to record additional attributes + * of the merchant. */ private final Map metadata; @@ -90,4 +93,10 @@ public class PreferenceRequest { /** Tracks to be executed during the users interaction in the Checkout flow. */ private final List tracks; + + /** Amounts. */ + private final PreferenceAmountsRequest amounts; + + /** Counter currency. */ + private final PreferenceCounterCurrencyRequest counterCurrency; } diff --git a/src/main/java/com/mercadopago/client/preference/PreferenceUserAmountRequest.java b/src/main/java/com/mercadopago/client/preference/PreferenceUserAmountRequest.java new file mode 100644 index 00000000..080e5b46 --- /dev/null +++ b/src/main/java/com/mercadopago/client/preference/PreferenceUserAmountRequest.java @@ -0,0 +1,15 @@ +package com.mercadopago.client.preference; + +import java.math.BigDecimal; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class PreferenceUserAmountRequest { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + /** Transaction amount. */ + private BigDecimal transaction; +} diff --git a/src/main/java/com/mercadopago/resources/payment/Payment.java b/src/main/java/com/mercadopago/resources/payment/Payment.java index 85e4b75d..66ec4935 100644 --- a/src/main/java/com/mercadopago/resources/payment/Payment.java +++ b/src/main/java/com/mercadopago/resources/payment/Payment.java @@ -82,11 +82,15 @@ public class Payment extends MPResource { /** Payer information. */ private PaymentPayer payer; - /** Data that can be attached to the payment to record additional attributes of the merchant. */ + /** + * Data that can be attached to the payment to record additional attributes of + * the merchant. + */ private Map metadata; /** - * Data that could improve fraud analysis and conversion rates. Try to send as much information as + * Data that could improve fraud analysis and conversion rates. Try to send as + * much information as * possible. */ private PaymentAdditionalInfo additionalInfo; @@ -122,7 +126,8 @@ public class Payment extends MPResource { private boolean captured; /** - * When set to true, the payment can only be approved or rejected. Otherwise in_process status is + * When set to true, the payment can only be approved or rejected. Otherwise + * in_process status is * added. */ private boolean binaryMode; @@ -136,7 +141,10 @@ public class Payment extends MPResource { /** Card used to pay. */ private PaymentCard card; - /** URL where mercadopago will send notifications associated to changes in this payment. */ + /** + * URL where mercadopago will send notifications associated to changes in this + * payment. + */ private String notificationUrl; /** URL where mercadopago does the final redirect (only for bank transfers). */ @@ -167,7 +175,7 @@ public class Payment extends MPResource { private BigDecimal taxesAmount; /** Counter currency. */ - private String counterCurrency; + private PaymentCounterCurrency counterCurrency; /** Shipping amount. */ private BigDecimal shippingAmount; @@ -195,11 +203,15 @@ public class Payment extends MPResource { private PaymentThreeDSInfo threeDSInfo; /** - * Internal data that can be attached to the payment to record additional attributes of the + * Internal data that can be attached to the payment to record additional + * attributes of the * merchant. */ private Map internalMetadata; /** Expanded information returned when using X-Expand-Response-Nodes header. */ private PaymentExpanded expanded; + + /** Amounts. */ + private PaymentAmounts amounts; } diff --git a/src/main/java/com/mercadopago/resources/payment/PaymentAmounts.java b/src/main/java/com/mercadopago/resources/payment/PaymentAmounts.java new file mode 100644 index 00000000..2b7b9a28 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/payment/PaymentAmounts.java @@ -0,0 +1,12 @@ +package com.mercadopago.resources.payment; + +import lombok.Getter; + +@Getter +public class PaymentAmounts { + /** Payer amount. */ + private PaymentUsersAmountPayer payer; + + /** Collector amount. */ + private PaymentUsersAmountCollector collector; +} diff --git a/src/main/java/com/mercadopago/resources/payment/PaymentCounterCurrency.java b/src/main/java/com/mercadopago/resources/payment/PaymentCounterCurrency.java new file mode 100644 index 00000000..d0210165 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/payment/PaymentCounterCurrency.java @@ -0,0 +1,14 @@ +package com.mercadopago.resources.payment; + +import java.math.BigDecimal; + +import lombok.Getter; + +@Getter +public class PaymentCounterCurrency { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + private BigDecimal rate; + private BigDecimal amount; + private BigDecimal amountRefunded; +} diff --git a/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountCollector.java b/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountCollector.java new file mode 100644 index 00000000..9624f07d --- /dev/null +++ b/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountCollector.java @@ -0,0 +1,17 @@ +package com.mercadopago.resources.payment; + +import java.math.BigDecimal; + +import lombok.Getter; + +@Getter +public class PaymentUsersAmountCollector { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + + /** Transaction amount. */ + private BigDecimal transaction; + + /** Net received amount. */ + private BigDecimal netReceived; +} diff --git a/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountPayer.java b/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountPayer.java new file mode 100644 index 00000000..8677c0e8 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/payment/PaymentUsersAmountPayer.java @@ -0,0 +1,17 @@ +package com.mercadopago.resources.payment; + +import java.math.BigDecimal; + +import lombok.Getter; + +@Getter +public class PaymentUsersAmountPayer { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + + /** Transaction amount. */ + private BigDecimal transaction; + + /** Total paid amount. */ + private BigDecimal totalPaid; +} diff --git a/src/main/java/com/mercadopago/resources/preference/Preference.java b/src/main/java/com/mercadopago/resources/preference/Preference.java index 6eb43408..37ef4a08 100644 --- a/src/main/java/com/mercadopago/resources/preference/Preference.java +++ b/src/main/java/com/mercadopago/resources/preference/Preference.java @@ -65,7 +65,8 @@ public class Preference extends MPResource { private String additionalInfo; /** - * If specified, your buyers will be redirected back to your site immediately after completing the + * If specified, your buyers will be redirected back to your site immediately + * after completing the * purchase. */ private String autoReturn; @@ -80,7 +81,8 @@ public class Preference extends MPResource { private List processingModes; /** - * When set to true, the payment can only be approved or rejected. Otherwise in_process status is + * When set to true, the payment can only be approved or rejected. Otherwise + * in_process status is * added. */ private Boolean binaryMode; @@ -92,7 +94,8 @@ public class Preference extends MPResource { private List tracks; /** - * Data that can be attached to the preference to record additional attributes of the merchant. + * Data that can be attached to the preference to record additional attributes + * of the merchant. */ private Map metadata; @@ -104,4 +107,10 @@ public class Preference extends MPResource { /** Date of creation. */ private OffsetDateTime dateCreated; + + /** Amounts. */ + private PreferenceAmounts amounts; + + /** Counter currency. */ + private PreferenceCounterCurrency counterCurrency; } diff --git a/src/main/java/com/mercadopago/resources/preference/PreferenceAmounts.java b/src/main/java/com/mercadopago/resources/preference/PreferenceAmounts.java new file mode 100644 index 00000000..dddb70e0 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/preference/PreferenceAmounts.java @@ -0,0 +1,12 @@ +package com.mercadopago.resources.preference; + +import lombok.Getter; + +@Getter +public class PreferenceAmounts { + /** Payer amount. */ + private PreferenceUserAmount payer; + + /** Collector amount. */ + private PreferenceUserAmount collector; +} diff --git a/src/main/java/com/mercadopago/resources/preference/PreferenceCounterCurrency.java b/src/main/java/com/mercadopago/resources/preference/PreferenceCounterCurrency.java new file mode 100644 index 00000000..239610b1 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/preference/PreferenceCounterCurrency.java @@ -0,0 +1,10 @@ +package com.mercadopago.resources.preference; + +import lombok.Getter; + +/** Counter currency. */ +@Getter +public class PreferenceCounterCurrency { + /** Currency ID. ISO_4217 code. */ + private String currencyId; +} diff --git a/src/main/java/com/mercadopago/resources/preference/PreferenceUserAmount.java b/src/main/java/com/mercadopago/resources/preference/PreferenceUserAmount.java new file mode 100644 index 00000000..bafe52e7 --- /dev/null +++ b/src/main/java/com/mercadopago/resources/preference/PreferenceUserAmount.java @@ -0,0 +1,14 @@ +package com.mercadopago.resources.preference; + +import java.math.BigDecimal; + +import lombok.Getter; + +@Getter +public class PreferenceUserAmount { + /** Currency ID. ISO_4217 code. */ + private String currencyId; + + /** Transaction amount. */ + private BigDecimal transaction; +}