Skip to content

Commit 7b73455

Browse files
committed
Update README.md
1 parent 568416a commit 7b73455

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
11
java-bitpay-client
22
==================
3+
4+
This is the Java client library for the BitPay Payment Gateway. This library implements BitPay's new cryptographically-secure API.
5+
6+
Dependencies
7+
------------
8+
BitPay merchant account
9+
10+
ApacheHttpClient
11+
12+
java-json
13+
14+
json-simple
15+
16+
Getting Started
17+
---------------
18+
19+
Log into your BitPay merchant account and generate a Private Key and SIN. Then all you need to do is instantiate a BitPay object, and pass in your private key and the SIN.
20+
21+
```java
22+
String privateKey = KeyUtils.readBitcoreKeyFromFile(privateKeyFile);
23+
ECKey key = KeyUtils.loadKey(privateKey);
24+
this.bitpay = new BitPay(key, SIN);
25+
```
26+
27+
####Create an invoice
28+
```java
29+
Invoice invoice = bitpay.createInvoice(100, "USD");
30+
31+
String invoiceUrl = invoice.getURL();
32+
33+
String status = invoice.getStatus();
34+
```
35+
36+
####Retreive an invoice
37+
```java
38+
invoice = bitpay.getInvoice(invoice.getId());
39+
```
40+
####Exchange Rates
41+
42+
You can also get BitPay's exchange rates.
43+
```java
44+
Rates rates = this.bitpay.getRates();
45+
46+
double rate = rates.getRate("USD");
47+
48+
rates.update();
49+
```
50+
####Advanced Invoices
51+
52+
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.
53+
```java
54+
InvoiceParams params = new InvoiceParams();
55+
56+
params.setBuyerName("Satoshi");
57+
params.setBuyerEmail("[email protected]");
58+
params.setFullNotifications(true);
59+
params.setNotificationEmail("[email protected]");
60+
61+
Invoice invoice = this.bitpay.createInvoice(100, "USD", params);
62+
```
63+
64+
# Support
65+
66+
* https://github.com/bitpay/java-bitpay-client/issues
67+
* https://support.bitpay.com/
68+
69+
# License
70+
71+
The MIT License (MIT)
72+
73+
Copyright (c) 2014 BitPay, Inc.
74+
75+
Permission is hereby granted, free of charge, to any person obtaining a copy
76+
of this software and associated documentation files (the "Software"), to deal
77+
in the Software without restriction, including without limitation the rights
78+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
79+
copies of the Software, and to permit persons to whom the Software is
80+
furnished to do so, subject to the following conditions:
81+
82+
The above copyright notice and this permission notice shall be included in all
83+
copies or substantial portions of the Software.
84+
85+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
86+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
88+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
89+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
90+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
91+
SOFTWARE.

0 commit comments

Comments
 (0)