Skip to content

Commit

Permalink
Add changes requested by reviewers
Browse files Browse the repository at this point in the history
- Fix threeDSInfo field name
- Remove Builder annotation in PaymentThreeDSInfo
- Change PaymentFeeRequest type to percentage
  • Loading branch information
romerosilva-meli committed Feb 27, 2023
1 parent 0d410eb commit f183582
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/mercadopago/resources/payment/Payment.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mercadopago.resources.payment;

import com.google.gson.annotations.SerializedName;
import com.mercadopago.net.MPResource;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
Expand Down Expand Up @@ -190,7 +191,8 @@ public class Payment extends MPResource {
private PaymentMethod paymentMethod;

/** 3DS Info. */
private PaymentThreeDSInfo threeDsinfo;
@SerializedName("three_dsinfo")
private PaymentThreeDSInfo threeDSInfo;

/**
* Internal data that can be attached to the payment to record additional attributes of the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.mercadopago.resources.payment;

import lombok.Builder;
import lombok.Getter;

/** 3DS Info. */
@Getter
@Builder
public class PaymentThreeDSInfo {
/** External Resource Url. */
private final String externalResourceUrl;
private String externalResourceUrl;

/** creq. */
private final String creq;
private String creq;
}
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ private PaymentCreateRequest newPayment(String paymentStatus) throws MPException
.build();

PaymentFeeRequest fine =
PaymentFeeRequest.builder().type("fixed").value(new BigDecimal(2)).build();
PaymentFeeRequest.builder().type("percentage").value(new BigDecimal(2)).build();

PaymentFeeRequest interest =
PaymentFeeRequest.builder().type("fixed").value(new BigDecimal("0.03")).build();
PaymentFeeRequest.builder().type("percentage").value(new BigDecimal("0.03")).build();

PaymentDiscountRequest discount =
PaymentDiscountRequest.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public void createWithThreeDSecureSuccess() throws MPException, IOException, MPA
assertNotNull(payment.getResponse());
assertEquals(CREATED, payment.getResponse().getStatusCode());
assertEquals(
payment.getThreeDsinfo().getCreq(),
payment.getThreeDSInfo().getCreq(),
"eyJ0aHJlZURTU2VydmVyVHJhbnNJRCI6ImE4NDQ1NTE2LThjNzktNGQ1NC04MjRmLTU5YzgzNDRiY2FjNCIsImFj");
assertEquals(
payment.getThreeDsinfo().getExternalResourceUrl(),
payment.getThreeDSInfo().getExternalResourceUrl(),
"https://acs-public.tp.mastercard.com/api/v1/browser_challenges");
}

Expand Down

0 comments on commit f183582

Please sign in to comment.