Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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. */
Expand Down Expand Up @@ -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<String, Object> 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. */
Expand Down Expand Up @@ -118,4 +128,10 @@ public class PaymentCreateRequest {

/** 3DS. */
private final String threeDSecureMode;

/** Amounts. */
private final PaymentAmountsRequest amounts;

/** Counter currency. */
private final PaymentCounterCurrencyRequest counterCurrency;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<String, Object> metadata;

Expand Down Expand Up @@ -90,4 +93,10 @@ public class PreferenceRequest {

/** Tracks to be executed during the users interaction in the Checkout flow. */
private final List<PreferenceTrackRequest> tracks;

/** Amounts. */
private final PreferenceAmountsRequest amounts;

/** Counter currency. */
private final PreferenceCounterCurrencyRequest counterCurrency;
}
Original file line number Diff line number Diff line change
@@ -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;
}
24 changes: 18 additions & 6 deletions src/main/java/com/mercadopago/resources/payment/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> 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;
Expand Down Expand Up @@ -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;
Expand All @@ -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). */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, Object> internalMetadata;

/** Expanded information returned when using X-Expand-Response-Nodes header. */
private PaymentExpanded expanded;

/** Amounts. */
private PaymentAmounts amounts;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
15 changes: 12 additions & 3 deletions src/main/java/com/mercadopago/resources/preference/Preference.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -80,7 +81,8 @@ public class Preference extends MPResource {
private List<String> 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;
Expand All @@ -92,7 +94,8 @@ public class Preference extends MPResource {
private List<PreferenceTrack> 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<String, Object> metadata;

Expand All @@ -104,4 +107,10 @@ public class Preference extends MPResource {

/** Date of creation. */
private OffsetDateTime dateCreated;

/** Amounts. */
private PreferenceAmounts amounts;

/** Counter currency. */
private PreferenceCounterCurrency counterCurrency;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
Loading