-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from mercadopago/develop
Add linked_to parameter to payment request and resource
Showing
8 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/mercadopago/client/payment/PaymentPointOfInteractionRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters