Skip to content

bvolpato/coinpayments-java

Repository files navigation

coinpayments-java

Apache License Build Status Maven Central Code Climate PRs Welcome

🎥 coinpayments-java - Java Wrapper for CoinPayments.net

Usage

Download the latest release JAR or grab via Maven:

<dependency>
  <groupId>org.brunocvcunha.coinpayments</groupId>
  <artifactId>coinpayments-java</artifactId>
  <version>1.3</version>
</dependency>

or Gradle:

compile 'org.brunocvcunha.coinpayments:coinpayments-java:1.3'

Supported Operations & Examples

Initialize

CoinPayments api = CoinPayments.builder()
        .publicKey("<publicKey>")
        .privateKey("<privateKey>")
        .client(HttpClients.createDefault()).build();

ResponseWrapper<BasicInfoResponse> accountInfo = api.sendRequest(new CoinPaymentsBasicAccountInfoRequest());
log.info("Account: " + accountInfo.getResult());

Create Transaction

ResponseWrapper<CreateTransactionResponse> txResponse = api.sendRequest(CoinPaymentsCreateTransactionRequest.builder().amount(10)
        .currencyPrice("USD")
        .currencyTransfer("LTC")
        .callbackUrl("<callback-url-if-wanted>")
        .custom("Order XYZ")
        .build());
log.info(txResponse.getResult().getTransactionId() + " - " + txResponse.getResult().getStatusUrl());

Do you like this project? Support it by donating

  • btc Bitcoin: 3EN9KCzKunc1PQppBXUSa8UCBoncMXii5C

Snapshots of the development version are available in Sonatype's snapshots repository.

coinpayments-java requires at minimum Java 8.