Skip to content

petertulala/securionpay-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.4.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.

About

SecurionPay Java Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%