diff --git a/README.md b/README.md index e5ce8ee6..8b4a2adc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ already. com.mercadopago sdk-java - 2.1.0 + 2.1.1 ``` diff --git a/pom.xml b/pom.xml index 84d9f448..16c79bc4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.mercadopago sdk-java - 2.1.0 + 2.1.1 jar Mercadopago SDK diff --git a/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java index 234ad454..ee4fb325 100644 --- a/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java +++ b/src/main/java/com/mercadopago/client/payment/PaymentCreateRequest.java @@ -97,6 +97,9 @@ public class PaymentCreateRequest { /** Transaction details. */ private final PaymentTransactionDetailsRequest transactionDetails; + /** Point of interaction. */ + private final PaymentPointOfInteractionRequest pointOfInteraction; + /** Sponsor Identification. */ private final Long sponsorId; diff --git a/src/main/java/com/mercadopago/client/payment/PaymentPointOfInteractionRequest.java b/src/main/java/com/mercadopago/client/payment/PaymentPointOfInteractionRequest.java new file mode 100644 index 00000000..454c3869 --- /dev/null +++ b/src/main/java/com/mercadopago/client/payment/PaymentPointOfInteractionRequest.java @@ -0,0 +1,12 @@ +package com.mercadopago.client.payment; + +import lombok.Builder; +import lombok.Getter; + +/** PaymentPointOfInteractionRequest class. */ +@Getter +@Builder +public class PaymentPointOfInteractionRequest { + /** Linked to information. */ + private final String linkedTo; +} diff --git a/src/main/java/com/mercadopago/resources/payment/PaymentPointOfInteraction.java b/src/main/java/com/mercadopago/resources/payment/PaymentPointOfInteraction.java index dcf5abe5..ba5f1669 100644 --- a/src/main/java/com/mercadopago/resources/payment/PaymentPointOfInteraction.java +++ b/src/main/java/com/mercadopago/resources/payment/PaymentPointOfInteraction.java @@ -11,6 +11,9 @@ public class PaymentPointOfInteraction { /** Sub type. */ private String subType; + /** Linked to information. */ + private String linkedTo; + /** Application data. */ private PaymentApplicationData applicationData; diff --git a/src/test/java/com/mercadopago/client/payment/PaymentClientTest.java b/src/test/java/com/mercadopago/client/payment/PaymentClientTest.java index 318fca22..5793da15 100644 --- a/src/test/java/com/mercadopago/client/payment/PaymentClientTest.java +++ b/src/test/java/com/mercadopago/client/payment/PaymentClientTest.java @@ -116,6 +116,7 @@ public void createPixSuccess() throws MPException, IOException, MPApiException { assertEquals( "https://www.mercadopago.com.br/payments/21071815560/ticket?caller_id=471763966&hash=abcd1234efgh5678", payment.getPointOfInteraction().getTransactionData().getTicketUrl()); + assertEquals("openfinance", payment.getPointOfInteraction().getLinkedTo()); assertNotNull(payment.getPointOfInteraction().getTransactionData().getQrCode()); assertNotNull(payment.getPointOfInteraction().getTransactionData().getQrCodeBase64()); } @@ -136,6 +137,7 @@ public void createPixWithRequestOptionsSuccess() throws MPException, IOException assertEquals( "https://www.mercadopago.com.br/payments/21071815560/ticket?caller_id=471763966&hash=abcd1234efgh5678", payment.getPointOfInteraction().getTransactionData().getTicketUrl()); + assertEquals("openfinance", payment.getPointOfInteraction().getLinkedTo()); assertNotNull(payment.getPointOfInteraction().getTransactionData().getQrCode()); assertNotNull(payment.getPointOfInteraction().getTransactionData().getQrCodeBase64()); } @@ -655,6 +657,8 @@ private PaymentCreateRequest newPixPayment() { .paymentMethodId("pix") .description("description") .payer(PaymentPayerRequest.builder().email("test_user_1648059260@testuser.com").build()) + .pointOfInteraction( + PaymentPointOfInteractionRequest.builder().linkedTo("openfinance").build()) .build(); } } diff --git a/src/test/java/com/mercadopago/resources/mocks/request/payment/payment_pix.json b/src/test/java/com/mercadopago/resources/mocks/request/payment/payment_pix.json index d5ee0ad2..6d3fd3f6 100644 --- a/src/test/java/com/mercadopago/resources/mocks/request/payment/payment_pix.json +++ b/src/test/java/com/mercadopago/resources/mocks/request/payment/payment_pix.json @@ -5,5 +5,8 @@ "email": "test_user_1648059260@testuser.com" }, "payment_method_id": "pix", + "point_of_interaction": { + "linked_to": "openfinance" + }, "transaction_amount": 100 } \ No newline at end of file diff --git a/src/test/java/com/mercadopago/resources/mocks/response/payment/payment_pix.json b/src/test/java/com/mercadopago/resources/mocks/response/payment/payment_pix.json index d10ac003..36fec188 100644 --- a/src/test/java/com/mercadopago/resources/mocks/response/payment/payment_pix.json +++ b/src/test/java/com/mercadopago/resources/mocks/response/payment/payment_pix.json @@ -89,6 +89,7 @@ "acquirer_reconciliation": [], "point_of_interaction": { "type": "OPENPLATFORM", + "linked_to": "openfinance", "business_info": { "unit": "online_payments", "sub_unit": "default"