An open API service indexing awesome lists of open source software.

https://github.com/cloudipsp/java-sdk

java-sdk
https://github.com/cloudipsp/java-sdk

Last synced: 10 months ago
JSON representation

java-sdk

Awesome Lists containing this project

README

          


cipsplogo

# CloudIpspSdk[Fondy]
## Payment service provider
A payment service provider (PSP) offers shops online services for accepting electronic payments by a variety of payment methods including credit card, bank-based payments such as direct debit, bank transfer, and real-time bank transfer based on online banking. Typically, they use a software as a service model and form a single payment gateway for their clients (merchants) to multiple payment methods.
[read more](https://en.wikipedia.org/wiki/Payment_service_provider)

Requirements
------------
- [Fondy account](https://portal.fondy.eu)
- Java 8

## SDK Installation

If Maven project, add sdk dependency in section:

```xml


com.cloudipsp.cloudipspsdk
java-cloudipsp-sdk-client
1.0.0

```

## Simple start
```java
public class Main {
public static void main(String[] args) {
final Configuration config = new Configuration()
.setSecretKey("test")
.setMerchantId(1396424);
client = new CloudIpspApi(config);
pamentApi = client.getPaymentApi(); // Get payment api instance
orderApi = client.getOrderApi(); // Get api instance for working with orders
/**
* Generate payment request
*/
JSONObject payload = new JSONObject();
payload.put("currency", "EUR");
payload.put("amount", 100);
payload.put("order_id", "test123");
BaseApiResponse response = pamentApi.paymentUrl(payload);
JSONObject order = response.getParsedResponse();
URI checkout_url = response.getCheckoutUrl();
/**
* Generate capture request
*/
JSONObject payload = new JSONObject();
payload.put("currency", "EUR");
payload.put("amount", 100);
payload.put("order_id", "test123");
BaseApiResponse response = orderApi.Capture(payload);
JSONObject order = response.getParsedResponse();
}
}
```
**response will be an object with the following getters:**

* `getStatus()` - int HTTP status code
* `getResponse()` - the response serialized into a JSONObject
* `getRawResponse()` - the raw JSON String response body
* `getParsedResponse()` - the response serialized into a JSONObject and converted by version
* `getUrl()` - the URL for the REST call the SDK calls, for troubleshooting purposes
* `getRawRequest()` - the JSON request body String sent
* `getRetries()` - usually 0, but reflects the number of times a request was retried due to throttling or other server-side issue
* `getDuration()` - duration in milliseconds of SDK function call
* `isSuccess()` - returns true for a 200
* `getReportList()` - the response serialized into a JSONList used by getting reports
* `getCheckoutUrl()` - return URI