Code Monkey home page Code Monkey logo

reloadly-sdk-java's Introduction

reloadly-java-icon

Reloadly SDK for Java

CircleCI MIT Maven Central

The Reloadly SDK for Java enables Java developers to easily work with Reloadly Services and build scalable solutions. You can get started in minutes using Maven or any build system that supports MavenCentral as an artifact source.

Getting Started

Sign up for Reloadly

Before you begin, you need a Reloadly account. Please see the Sign-Up for Reloadly section of the knowledge-base for information about how to create a Reloadly account and retrieve your Reloadly APIs credentials.

Minimum requirements

To run the SDK you will need Java 1.8+

Using the SDK Modules

The SDK is made up of several modules such as Authentication, Airtime, Giftcard etc..., you can alternatively add dependencies for the specific services you use only. For example : Authentication & Airtime (currently all modules have the same version, but this may not always be the case)

Gradle users

Add specific dependencies to your project's build file:

implementation "software.reloadly:java-sdk-authentication:1.0.2"

OR

implementation "software.reloadly:java-sdk-airtime:1.0.2"

OR

implementation "software.reloadly:java-sdk-giftcard:1.0.2"

Maven users

Add specific dependencies to your project's POM:

<dependency>
    <groupId>software.reloadly</groupId>
    <artifactId>java-sdk-authentication</artifactId>
    <version>1.0.2</version>
</dependency>

OR

<dependency>
    <groupId>software.reloadly</groupId>
    <artifactId>java-sdk-airtime</artifactId>
    <version>1.0.2</version>
</dependency>

OR

<dependency>
    <groupId>software.reloadly</groupId>
    <artifactId>java-sdk-giftcard</artifactId>
    <version>1.0.2</version>
</dependency>

Others

You'll need to manually install the following JAR :

Getting Help

GitHub issues is the preferred channel to interact with our team. Also check these community resources for getting help:

  • Checkout & search our knowledge-base
  • Talk to us live on our chat tool on our website (bottom right)
  • Ask a question on StackOverflow and tag it with reloadly-java-sdk
  • Articulate your feature request or upvote existing ones on our Issues page
  • Take a look at our YouTube series for plenty of helpful walkthroughs and tips
  • Open a case via with the Reloadly Support Center
  • If it turns out that you may have found a bug, please open an issue

Documentation

Please see the Java API docs for the most up-to-date documentation.

You can also refer to the online Javadoc.

The library uses Project Lombok. While it is not a requirement, you might want to install a plugin for your favorite IDE to facilitate development.

Running Tests

There are 3 groups of tests : integration, integration-with-proxy and all test.

  • To run all the tests, including integration tests, execute ./mvnw test. However, for integration tests to run successfully, the following environment variables are required :
export LIVE_CLIENT_ID=put_your_account_live_client_id_here
export LIVE_CLIENT_SECRET=put_your_account_live_client_secret_here
export SANDBOX_CLIENT_ID=put_your_account_sandbox_client_id_here
export SANDBOX_CLIENT_SECRET=put_your_account_sandbox_client_secret_here
export PROXY_HOST=put_your_proxy_host_here
export PROXY_USERNAME=put_your_proxy_username_here
export PROXY_PASSWORD=put_your_proxy_password_here
export PROXY_PORT=put_your_proxy_port_here
  • To run all integration tests only, execute ./mvnw test -Dgroups=integration

  • To run all proxy integration tests only, execute ./mvnw test -Dgroups=integration-with-proxy

Giving Feedback

We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels:

  • Submit issues - this is the preferred channel to interact with our team
  • Come join the Reloadly Java community chat on Slack
  • Articulate your feature request or upvote existing ones on our Issues page
  • Send feedback directly to the team at [email protected]

License

This project is licensed under the MIT license. See the LICENSE file for more info.

reloadly-sdk-java's People

Contributors

arunkpatra avatar doctor-vee avatar epiard13 avatar flinchy avatar sergiosg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

reloadly-sdk-java's Issues

NoSuchMethodError Base

Describe the issue

java.lang.NoSuchMethodError: No static method encodeBase64URLSafeString([B)Ljava/lang/String; in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.jar)
at software.reloadly.sdk.core.internal.net.Telemetry.(Telemetry.java:65)

Steps to Reproduce

Current Behavior

I get above error, when ever I invoke the method to retrieve a Phone Number Network Provider and then whenever I try to top-up a phone number. Below is the full stack trace;

ATAL EXCEPTION: main
Process: com.prinstech.freesair, PID: 7078
java.lang.NoSuchMethodError: No static method encodeBase64URLSafeString([B)Ljava/lang/String; in class Lorg/apache/commons/codec/binary/Base64; or its super classes (declaration of 'org.apache.commons.codec.binary.Base64' appears in /system/framework/org.apache.http.legacy.jar)
at software.reloadly.sdk.core.internal.net.Telemetry.(Telemetry.java:65)
at software.reloadly.sdk.core.internal.util.TelemetryUtil.getTelemetryInterceptor(TelemetryUtil.java:17)
at software.reloadly.sdk.core.internal.net.API.buildClient(API.java:135)
at software.reloadly.sdk.core.internal.net.API.(API.java:78)
at software.reloadly.sdk.core.internal.net.ServiceAPI.(ServiceAPI.java:31)
at software.reloadly.sdk.airtime.client.AirtimeAPI.(AirtimeAPI.java:40)
at software.reloadly.sdk.airtime.client.AirtimeAPI$AirtimeAPIBuilder.build(AirtimeAPI.java:34)
at com.prinstech.freesair.Home$3$1.onDataChange(Home.java:246)
at com.google.firebase.database.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:75)
at com.google.firebase.database.core.view.DataEvent.fire(DataEvent.java:63)
at com.google.firebase.database.core.view.EventRaiser$1.run(EventRaiser.java:55)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:264)
at android.app.ActivityThread.main(ActivityThread.java:7684)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:507)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
I/ExceptionHandle: at software.reloadly.sdk.core.internal.net.Telemetry.(Telemetry.java:65)
I/ExceptionHandle: at software.reloadly.sdk.core.internal.util.TelemetryUtil.getTelemetryInterceptor(TelemetryUtil.java:17)
I/ExceptionHandle: at software.reloadly.sdk.core.internal.net.API.buildClient(API.java:135)
I/ExceptionHandle: at software.reloadly.sdk.core.internal.net.API.(API.java:78)
I/ExceptionHandle: at software.reloadly.sdk.core.internal.net.ServiceAPI.(ServiceAPI.java:31)
I/ExceptionHandle: at software.reloadly.sdk.airtime.client.AirtimeAPI.(AirtimeAPI.java:40)
I/ExceptionHandle: at software.reloadly.sdk.airtime.client.AirtimeAPI$AirtimeAPIBuilder.build(AirtimeAPI.java:34)
I/ExceptionHandle: at com.prinstech.freesair.Home$3$1.onDataChange(Home.java:246)
I/ExceptionHandle: at com.google.firebase.database.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:75)
I/ExceptionHandle: at com.google.firebase.database.core.view.DataEvent.fire(DataEvent.java:63)
I/ExceptionHandle: at com.google.firebase.database.core.view.EventRaiser$1.run(EventRaiser.java:55)
I/ExceptionHandle: at android.os.Handler.handleCallback(Handler.java:883)
I/ExceptionHandle: at android.os.Handler.dispatchMessage(Handler.java:100)
I/ExceptionHandle: at android.os.Looper.loop(Looper.java:264)
I/ExceptionHandle: at android.app.ActivityThread.main(ActivityThread.java:7684)
I/ExceptionHandle: at java.lang.reflect.Method.invoke(Native Method)
I/ExceptionHandle: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:507)
I/ExceptionHandle: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
I/Process: Sending signal. PID: 7078 SIG: 9

Your Environment

*SDK version: implementation "software.reloadly:java-sdk-authentication:1.0.2"
implementation "software.reloadly:java-sdk-airtime:1.0.2"

  • JDK version: Chipmunk

  • Operating System and version: Am using Android Version 10 for testing and debugging

Deprecation of Base64.encode

I've used the source code to use Reloadly for developing android application. While using the source-code , I noticed that Base64 to encodeBase64URLSafeString is deprecated as well as I found there is no such method Base64.encodeBase64URLSafeString in Base64 class ..(at org.apache.commons latest library)
This method seems to come from org.apache.commons library but as far i know , encodeBase64URLSafeString should come from com.google.api.client.util.Base64 and this method encodeBase64URLSafeString is depraceted...

See this docs of Base64 : https://googleapis.dev/java/google-http-client/latest/com/google/api/client/util/Base64.html
Use of this method at : https://github.com/Reloadly/reloadly-sdk-java/blob/main/java-sdk-core/src/main/java/software/reloadly/sdk/core/internal/net/Telemetry.java

In the documentation of the sample code , Instead of AccountBalance , there should be AccountBalanceInfo

In the documentation of the sample code , while supplying crediential there are some mistakes in the documentation :

Issue

See Here :
https://github.com/Reloadly/reloadly-sdk-java/blob/main/java-sdk-airtime/USAGE.md
Request<AccountBalance> request = AirtimeAPI.builder()
It is said to use AccountBalance but there is not any AccountBalance class in the source code instead it will work correct if we use AccountBalanceInfo class.
AccountBalanceInfo class : https://github.com/Reloadly/reloadly-sdk-java/blob/main/java-sdk-airtime/src/main/java/software/reloadly/sdk/airtime/dto/response/AccountBalanceInfo.java

Links

https://github.com/Reloadly/reloadly-sdk-java/blob/main/java-sdk-airtime/USAGE.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.