|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcontroller.BitPay
public class BitPay
| Field Summary | |
|---|---|
static java.lang.String |
FACADE_MERCHANT
|
static java.lang.String |
FACADE_PAYROLL
|
static java.lang.String |
FACADE_POS
|
static java.lang.String |
FACADE_USER
|
static java.lang.String |
PUBLIC_NO_TOKEN
|
| Constructor Summary | |
|---|---|
BitPay()
Constructor for use if the keys and SIN are managed by this library. |
|
BitPay(com.google.bitcoin.core.ECKey ecKey)
Constructor for use if the keys and SIN were derived external to this library. |
|
BitPay(com.google.bitcoin.core.ECKey ecKey,
java.lang.String clientName)
Constructor for use if the keys and SIN were derived external to this library. |
|
BitPay(com.google.bitcoin.core.ECKey ecKey,
java.lang.String clientName,
java.lang.String envUrl)
Constructor for use if the keys and SIN were derived external to this library. |
|
BitPay(java.lang.String clientName)
Constructor for use if the keys and SIN are managed by this library. |
|
BitPay(java.lang.String clientName,
java.lang.String envUrl)
Constructor for use if the keys and SIN are managed by this library. |
|
| Method Summary | |
|---|---|
void |
authorizeClient(java.lang.String pairingCode)
Authorize this client for use with the BitPay server. |
boolean |
cancelRefundRequest(Invoice invoice,
java.lang.String refundId)
Cancel a previously submitted refund request on a BitPay invoice. |
boolean |
cancelRefundRequest(java.lang.String invoiceId,
java.lang.String refundId)
Cancel a previously submitted refund request on a BitPay invoice. |
boolean |
clientIsAuthorized(java.lang.String facade)
Test whether this client is authorized for a specified level of API access. |
Invoice |
createInvoice(Invoice invoice)
Create a BitPay invoice using the POS facade. |
Invoice |
createInvoice(Invoice invoice,
java.lang.String token)
Create a BitPay invoice. |
java.lang.String |
getAccessToken(java.lang.String id)
Retrieve a token associated with a known resource. |
java.util.List<Refund> |
getAllRefunds(Invoice invoice)
Retrieve all refund requests on a BitPay invoice. |
java.lang.String |
getIdentity()
Get the generated client identity. |
Invoice |
getInvoice(java.lang.String invoiceId)
Retrieve a BitPay invoice by invoice id using the public facade. |
Invoice |
getInvoice(java.lang.String invoiceId,
java.lang.String token)
Retrieve a BitPay invoice by invoice id using the specified facade. |
java.util.List<Invoice> |
getInvoices(java.lang.String dateStart,
java.lang.String dateEnd)
Retrieve a collection of BitPay invoices. |
Rates |
getRates()
Retrieve the exchange rate table maintained by BitPay. |
Refund |
getRefund(Invoice invoice,
java.lang.String refundId)
Retrieve a previously made refund request on a BitPay invoice. |
java.lang.String |
requestClientAuthorization(java.lang.String facade)
Request a pairing code from the BitPay server. |
RefundHelper |
requestRefund(Invoice invoice,
java.lang.String bitcoinAddress,
java.lang.Double amount,
java.lang.String currency)
Request a refund for a BitPay invoice. |
RefundHelper |
requestRefund(java.lang.String invoiceId,
java.lang.String bitcoinAddress)
Request a full refund for a BitPay invoice. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FACADE_MERCHANT
public static final java.lang.String FACADE_PAYROLL
public static final java.lang.String FACADE_POS
public static final java.lang.String FACADE_USER
public static final java.lang.String PUBLIC_NO_TOKEN
| Constructor Detail |
|---|
public BitPay(java.lang.String clientName,
java.lang.String envUrl)
throws BitPayException
clientName - The label for this client.envUrl - The target server URL.
BitPayException
public BitPay(java.lang.String clientName)
throws BitPayException
clientName - The label for this client.
BitPayException
public BitPay()
throws BitPayException
BitPayException
public BitPay(com.google.bitcoin.core.ECKey ecKey,
java.lang.String clientName,
java.lang.String envUrl)
throws BitPayException
ecKey - An elliptical curve key.clientName - The label for this client.envUrl - The target server URL.
BitPayException
public BitPay(com.google.bitcoin.core.ECKey ecKey,
java.lang.String clientName)
throws BitPayException
ecKey - An elliptical curve key.clientName - The label for this client.
BitPayException
public BitPay(com.google.bitcoin.core.ECKey ecKey)
throws BitPayException
ecKey - An elliptical curve key.
BitPayException| Method Detail |
|---|
public java.lang.String getIdentity()
public void authorizeClient(java.lang.String pairingCode)
throws BitPayException
pairingCode - A pairing code generated at https://bitpay.com/dashboard/merchant/api-tokens.
BitPayException
public java.lang.String requestClientAuthorization(java.lang.String facade)
throws BitPayException
facade - Defines the level of API access being requested
BitPayExceptionpublic boolean clientIsAuthorized(java.lang.String facade)
facade - Defines the level of API access being requested.
BitPayException
public java.lang.String getAccessToken(java.lang.String id)
throws BitPayException
id - The identifier for the desired resource.
BitPayException
public Invoice createInvoice(Invoice invoice,
java.lang.String token)
throws BitPayException
invoice - An Invoice object with request parameters defined.token - The resource access token for the request.
BitPayException
public Invoice createInvoice(Invoice invoice)
throws BitPayException
invoice - An Invoice object with request parameters defined.
BitPayException
public Invoice getInvoice(java.lang.String invoiceId)
throws BitPayException
invoiceId - The id of the invoice to retrieve.
BitPayException
public Invoice getInvoice(java.lang.String invoiceId,
java.lang.String token)
throws BitPayException
invoiceId - The id of the invoice to retrieve.token - The facade/invoice token (e.g., pos/invoice) for the invoice.
BitPayException
public java.util.List<Invoice> getInvoices(java.lang.String dateStart,
java.lang.String dateEnd)
throws BitPayException
dateStart - The first date for the query filter.dateEnd - The last date for the query filter.
BitPayException
public RefundHelper requestRefund(java.lang.String invoiceId,
java.lang.String bitcoinAddress)
throws BitPayException
invoiceId - The id of the BitPay invoice for which a refund request should be made.bitcoinAddress - The bitcoin address to which the refund should will be made. If left empty ("") and the invoice contains a refund address then the request may success, otherwise it will fail.
BitPayException
public RefundHelper requestRefund(Invoice invoice,
java.lang.String bitcoinAddress,
java.lang.Double amount,
java.lang.String currency)
throws BitPayException
invoice - A BitPay invoice object for which a refund request should be made. Must have been obtained using the merchant facade.bitcoinAddress - The bitcoin address to which the refund should will be made. If left empty ("") and the invoice contains a refund address then the request may success, otherwise it will fail.amount - The amount of money to refund. If zero then a request for 100% of the invoice value is created.currency - The three digit currency code specifying the exchange rate to use when calculating the refund bitcoin amount. If this value is "BTC" then no exchange rate calculation is performed.
BitPayException
public boolean cancelRefundRequest(java.lang.String invoiceId,
java.lang.String refundId)
throws BitPayException
invoiceId - The BitPay invoiceId having the associated refund to be canceled.refundId - The refund id for the refund to be canceled.
BitPayException
public boolean cancelRefundRequest(Invoice invoice,
java.lang.String refundId)
throws BitPayException
invoice - The BitPay invoice having the associated refund to be canceled. Must have been obtained using the merchant facade.refundId - The refund id for the refund to be canceled.
BitPayException
public Refund getRefund(Invoice invoice,
java.lang.String refundId)
throws BitPayException
invoice - The BitPay invoice having the associated refund.refundId - The refund id for the refund to be updated with new status.
BitPayException
public java.util.List<Refund> getAllRefunds(Invoice invoice)
throws BitPayException
invoice - The BitPay invoice object having the associated refunds.
BitPayException
public Rates getRates()
throws BitPayException
BitPayException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||