diff --git a/README.md b/README.md index d959e6eb..5d74c0c3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ already. com.mercadopago sdk-java - 2.1.6 + 2.1.7 ``` diff --git a/pom.xml b/pom.xml index ca6d1cbb..6d268f33 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.mercadopago sdk-java - 2.1.6 + 2.1.7 jar Mercadopago SDK diff --git a/src/main/java/com/mercadopago/MercadoPagoConfig.java b/src/main/java/com/mercadopago/MercadoPagoConfig.java index 88597051..2ba9aafe 100644 --- a/src/main/java/com/mercadopago/MercadoPagoConfig.java +++ b/src/main/java/com/mercadopago/MercadoPagoConfig.java @@ -15,7 +15,7 @@ /** Mercado Pago configuration class. */ public class MercadoPagoConfig { - public static final String CURRENT_VERSION = "2.1.6"; + public static final String CURRENT_VERSION = "2.1.7"; public static final String PRODUCT_ID = "BC32A7VTRPP001U8NHJ0"; diff --git a/src/main/java/com/mercadopago/resources/preapproval/Preapproval.java b/src/main/java/com/mercadopago/resources/preapproval/Preapproval.java index 6bb9325c..b454ecb8 100644 --- a/src/main/java/com/mercadopago/resources/preapproval/Preapproval.java +++ b/src/main/java/com/mercadopago/resources/preapproval/Preapproval.java @@ -34,6 +34,9 @@ public class Preapproval extends MPResource { /** Preapproval reference value. */ private String externalReference; + /** Date of the next payment debit. */ + private OffsetDateTime nextPaymentDate; + /** Creation date. */ private OffsetDateTime dateCreated; diff --git a/src/test/java/com/mercadopago/client/preapproval/PreapprovalClientTest.java b/src/test/java/com/mercadopago/client/preapproval/PreapprovalClientTest.java index f755d5b5..2936934c 100644 --- a/src/test/java/com/mercadopago/client/preapproval/PreapprovalClientTest.java +++ b/src/test/java/com/mercadopago/client/preapproval/PreapprovalClientTest.java @@ -43,6 +43,9 @@ class PreapprovalClientTest extends BaseClientTest { private final OffsetDateTime endDate = OffsetDateTime.of(2023, 1, 10, 10, 10, 10, 0, ZoneOffset.UTC); + private final OffsetDateTime nextPaymentDate = + OffsetDateTime.of(2022, 1, 10, 10, 10, 10, 0, ZoneOffset.UTC); + private final PreapprovalClient client = new PreapprovalClient(); @Test @@ -211,6 +214,7 @@ private void assertPreapprovalFields(Preapproval preapproval, boolean updated) { assertEquals(reason, preapproval.getReason()); assertEquals("23546246234", preapproval.getExternalReference()); assertEquals(startDate, preapproval.getDateCreated()); + assertEquals(nextPaymentDate, preapproval.getNextPaymentDate()); assertEquals( "https://www.mercadopago.com.br/subscriptions/checkout?preapproval_id=2c9380847e9b451c017ea1bd70ba0219", preapproval.getInitPoint()); diff --git a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_base.json b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_base.json index e185582a..3e6a0437 100644 --- a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_base.json +++ b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_base.json @@ -8,6 +8,7 @@ "status": "pending", "reason": "reason", "external_reference": "23546246234", + "next_payment_date": "2022-01-10T10:10:10.000-00:00", "date_created": "2022-01-10T10:10:10.000-00:00", "last_modified": "2022-01-10T10:10:10.000-00:00", "init_point": "https://www.mercadopago.com.br/subscriptions/checkout?preapproval_id=2c9380847e9b451c017ea1bd70ba0219", diff --git a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_list.json b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_list.json index 39ecc230..7a784fef 100644 --- a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_list.json +++ b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_list.json @@ -19,6 +19,7 @@ "collector_id": 823549964, "application_id": 6245132082630004, "external_reference": "23546246234", + "next_payment_date": "2022-01-10T10:10:10.000-00:00", "date_created": "2022-01-28T11:46:51.768-04:00", "last_modified": "2022-01-28T11:46:51.770-04:00", "init_point": "https://www.mercadopago.com.br/subscriptions/checkout?preapproval_id=2c9380847e9b1dd5017ea15e30fa01ee", @@ -47,6 +48,7 @@ "collector_id": 823549964, "application_id": 6245132082630004, "external_reference": "23546246234", + "next_payment_date": "2022-01-10T10:10:10.000-00:00", "date_created": "2022-01-28T11:47:53.795-04:00", "last_modified": "2022-01-28T11:47:53.799-04:00", "init_point": "https://www.mercadopago.com.br/subscriptions/checkout?preapproval_id=2c9380847e9b1dd5017ea15f234701f0", diff --git a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_update.json b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_update.json index 6bc053ce..4dc142ff 100644 --- a/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_update.json +++ b/src/test/java/com/mercadopago/resources/mocks/response/preapproval/preapproval_update.json @@ -8,6 +8,7 @@ "status": "pending", "reason": "Updated reason", "external_reference": "23546246234", + "next_payment_date": "2022-01-10T10:10:10.000-00:00", "date_created": "2022-01-10T10:10:10.000-00:00", "last_modified": "2022-01-10T10:10:10.000-00:00", "init_point": "https://www.mercadopago.com.br/subscriptions/checkout?preapproval_id=2c9380847e9b451c017ea1bd70ba0219",