Skip to content

Commit

Permalink
Merge pull request #231 from mercadopago/feature/add-linkedto-v2
Browse files Browse the repository at this point in the history
Add linkedTo parameter to request
  • Loading branch information
rhames07 authored Jul 6, 2022
2 parents 3e6937f + 17e7433 commit fcba9bc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
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
Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand Down Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -89,6 +89,7 @@
"acquirer_reconciliation": [],
"point_of_interaction": {
"type": "OPENPLATFORM",
"linked_to": "openfinance",
"business_info": {
"unit": "online_payments",
"sub_unit": "default"
Expand Down

0 comments on commit fcba9bc

Please sign in to comment.