Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seerbit/seerbit-java-api-library
Seerbit API Library for Java (Version 1 & 2)
https://github.com/seerbit/seerbit-java-api-library
cardservice java java-library payment-gateway payment-integration seerbit seerbit-api
Last synced: 2 months ago
JSON representation
Seerbit API Library for Java (Version 1 & 2)
- Host: GitHub
- URL: https://github.com/seerbit/seerbit-java-api-library
- Owner: seerbit
- Created: 2020-01-20T09:27:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T22:38:51.000Z (12 months ago)
- Last Synced: 2024-04-20T11:01:25.517Z (9 months ago)
- Topics: cardservice, java, java-library, payment-gateway, payment-integration, seerbit, seerbit-api
- Language: Java
- Homepage: http://doc.seerbit.com/
- Size: 668 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
seerbit-java-v1
A Seerbit API Library for Java (Version 1)## Features
The Library supports all APIs under the following services:
* Payment via API (card and account)
* Disputes
* Refunds
* Transaction Status## Getting Started
A full getting started guide for integrating SeerBit can be found at [getting started docs](https://doc.seerbit.com).
## Documentation
The documentation, installation guide, detailed description of the SeerBit API and all of its features is [available on the documentation website](https://doc.seerbit.com/api/library)
## Requirements
* Java 8 or higher
* Maven## Installation
### Maven
Add this dependency to your project's POM:
```xml
com.seerbit
seerbit-java-api
1.0```
## Contributing
You can contribute to this repository so that anyone can benefit from it:
* Improved features
* Resolved bug fixes and issues## Examples
You can also check the [src/main/java/com/seerbit/demo](https://github.com/seerbit/seerbit-java-v1/tree/master/src/main/java/com/seerbit/demo) folder in this repository for more examples of usage.
## Using the Library
Initiate Card Transaction
Instantiate a client and set the parameters.```java
Seerbit seerbitApp = new SeerbitImpl();
Client client = new Client();
client.setAPIBase(seerbitApp.getApiBase());
client.setEnvironment(EnvironmentEnum.LIVE.getEnvironment());
client.setPublicKey("public_key");
client.setPrivateKey("private_key");
client.setTimeout(20);
```To initiate a transaction request you need to perform a transaction authentication.
```java
TransactionAuthenticationImpl authService = new TransactionAuthenticationImpl(client);
JsonObject response = authService.doAuth();
```Then retrieve your token after authenticating and pass it to the CardService constructor along with your client object. You can then construct your payload and call the
doAuthorize()
method of the CardService class.
```java
String token = authService.getToken();
CardService cardService = new CardServiceImpl(client, token);CardDetail cardDetail = new CardDetail();
cardDetail.setCvv("100");
cardDetail.setNumber("5123450000000008");
cardDetail.setExpiryMonth("05");
cardDetail.setExpiryYear("21");
cardDetail.setPin("1234");Card card = new Card();
card.setFullname("Sambo Chukwuma Adetutu");
card.setPublicKey(client.getConfig().getPublicKey());
card.setTransactionReference("trx00001");
card.setEmail("[email protected]");
card.setMobile("08012345678");
card.setChannelType("account");
card.setDeviceType("Nokia 3310");
card.setSourceIP("127.0.0.20");
card.setType("3DSECURE");
card.setCurrency("NGN");
card.setDescription("put a descriptive message here");
card.setCountry("NG");
card.setFee("1.00");
card.setAmount("150.00");
card.setClientAppCode("appl");
card.setCallbackUrl("http://www.example.com");
card.setRedirectUrl("http://www.example.com");
card.setCardDetail(cardDetail);JsonObject json = cardService.doAuthorize(card);
```Find more examples [here](https://github.com/seerbit/seerbit-java-v1/tree/master/src/main/java/com/seerbit/demo).
## Licence
GNU General Public License. For more information, see the LICENSE file.## Website
* https://seerbit.com