Skip to content

Commit

Permalink
Merge pull request #253 from brianfroschauer/master
Browse files Browse the repository at this point in the history
Add next_payment_date field to Preapproval
  • Loading branch information
romerosilva-meli authored Mar 14, 2023
2 parents 6516511 + 1c25d5d commit 79f9f8e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ already.
<dependency>
<groupId>com.mercadopago</groupId>
<artifactId>sdk-java</artifactId>
<version>2.1.6</version>
<version>2.1.7</version>
</dependency>
```

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

<groupId>com.mercadopago</groupId>
<artifactId>sdk-java</artifactId>
<version>2.1.6</version>
<version>2.1.7</version>
<packaging>jar</packaging>

<name>Mercadopago SDK</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/mercadopago/MercadoPagoConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 79f9f8e

Please sign in to comment.