Skip to content

Commit 00fae70

Browse files
🎉 Initial commit
1 parent 0580da1 commit 00fae70

23 files changed

+2538
-2
lines changed

‎.classpath

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="**/test/**" kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
<attribute name="test" value="true"/>
14+
</attributes>
15+
</classpathentry>
16+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
<attribute name="optional" value="true"/>
20+
</attributes>
21+
</classpathentry>
22+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
23+
<attributes>
24+
<attribute name="maven.pomderived" value="true"/>
25+
</attributes>
26+
</classpathentry>
27+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
28+
<attributes>
29+
<attribute name="maven.pomderived" value="true"/>
30+
</attributes>
31+
</classpathentry>
32+
<classpathentry kind="src" path="target/generated-sources/annotations">
33+
<attributes>
34+
<attribute name="optional" value="true"/>
35+
<attribute name="maven.pomderived" value="true"/>
36+
<attribute name="ignore_optional_problems" value="true"/>
37+
<attribute name="m2e-apt" value="true"/>
38+
</attributes>
39+
</classpathentry>
40+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
41+
<attributes>
42+
<attribute name="maven.pomderived" value="true"/>
43+
<attribute name="test" value="true"/>
44+
<attribute name="optional" value="true"/>
45+
</attributes>
46+
</classpathentry>
47+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
48+
<attributes>
49+
<attribute name="optional" value="true"/>
50+
<attribute name="maven.pomderived" value="true"/>
51+
<attribute name="ignore_optional_problems" value="true"/>
52+
<attribute name="m2e-apt" value="true"/>
53+
<attribute name="test" value="true"/>
54+
</attributes>
55+
</classpathentry>
56+
<classpathentry kind="output" path="target/classes"/>
57+
</classpath>

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
.settings

‎.project

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>sdk-java-apis-efi</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
<filteredResources>
24+
<filter>
25+
<id>1665500716441</id>
26+
<name></name>
27+
<type>30</type>
28+
<matcher>
29+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
30+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31+
</matcher>
32+
</filter>
33+
</filteredResources>
34+
</projectDescription>

‎.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: java
2+
install:
3+
- mvn test-compile -DskipTests=true -Dmaven.javadoc.skip=true -B -V
4+
script:
5+
- mvn clean test jacoco:report
6+
after_success:
7+
- mvn coveralls:report
8+
jdk:
9+
- openjdk7
10+
- oraclejdk8

‎CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 1.0.0
2+
3+
- Initial release

‎LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(The MIT License)
2+
3+
Copyright (c) 2015 TJ Efí <consultoria@sejaefi.com.br>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
'Software'), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README-en.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<h1 align="center">Java SDK for APIs Efí Pay</h1>
2+
3+
![Banner APIs Efí Pay](https://gnetbr.com/BJgSIUhlYs)
4+
5+
<p align="center">
6+
<a href="https://github.com/efipay/sdk-java-apis-efi">Portuguese</a> |
7+
<span><b>English</b></span>
8+
</p>
9+
10+
SDK in JAVA for integration with Efí APIs for emission Pix, bank slips, carnet, credit card, subscription, payment link, marketplance, Pix through Open Finance, among other features.
11+
For more informations about [parameters](http://dev.sejaefi.com.br) and [values](http://sejaefi.com.br/tarifas) see our website.
12+
13+
14+
15+
## Requirements
16+
* Java >= 7.0
17+
18+
## Tested with
19+
> java 7.0, 8.0, 13.0 and 20.0
20+
21+
## Installation
22+
**Via gradle:**
23+
24+
```gradle
25+
compile 'br.com.efipay.efisdk:sdk-java-apis-efi:1.0.0'
26+
```
27+
28+
**Via maven:**
29+
30+
```xml
31+
<dependency>
32+
    <groupId>br.com.efipay.efisdk</groupId>
33+
<artifactId>sdk-java-apis-efi</artifactId>
34+
<version>1.0.0</version>
35+
</dependency>
36+
```
37+
38+
## Getting started
39+
Require the module and packages:
40+
```java
41+
import br.com.efi.efisdk.EfiPay;
42+
import br.com.efi.efisdk.exceptions.EfiPayException;
43+
44+
```
45+
46+
Although the web services responses are in json format, the sdk will convert any server response to a JSONObject or a Map<String, Object>. The code must be within a try-catch and exceptions can be handled as follow:
47+
48+
```java
49+
try {
50+
/* code */
51+
} catch(EfiPayException e) {
52+
/* EfiPay's api errors will come here */
53+
} catch(Exception ex) {
54+
/* Other errors will come here */
55+
}
56+
```
57+
58+
59+
### For development environment
60+
Instantiate the module parameters using `client_id`, `client_secret`, `sandbox` equal to **true** and `certificate` with the name of the approval certificate:
61+
```java
62+
JSONObject options = new JSONObject();
63+
options.put("client_id", "client_id");
64+
options.put("client_secret", "client_secret");
65+
options.put("certificate", "./certs/developmentCertificate.p12");
66+
options.put("sandbox", true);
67+
68+
EfiPay efi = new EfiPay(options);
69+
```
70+
71+
Or
72+
73+
```java
74+
Map<String, Object> options = new HashMap<String, Object>();
75+
options.put("client_id", "client_id");
76+
options.put("client_secret", "client_secret");
77+
options.put("certificate", "./certs/developmentCertificate.p12");
78+
options.put("sandbox", true);
79+
80+
EfiPay efi = new EfiPay(options);
81+
```
82+
83+
### For production environment
84+
Instantiate the module parameters using `client_id`, `client_secret`, `sandbox` equals *false* and `certificate` with the name of the production certificate:
85+
```java
86+
JSONObject options = new JSONObject();
87+
options.put("client_id", "client_id");
88+
options.put("client_secret", "client_secret");
89+
options.put("certificate", "./certs/productionCertificate.p12");
90+
options.put("sandbox", false);
91+
92+
EfiPay efi = new EfiPay(options);
93+
```
94+
Or
95+
96+
```java
97+
Map<String, Object> options = new HashMap<String, Object>();
98+
options.put("client_id", "client_id");
99+
options.put("client_secret", "client_secret");
100+
options.put("certificate", "./certs/productionCertificate.p12");
101+
options.put("sandbox", false);
102+
103+
EfiPay efi = new EfiPay(options);
104+
```
105+
106+
## Running tests
107+
108+
To run the test suite:
109+
110+
```bash
111+
mvn clean test jacoco:report
112+
```
113+
## Running examples
114+
To run some existing examples follow the steps described at [sdk-java-examples-apis-efi](https://github.com/efipay/sdk-java-examples-apis-efi).
115+
116+
## Additional Documentation
117+
118+
The full documentation with all available endpoints is in https://dev.efipay.com.br.
119+
120+
## Changelog
121+
122+
[CHANGELOG](CHANGELOG.md)
123+
124+
<!-- ## License ##
125+
[MIT](LICENSE) -->

‎README.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,125 @@
1-
# sdk-java-apis-efi
2-
SDK em Java integrada às APIs Efí Pay preparada para emissão de cobranças Pix com QR Code e Pix Copia e Cola, boletos, carnês, cartão de crédito, assinatura, link de pagamento, marketplance, iniciação de pagamento Pix via Open Finance, pagamento de boletos, dentre outras funcionalidades. sdk-java-apis-efi
1+
<h1 align="center">SDK Java para APIs Efí Pay</h1>
2+
3+
![Banner APIs Efí Pay](https://gnetbr.com/BJgSIUhlYs)
4+
5+
<p align="center">
6+
<span><b>Português</b></span> |
7+
<a href="https://github.com/efipay/sdk-java-apis-efi/blob/master/README-en.md">Inglês</a>
8+
</p>
9+
10+
SDK em JAVA para integração com as APIs Efí para emissão de Pix, boletos, carnês, cartão de crédito, assinatura, link de pagamento, marketplance, Pix via Open Finance, pagamento de boletos, dentre outras funcionalidades.
11+
Para mais informações sobre [parâmetros](http://sejaefi.com.br/api) e [valores/tarifas](http://sejaefi.com.br/tarifas) consulte nosso site.
12+
13+
14+
15+
16+
## Requisitos
17+
* Java >= 7.0
18+
19+
## Testado com
20+
> java 7.0, 8.0, 13.0 e 20.0
21+
22+
## Instalação
23+
**Via gradle:**
24+
25+
```gradle
26+
compile 'br.com.efipay.efisdk:sdk-java-apis-efi:1.0.0'
27+
```
28+
29+
**Via maven:**
30+
31+
```xml
32+
<dependency>
33+
<groupId>br.com.efipay.efisdk</groupId>
34+
<artifactId>sdk-java-apis-efi</artifactId>
35+
<version>1.0.0</version>
36+
</dependency>
37+
```
38+
39+
## Começando
40+
Requisite os módulos e pacotes:
41+
```java
42+
import br.com.efi.efisdk.EfiPay;
43+
import br.com.efi.efisdk.exceptions.EfiPayException;
44+
45+
```
46+
47+
Embora as respostas dos serviços da Web estejam no formato json, a sdk converterá qualquer resposta do servidor em um JSONObject ou um Map<String, Object>. O código deve estar dentro de um try-catch e as exceções podem ser tratadas da seguinte forma:
48+
49+
```java
50+
try {
51+
/* code */
52+
} catch(EfiPayException e) {
53+
/* EfiPay's api errors will come here */
54+
} catch(Exception ex) {
55+
/* Other errors will come here */
56+
}
57+
```
58+
59+
### Para ambiente de homologação
60+
Instancie os parâmetros do módulo usando `client_id`, `client_secret`, `sandbox` igual a **true** e `certificate` com o nome do certificado de homologação:
61+
```java
62+
JSONObject options = new JSONObject();
63+
options.put("client_id", "client_id");
64+
options.put("client_secret", "client_secret");
65+
options.put("certificate", "./certs/developmentCertificate.p12");
66+
options.put("sandbox", true);
67+
68+
EfiPay efi = new EfiPay(options);
69+
```
70+
71+
Ou
72+
73+
```java
74+
Map<String, Object> options = new HashMap<String, Object>();
75+
options.put("client_id", "client_id");
76+
options.put("client_secret", "client_secret");
77+
options.put("certificate", "./certs/developmentCertificate.p12");
78+
options.put("sandbox", true);
79+
80+
EfiPay efi = new EfiPay(options);
81+
```
82+
83+
### Para ambiente de produção
84+
Instancie os parâmetros do módulo usando `client_id`, `client_secret`, `sandbox` igual a *false* e `certificate` com o nome do certificado de produção:
85+
```java
86+
JSONObject options = new JSONObject();
87+
options.put("client_id", "client_id");
88+
options.put("client_secret", "client_secret");
89+
options.put("certificate", "./certs/productionCertificate.p12");
90+
options.put("sandbox", false);
91+
92+
EfiPay efi = new EfiPay(options);
93+
```
94+
Ou
95+
96+
```java
97+
Map<String, Object> options = new HashMap<String, Object>();
98+
options.put("client_id", "client_id");
99+
options.put("client_secret", "client_secret");
100+
options.put("certificate", "./certs/productionCertificate.p12");
101+
options.put("sandbox", false);
102+
103+
EfiPay efi = new EfiPay(options);
104+
```
105+
106+
## Executando testes
107+
108+
Para executar o conjunto de testes:
109+
110+
```bash
111+
mvn clean test jacoco:report
112+
```
113+
## Execução de exemplos
114+
Para executar alguns exemplos existentes, siga as etapas descritas em [sdk-java-examples-apis-efi](https://github.com/efipay/sdk-java-examples-apis-efi).
115+
116+
## Documentação Adicional
117+
118+
A documentação completa com todos os endpoints disponíveis está em https://dev.efipay.com.br.
119+
120+
## Changelog
121+
122+
[CHANGELOG](CHANGELOG.md)
123+
124+
<!-- ## License ##
125+
[MIT](LICENSE) -->

0 commit comments

Comments
 (0)