This is a Java client library for the BitPay Payment Gateway
BitPay merchant account
ApacheHttpClient
java-json
json-simple
Log into your BitPay merchant account and generate an API key. Then all you need to do is instantiate a BitPay object, and pass in your API key and the default currency code.
Bitpay bitpay = new Bitpay("API_KEY", "USD");
####Create an invoice
Invoice invoice = bitpay.createInvoice(100);
String invoiceUrl = invoice.getURL();
String status = invoice.getStatus();
####Retreive an invoice
invoice = bitpay.getInvoice(invoice.getId());
####Exchange Rates
You can also get BitPay's exchange rates.
Rates rates = this.bitpay.getRates();
double rate = rates.getRate("USD");
rates.update();
####Advanced Invoices
You can add additional params to the invoice by passing an InvoiceParams object. You don't have to set all of the advanced parameters. It will only use the ones you do set.
InvoiceParams params = new InvoiceParams();
params.setBuyerName("Satoshi");
params.setBuyerEmail("[email protected]");
params.setFullNotifications(true);
params.setNotificationEmail("[email protected]");
Invoice invoice = this.bitpay.createInvoice(100, params);