Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criada a funcionalidade para buscar forma de pagamento por cliente. #16

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6c4227f
Criada a funcionalidade para buscar forma de pagamento por cliente.
DanielDPN Oct 6, 2017
3602a16
Criada a funcionalidade para remover forma de pagamento do cliente.
DanielDPN Oct 6, 2017
4383bf6
Criada a funcionalidade para fazer transferências de valores.
DanielDPN Oct 6, 2017
577338a
Criada a funcionalidade para listar transferências.
DanielDPN Oct 6, 2017
12e1534
Criada a funcionalidade para buscar uma transferências.
DanielDPN Oct 6, 2017
64df175
Criadas as funcionalidades para listar todas as tranferências bancári…
DanielDPN Oct 6, 2017
89188d6
Criada a funcionalidade para buscar o extrato financeiro.
DanielDPN Oct 9, 2017
44757f0
Criada a funcionalidade para buscar o extrato de faturas.
DanielDPN Oct 10, 2017
8d7d404
Criada a funcionalidade para criar uma subconta.
DanielDPN Oct 10, 2017
897ca7f
Criada a funcionalidade para verificar uma subconta.
DanielDPN Oct 10, 2017
b583a5f
Criada a funcionalidade para configurar uma subconta.
DanielDPN Oct 10, 2017
216076f
Criada a funcionalidade para adicionar domicílio bancário.
DanielDPN Oct 10, 2017
3d996f3
Criada a funcionalidade para verificar envio de domicílio bancário.
DanielDPN Oct 10, 2017
2789bf6
Criada a funcionalidade para fazer pedido de saque.
DanielDPN Oct 10, 2017
622979f
Ajustes nas bibliotecas para a versão 3.1.4 da resteasy.
DanielDPN Oct 17, 2017
bcefdc2
Adicionados os atributos createdAt e updatedAt na classe CustomerResp…
DanielDPN Oct 18, 2017
656cbc7
Criada a funcionalidade para listar clientes.
DanielDPN Jan 5, 2018
fb3583c
Implementando método para recuperar informações da conta, https://api…
DanielDPN Jan 5, 2018
6f17d61
Correção do serviço de verificação da conta
DanielDPN Jan 5, 2018
926383d
Implementando o método Listar Planos, https://api.iugu.com/v1/plans
higomatos Jan 5, 2018
cd486ba
Ajustes
higomatos Jan 6, 2018
e9b8ece
Lista de SubscriptionReponse inserida na classe SubscriptionsResponse.
DanielDPN Jan 10, 2018
8146bc5
Criada a funcionalidade para listar faturas.
DanielDPN Jan 15, 2018
47e9858
Adicionado construtor padrao na classe Customer.
DanielDPN Jan 23, 2018
8c0f6fe
Adicionado o construtor default para SubItem e Subscription.
DanielDPN Feb 19, 2018
dd11359
Ajuste no model de transferência
rafaelTartigrado Mar 24, 2018
c14df08
Adicionado campo recurrent na classe SubItemResponse.
DanielDPN Mar 29, 2018
b520f9c
Mapeamento transferência de valores
rafaelTartigrado Mar 29, 2018
291aab8
Merge branch 'master' of https://github.com/DanielDPN/iugu-java
rafaelTartigrado Mar 29, 2018
7c7bb38
Adicionado o campo id para o SubItem.
DanielDPN Mar 29, 2018
d5c1655
Merge branch 'master' of https://github.com/DanielDPN/iugu-java
DanielDPN Mar 29, 2018
f907cd3
Adicionado campo _destroy na classe SubItem.
DanielDPN Mar 29, 2018
2d30cf6
Adicionado anotacão para campo destroy.
DanielDPN Mar 29, 2018
5f99610
Adicionado campo payableWith na classe PlanResponse e criado método g…
DanielDPN Apr 7, 2018
de398dd
Adicionar atributo payment_method a Invoice
rafaelTartigrado Apr 13, 2018
2bfb9c1
Adicionar atributo payment_method a InvoiceResponse
rafaelTartigrado Apr 13, 2018
94389bf
Ajuste no tipo do atributo paymentMethod para String
rafaelTartigrado Apr 13, 2018
cec5418
Adicionado construtor padrão para Invoice e Item.
DanielDPN Apr 16, 2018
1ab8dfe
Criada funcionalidade para listar as formas de pagamento por cliente.
DanielDPN Apr 20, 2018
d855ba7
Adicionado construtor padrão para PaymentMethod e Data.
DanielDPN Apr 23, 2018
6185124
Criado construtor padrão para Feature e Plan. E criado método de busc…
DanielDPN Apr 25, 2018
14d4c9a
Adicionado id na classe Feature.
DanielDPN Apr 25, 2018
bcbcd9b
Adicionado construtor padrão para RequestVerification.
DanielDPN Apr 26, 2018
0d43058
Adicionado campo cpf_cnpj na classe CustomerResponse.
DanielDPN Apr 26, 2018
314cdc3
Adicionado campo cnpj para classe DataRequestVerification.
DanielDPN May 2, 2018
ede64e8
Adicionado atributo hasErrors no response AccountVerificationResponse.
DanielDPN May 3, 2018
7c29d6e
Adicionado campos phone e phone_prefix na classe Customer.
DanielDPN May 4, 2018
c61a499
Correção do erro de acesso a URL do IUGU através da API
rafaelTartigrado Jul 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 63 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.iugu</groupId>
<groupId>com.tartigrado</groupId>
<artifactId>iugu-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.81</version>
<packaging>jar</packaging>

<name>iugu-java</name>
<url>http://maven.apache.org</url>

<repositories>
<repository>
<id>tartigrado</id>
<name>Tartigrado Repository</name>
<url>http://maven2.tartigrado.com/</url>
</repository>
</repositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
Expand All @@ -20,21 +28,69 @@
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.14.Final</version>
<version>3.1.4.Final</version>
</dependency>

<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>2.3.2.Final</version>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.4.Final</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>tartigrado-ftp</id>
<url>ftp://ftp.tartigrado.com/www/maven2</url>
</repository>
</distributionManagement>

<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>

<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>

<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.8</version>
</extension>
</extensions>
</build>
</project>
39 changes: 37 additions & 2 deletions src/main/java/com/iugu/IuguConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.iugu;

import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

Expand All @@ -13,15 +17,46 @@ public IuguConfiguration(String token) {
}

public Client getNewClient() {
return ClientBuilder.newClient().register(new Authenticator(tokenId, ""));
return ClientBuilder.newBuilder().sslContext(getContext()).build().register(new Authenticator(tokenId, ""));
}

public Client getNewClientNotAuth() {
return ClientBuilder.newClient();
return ClientBuilder.newBuilder().sslContext(getContext()).build();
}

public static String url(String endpoint) {
return URL + endpoint;
}

public SSLContext getContext() {
try {
TrustManager[] noopTrustManager = new TrustManager[]{
new X509TrustManager() {

@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}

@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}

@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
}
}
};

SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, noopTrustManager, null);

return sc;
} catch (Exception e) {
System.out.println(e.getCause());
return null;
}

}

}
46 changes: 29 additions & 17 deletions src/main/java/com/iugu/enums/Currency.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
package com.iugu.enums;

import org.codehaus.jackson.annotate.JsonValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum Currency {

BRL("BRL");

private String value;

private Currency(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
BRL("BRL");

private String value;

private Currency(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public static Currency getCurrencyByValue(String value) {
Currency currency;
switch (value) {
case "BRL":
currency = Currency.BRL;
break;
default:
currency = null;
}
return currency;
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/iugu/enums/IntervalType.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.iugu.enums;

import org.codehaus.jackson.annotate.JsonValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum IntervalType {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/iugu/enums/ItemType.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.iugu.enums;

import org.codehaus.jackson.annotate.JsonValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum ItemType {

Expand Down
52 changes: 35 additions & 17 deletions src/main/java/com/iugu/enums/PayableWith.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
package com.iugu.enums;

import org.codehaus.jackson.annotate.JsonValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum PayableWith {

CREDIT_CARD("credit_card"), ALL("all"), BANK_SLIP("bank_slip");

private String value;

private PayableWith(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}
CREDIT_CARD("credit_card"), ALL("all"), BANK_SLIP("bank_slip");

private String value;

private PayableWith(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public static PayableWith getPayableWithByValue(String value) {
PayableWith payableWith;
switch (value) {
case "credit_card":
payableWith = PayableWith.CREDIT_CARD;
break;
case "all":
payableWith = PayableWith.ALL;
break;
case "bank_slip":
payableWith = PayableWith.BANK_SLIP;
break;
default:
payableWith = null;
}
return payableWith;
}

}
Loading