Java SDK
Learn how to use our SDK in Java to facilitate even further the integration with our Deposits APIs
Introduction
The Deposits Java SDK (Software Development Kit) is a software package you can download and add to your existing code facilitating the integration by having pre-defined classes and functions you can call to integrate the Deposits Endpoints.
Review and download the source code from GitHub by clicking on the button below![]()
Installation
Requirements
Java 1.8 or later
Gradle Users
Add this dependency to your project's build file:
implementation "com.directa24:cashin-java-sdk:1.0.13"Maven Users
Add this dependency to your project's POM:
Dependencies
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.
JUnit 4 and Wiremock library are needed to run the bundled tests.
Usage
Begin by initializing your credentials
Deposit Credentials
Read-Only Credentials
Make sure you have whitelisted your servers IPs on our Merchant Panel by going to Settings -> API Access.
Click here for more information about the API Keys.
Once the credentials and the IPs have been properly set-up, you are ready to start using the classes the SDK provides. Each Class can be used to execute the functionalities of its respective Deposit Endpoint.
Make sure you take a look at the Deposit Endpoints here to review how the integration of each of them works, the validations and the responses formats.
As soon as you are ready with the integration and you have the production credentials, replace the credentials for the production ones.
Classes
heck the respective Endpoint Page to see the format of the responses, fields requirements and validations.
Create Deposit
Every time you need to create a deposit, you will need to invoke the CreateDepositRequest Class with all the objects containing the information required to be sent. The amount of information required depends on the flow you have chosen, either the Hosted Checkout Experience or the ONE SHOT Experience.
Deposit Status
As soon as the deposit is created and you have received the notification in your notification_url, you will want to invoke the DepositStatusRequest Class to retrieve the status of the deposit.
Click here to see the deposits status flow.
Make sure you are adding the deposit_id received on your notification_url in the field DepositStatusRequest.id.
Payment Methods
For the best user experience, we recommend integrating our Payment Methods Endpoint to automatically retrieve the list of payment methods name, logos, types and more that your account has available.
In order to do that, invoke the PaymentMethodRequest Class containing the Country's ISO code of the country you need the payment methods from in the field PaymentMethodRequest.country
Exchange Rates
If you need to know the Exchange Rate of a given currency, you can do so by invoking ExchangeRateRequest with the Country's ISO code of the origin and the amount you want to convert to USD.
Create Refund
In order to create a refund, you need to send the deposit_id, merchant_invoice_id, and the bank_account object (only for non-cc payments, otherwise, it is optional).
Refund Status
Last updated
Was this helpful?

