Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #116 from moip/fix/order-request-errors
Browse files Browse the repository at this point in the history
[RELEASE] v4.1.1
  • Loading branch information
mbnakaya authored Mar 2, 2018
2 parents d309eda + 7347c67 commit 00bcbcf
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<a name="v4.1.1"></a>
# [](https://github.com/moip/moip-sdk-java/compare/v4.1.0...v4.1.1) (2018-03-02)


### Bug Fixes

* **Client**: fix a bug in method `doRequest()` ([]())


<a name="v4.1.0"></a>
# [](https://github.com/moip/moip-sdk-java/compare/v4.0.0...v4.1.0) (2018-01-06)
# [](https://github.com/moip/moip-sdk-java/compare/v4.0.0...v4.1.0) (2018-02-27)


### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Adicionar no seu pom.xml:
<dependency>
<groupId>br.com.moip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.1.0</version>
<version>4.1.1</version>
</dependency>

```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'signing'

group = 'br.com.moip'
archivesBaseName = "java-sdk"
version = '4.1.0'
version = '4.1.1'

description = "Moip v2 SDK"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/moip/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private <T> T doRequest(final RequestProps requestProps) {
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", USER_AGENT);
conn.setRequestProperty("Content-type", requestProps.contentType.getMimeType());
conn.setRequestProperty("Accept", requestProps.accept);
if (requestProps.accept != null) conn.setRequestProperty("Accept", requestProps.accept);

conn.setRequestMethod(requestProps.method);

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/br/com/moip/resource/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import br.com.moip.resource.links.OrderLinks;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Order {
Expand All @@ -11,7 +12,7 @@ public class Order {
private String ownId;
private OrderStatus status;
private String platform;
private String createdAt, updatedAt;
private Date createdAt, updatedAt;
private Amount amount;
private final List<Item> items;
private final List<Address> addresses = new ArrayList<>();
Expand Down Expand Up @@ -51,9 +52,9 @@ public OrderStatus getStatus() {

public String getPlatform() { return platform; }

public String getCreatedAt() { return createdAt; }
public Date getCreatedAt() { return createdAt; }

public String getUpdatedAt() { return updatedAt; }
public Date getUpdatedAt() { return updatedAt; }

public Amount getAmount() {
return amount;
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/br/com/moip/api/OrderAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.UUID;

Expand Down Expand Up @@ -74,8 +75,8 @@ public void testCreate() {
assertEquals("the_order.001", createdOrder.getOwnId());
assertEquals(OrderStatus.CREATED, createdOrder.getStatus());
assertEquals("V2", createdOrder.getPlatform());
assertEquals("2018-02-22T15:33:38.493-03", createdOrder.getCreatedAt());
assertEquals("2018-02-22T15:33:38.493-03", createdOrder.getUpdatedAt());
assertEquals("2018-02-22", simpleDateFormat.format(createdOrder.getCreatedAt()));
assertEquals("2018-02-22", simpleDateFormat.format(createdOrder.getUpdatedAt()));
assertEquals(0, createdOrder.getAmount().getPaid().intValue());
assertEquals(11000, createdOrder.getAmount().getTotal().intValue());
assertEquals(0, createdOrder.getAmount().getFees().intValue());
Expand Down

0 comments on commit 00bcbcf

Please sign in to comment.