public class Payment
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
authorizePayment(java.util.Map paymentData,
ResponseHandler responseHandler)
Authorize a payment, i.e.
|
static Payment |
getInstance() |
static void |
listenForPaymentDataThenSettle(java.util.Map paymentData,
ResponseHandler responseHandler)
This is a convenience request that combines listenForPaymentData and settlePayment
into a single request.
|
static void |
refundPayment(java.lang.String transactionId,
ResponseHandler responseHandler)
Refund a settled payment.
|
static void |
settlePayment(java.util.Map paymentData,
ResponseHandler responseHandler)
Settle a payment: you may call this function either after receiving data from
`hardware.listenForPaymentData` or after receiving data from `payment.authorizePayment`
If called directly after receiving payment data from the hardware, then this immediently
charges the payer.
|
static void |
voidPayment(java.lang.String transactionId,
ResponseHandler responseHandler)
Void an authorized payment.
|
public static Payment getInstance()
public static void authorizePayment(java.util.Map paymentData,
ResponseHandler responseHandler)
paymentData: - a Map with the following format:
{
"payid": {String} "payment id from waitForPaymentData callback"
"dollars": {int}: number of dollars to charge (USD),
"cents": {int, optional, default=0} number of cents to charge (USD)
}responseHandler - public static void settlePayment(java.util.Map paymentData,
ResponseHandler responseHandler)
paymentData - responseHandler - public static void listenForPaymentDataThenSettle(java.util.Map paymentData,
ResponseHandler responseHandler)
paymentData - TODOresponseHandler - public static void refundPayment(java.lang.String transactionId,
ResponseHandler responseHandler)
transactionId: - the transaction id returned from settlePaymentresponseHandler - public static void voidPayment(java.lang.String transactionId,
ResponseHandler responseHandler)
transactionId: - the transaction id returned from authorizePaymentresponseHandler -