Skip to content

Commit

Permalink
Master: Fix get sdk version from config
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipeMata committed Sep 22, 2016
1 parent 0f23859 commit dce60a1
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ script:
after_success:
- mvn coveralls:report
jdk:
- oraclejdk7
- oraclejdk8
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Sdk for Gerencianet Pagamentos' API.
For more informations about parameters and values, please refer to [Gerencianet](http://gerencianet.com.br) documentation.

**Em caso de dúvidas, você pode verificar a [Documentação](https://docs.gerencianet.com.br) da API na Gerencianet e, necessitando de mais detalhes ou informações, entre em contato com nossa consultoria técnica, via nossos [Canais de Comunicação](https://gerencianet.com.br/central-de-ajuda).**
**Em caso de d�vidas, voc� pode verificar a [Documenta��o](https://docs.gerencianet.com.br) da API na Gerencianet e, necessitando de mais detalhes ou informa��es, entre em contato com nossa consultoria t�cnica, via nossos [Canais de Comunica��o](https://gerencianet.com.br/central-de-ajuda).**


[![Build Status](https://travis-ci.org/gerencianet/gn-api-sdk-java.svg?branch=master)](https://travis-ci.org/gerencianet/gn-api-sdk-java)
[![Coverage Status](https://coveralls.io/repos/github/gerencianet/gn-api-sdk-java/badge.svg?branch=master)](https://coveralls.io/github/gerencianet/gn-api-sdk-java?branch=master)

## Requirements
* Java >= 8.0
* Java >= 7.0

## Getting started
Require the module and packages:
Expand Down
33 changes: 31 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,43 @@
<groupId>br.com.gerencianet.gnsdk</groupId>
<artifactId>gn-api-sdk-java</artifactId>
<version>0.1.0</version>

<name>GN API SDK JAVA</name>
<description>Java SDK for integrating with Gerencianet API</description>
<url>https://github.com/gerencianet/gn-api-sdk-java</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
</license>
</licenses>

<developers>
<developer>
<id>FilipeMata</id>
<name>Filipe Mata</name>
<email>filipe.santos@gerencianet.com.br</email>
<organization>Gerencianet</organization>
<organizationUrl>http://gerencianet.com.br</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/gerencianet/gn-api-sdk-java.git</connection>
<developerConnection>scm:git:git@github.com:gerencianet/gn-api-sdk-java.git</developerConnection>
<url>https://github.com/gerencianet/gn-api-sdk-java</url>
<tag>gn-api-sdk-java-0.1.0</tag>
</scm>

<dependencies>
<dependency>
<groupId>org.json</groupId>
Expand Down Expand Up @@ -44,8 +73,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/br/com/gerencianet/gnsdk/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Base64;
import java.util.Base64.Encoder;
import java.util.Date;

import javax.xml.bind.DatatypeConverter;
import org.json.JSONObject;

import br.com.gerencianet.gnsdk.exceptions.AuthorizationException;
import br.com.gerencianet.gnsdk.exceptions.GerencianetException;

Expand Down Expand Up @@ -42,8 +39,7 @@ public Auth(JSONObject credentials, String method, String authorizeRoute) throws
authBody.put("grant_type", "client_credentials");

String auth = credentials.getString("clientId") + ":" + credentials.getString("clientSecret");
Encoder encode = Base64.getEncoder();
this.authCredentials = encode.encodeToString(auth.getBytes("UTF-8"));
this.authCredentials = DatatypeConverter.printBase64Binary(auth.getBytes("UTF-8"));
}

public void setRequest(Request request) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/gerencianet/gnsdk/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/
public class Config {
private final static String version = "0.0.1";
private final static String version = "0.1.0";
private JSONObject conf = new JSONObject();
private JSONObject endpoints = new JSONObject();
private JSONObject urls = new JSONObject();
Expand Down

0 comments on commit dce60a1

Please sign in to comment.