Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

securionpay/securionpay-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecation

This library is deprecated. Please use Shift4 Java Library.

SecurionPay JAVA Library

If you don't already have SecurionPay account you can create it here.

Instalation

Maven

Best way to use this library is via Maven.

To do this you will need to add this configuration to your pom.xml:

<dependency>
    <groupId>com.securionpay</groupId>
    <artifactId>securionpay-java</artifactId>
    <version>2.9.0</version>
</dependency>

Manual installation

If you don't want to use Maven then you can download the latest release.

Quick start example

SecurionPayGateway gateway = new SecurionPayGateway("sk_test_[YOUR_SECRET_KEY]");

ChargeRequest request = new ChargeRequest()
		.amount(499)
		.currency("EUR")
		.card(new CardRequest()
				.number("4242424242424242")
				.expMonth("11")
				.expYear("2022"));

try {
    Charge charge = gateway.createCharge(request);

    // do something with charge object - see https://securionpay.com/docs/api#charge-object
    String chargeId = charge.getId();

} catch (SecurionPayException e) {
    // handle error response - see https://securionpay.com/docs/api#error-object
    ErrorType errorType = e.getType();
    ErrorCode errorCode = e.getCode();
    String errorMessage = e.getMessage();
}

Documentation

For further information, please refer to our official documentation at https://securionpay.com/docs.