Skip to content
This repository has been archived by the owner on Mar 8, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianoluis committed Nov 29, 2016
2 parents c617959 + 1bed2c2 commit 96707c9
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 15 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Simply put the following snippet into your proper build config:
<dependency>
<groupId>me.pagar</groupId>
<artifactId>pagarme-java</artifactId>
<version>1.1.1</version>
<version>1.2.0</version>
</dependency>
```

Expand All @@ -48,7 +48,7 @@ repositories {

##### Dependency
```groovy
compile('me.pagar:pagarme-java:1.1.1') {
compile('me.pagar:pagarme-java:1.2.0') {
transitive = true
}
```
Expand All @@ -57,14 +57,14 @@ compile('me.pagar:pagarme-java:1.1.1') {

##### Dependency
```
'me.pagar:pagarme-java:jar:1.1.1'
'me.pagar:pagarme-java:jar:1.2.0'
```

#### Apache Ivy

##### Dependency
```xml
<dependency org="me.pagar" name="pagarme-java" rev="1.1.1">
<dependency org="me.pagar" name="pagarme-java" rev="1.2.0">
<artifact name="pagarme-java" type="jar" />
</dependency>
```
Expand All @@ -74,22 +74,22 @@ compile('me.pagar:pagarme-java:1.1.1') {
##### Dependency
```groovy
@Grapes(
@Grab(group='me.pagar', module='pagarme-java', version='1.1.1')
@Grab(group='me.pagar', module='pagarme-java', version='1.2.0')
)
```

#### Scala SBT

##### Dependency
```scala
libraryDependencies += "me.pagar" % "pagarme-java" % "1.1.1"
libraryDependencies += "me.pagar" % "pagarme-java" % "1.2.0"
```

#### Leiningen

##### Dependency
```clojure
[me.pagar/pagarme-java "1.1.1"]
[me.pagar/pagarme-java "1.2.0"]
```

## License
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>me.pagar</groupId>
<artifactId>pagarme-java</artifactId>
<version>1.1.2</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<properties>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/me/pagar/Address.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pagar;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import org.joda.time.DateTime;

public class Address extends PagarMeModel<Integer> {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/me/pagar/CardHashKey.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pagar;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class CardHashKey extends PagarMeModel<Integer> {

Expand Down
1 change: 0 additions & 1 deletion src/main/java/me/pagar/PagarMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.URLDecoder;
import java.util.Formatter;

public abstract class PagarMe {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/me/pagar/Recipient.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public BulkAnticipation bulkAnticipationsCancel(final String bulkAnticipationId)
*/
public BulkAnticipation bulkAnticipationsDelete(final String bulkAnticipationId) throws PagarMeException {
validateId();

final BulkAnticipation bulkAnticipation = new BulkAnticipation();

final PagarMeRequest request = new PagarMeRequest(HttpMethod.DELETE,
Expand All @@ -226,7 +226,6 @@ public BulkAnticipation bulkAnticipationsDelete(final String bulkAnticipationId)
return JsonUtils.getAsObject((JsonObject) request.execute(), BulkAnticipation.class);
}


public BulkAnticipation.Limits bulkAnticipationsLimits() throws PagarMeException {
final BulkAnticipation bulkAnticipation = new BulkAnticipation();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/me/pagar/RestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import javax.net.ssl.TrustManagerFactory;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.core.UriBuilder;
import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.KeyStore;
Expand Down
154 changes: 154 additions & 0 deletions src/main/java/me/pagar/Transfer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package me.pagar;

import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import me.pagar.util.JsonUtils;
import org.joda.time.DateTime;

import javax.ws.rs.HttpMethod;

public class Transfer extends PagarMeModel<String> {

@Expose
@SerializedName("transaction_id")
private Integer transactionId;

@Expose
private Integer amount;

@Expose
private Integer fee;

@Expose
private Type type;

@Expose
private Status status;

@Expose(serialize = false)
@SerializedName("funding_estimated_date")
private DateTime fundingEstimatedDate;

@Expose(serialize = false)
@SerializedName("funding_date")
private DateTime fundingDate;

@Expose(serialize = false)
@SerializedName("bank_account")
private BankAccount bankAccount;

public BankAccount getBankAccount() {
return bankAccount;
}

public void setBankAccount(final BankAccount bankAccount) {
this.bankAccount = bankAccount;
}

public Integer getTransactionId() {
return transactionId;
}

public void setTransactionId(final Integer transactionId) {
this.transactionId = transactionId;
}

public Integer getAmount() {
return amount;
}

public void setAmount(final Integer amount) {
this.amount = amount;
}

public Integer getFee() {
return fee;
}

public void setFee(final Integer fee) {
this.fee = fee;
}

public Type getType() {
return type;
}

public void setType(final Type type) {
this.type = type;
}

public Status getStatus() {
return status;
}

public void setStatus(final Status status) {
this.status = status;
}

public DateTime getFundingEstimatedDate() {
return fundingEstimatedDate;
}

public void setFundingEstimatedDate(final DateTime fundingEstimatedDate) {
this.fundingEstimatedDate = fundingEstimatedDate;
}

public DateTime getFundingDate() {
return fundingDate;
}

public void setFundingDate(final DateTime fundingDate) {
this.fundingDate = fundingDate;
}

public Transfer(final Integer amount, final BankAccount bankAccount) {
this.amount = amount;
this.bankAccount = bankAccount;
}

public Transfer create() throws PagarMeException {
final PagarMeRequest request = new PagarMeRequest(HttpMethod.POST, String.format("/%s", getClassName()));
request.setParameters(JsonUtils.objectToMap(this));

return JsonUtils.getAsObject((JsonObject) request.execute(), Transfer.class);
}

/**
* Tipo de transferencia realizada.
*/
public enum Type {

@SerializedName("ted")
TED,

@SerializedName("doc")
DOC,

@SerializedName("credito_em_conta")
CREDITO_EM_CONTA
}

/**
* Status da transferência
*/
public enum Status {

@SerializedName("pending_transfer")
PENDING_TRANSFER,

@SerializedName("transferred")
TRANSFERRED,

@SerializedName("failed")
FAILED,

@SerializedName("processing")
PROCESSING,

@SerializedName("canceled")
CANCELED

}

}
1 change: 0 additions & 1 deletion src/main/java/me/pagar/util/JsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.google.gson.reflect.TypeToken;
import me.pagar.BulkAnticipation;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;

import java.lang.reflect.Type;
import java.util.Collection;
Expand Down

0 comments on commit 96707c9

Please sign in to comment.