Skip to content

Commit

Permalink
Merge pull request #236 from mercadopago/develop
Browse files Browse the repository at this point in the history
Add linked_to parameter to payment request and resource
rhames07 authored Jul 6, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents e13a2a6 + 72f9c69 commit 5af9151
Showing 8 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ already.
<dependency>
<groupId>com.mercadopago</groupId>
<artifactId>sdk-java</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
</dependency>
```

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

<groupId>com.mercadopago</groupId>
<artifactId>sdk-java</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<packaging>jar</packaging>

<name>Mercadopago SDK</name>
Original file line number Diff line number Diff line change
@@ -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;

Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@ public class PaymentPointOfInteraction {
/** Sub type. */
private String subType;

/** Linked to information. */
private String linkedTo;

/** Application data. */
private PaymentApplicationData applicationData;

Original file line number Diff line number Diff line change
@@ -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("[email protected]").build())
.pointOfInteraction(
PaymentPointOfInteractionRequest.builder().linkedTo("openfinance").build())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -5,5 +5,8 @@
"email": "[email protected]"
},
"payment_method_id": "pix",
"point_of_interaction": {
"linked_to": "openfinance"
},
"transaction_amount": 100
}
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@
"acquirer_reconciliation": [],
"point_of_interaction": {
"type": "OPENPLATFORM",
"linked_to": "openfinance",
"business_info": {
"unit": "online_payments",
"sub_unit": "default"

0 comments on commit 5af9151

Please sign in to comment.