https://github.com/cloudipsp/java-sdk
java-sdk
https://github.com/cloudipsp/java-sdk
Last synced: 10 months ago
JSON representation
java-sdk
- Host: GitHub
- URL: https://github.com/cloudipsp/java-sdk
- Owner: cloudipsp
- License: apache-2.0
- Created: 2023-06-09T10:33:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-09T11:00:06.000Z (over 2 years ago)
- Last Synced: 2025-01-19T21:55:12.404Z (11 months ago)
- Language: Java
- Size: 18.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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