public class PaymentRequest extends GenericParcelable implements Validator, JSONifiable
Modifier and Type | Class and Description |
---|---|
static interface |
PaymentRequest.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<PaymentRequest> |
CREATOR |
static JSONifiable.Creator<PaymentRequest> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
PaymentRequest()
Constructs a new empty instance.
|
protected |
PaymentRequest(boolean noInit)
Constructs a new empty instance.
|
|
PaymentRequest(JSONObject jsonObject)
Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
reflected in this instance and vice-versa.
|
|
PaymentRequest(PaymentRequest src)
Constructs a new instance that is a deep copy of the source instance.
|
|
PaymentRequest(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAmount()
Clears the 'amount' field, the 'has' method for this field will now return false
|
void |
clearAuthorizationCode()
Clears the 'authorizationCode' field, the 'has' method for this field will now return false
|
void |
clearCard()
Clears the 'card' field, the 'has' method for this field will now return false
|
void |
clearCashBackAmount()
Clears the 'cashBackAmount' field, the 'has' method for this field will now return false
|
void |
clearCashTendered()
Clears the 'cashTendered' field, the 'has' method for this field will now return false
|
void |
clearEmployeeId()
Clears the 'employeeId' field, the 'has' method for this field will now return false
|
void |
clearEmployeeName()
Clears the 'employeeName' field, the 'has' method for this field will now return false
|
void |
clearExternalPaymentId()
Clears the 'externalPaymentId' field, the 'has' method for this field will now return false
|
void |
clearId()
Clears the 'id' field, the 'has' method for this field will now return false
|
void |
clearLineItems()
Clears the 'lineItems' field, the 'has' method for this field will now return false
|
void |
clearOrderId()
Clears the 'orderId' field, the 'has' method for this field will now return false
|
void |
clearServiceChargeAmount()
Clears the 'serviceChargeAmount' field, the 'has' method for this field will now return false
|
void |
clearSinglePayToken()
Clears the 'singlePayToken' field, the 'has' method for this field will now return false
|
void |
clearTaxableAmountRates()
Clears the 'taxableAmountRates' field, the 'has' method for this field will now return false
|
void |
clearTaxAmount()
Clears the 'taxAmount' field, the 'has' method for this field will now return false
|
void |
clearTender()
Clears the 'tender' field, the 'has' method for this field will now return false
|
void |
clearTimestamp()
Clears the 'timestamp' field, the 'has' method for this field will now return false
|
void |
clearTipAmount()
Clears the 'tipAmount' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
PaymentRequest |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
Long |
getAmount()
Total amount paid
|
String |
getAuthorizationCode()
Used for voice authorization for credit cards
|
PaymentRequestCardDetails |
getCard() |
Long |
getCashBackAmount() |
Long |
getCashTendered()
Cash tendered
|
String |
getEmployeeId()
Employee ID
|
String |
getEmployeeName()
Employee name
|
String |
getExternalPaymentId()
External payment ID when using custom tender
|
protected GenericClient |
getGenericClient() |
String |
getId()
Unique identifier
|
JSONObject |
getJSONObject()
Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
reflected in this instance and vice-versa.
|
List<LineItemPayment> |
getLineItems()
Payments that were made for this line item
|
String |
getOrderId()
Unique identifier of the order with which this payment is associated
|
ServiceChargeAmount |
getServiceChargeAmount() |
Boolean |
getSinglePayToken() |
List<TaxableAmountRate> |
getTaxableAmountRates() |
Long |
getTaxAmount()
Amount paid in tax (TBD: sales tax only?)
|
Tender |
getTender()
The tender type associated with this payment, e.g.
|
Long |
getTimestamp()
Request timestamp
|
Long |
getTipAmount()
Amount paid in tips
|
boolean |
hasAmount()
Checks whether the 'amount' field has been set, however the value could be null
|
boolean |
hasAuthorizationCode()
Checks whether the 'authorizationCode' field has been set, however the value could be null
|
boolean |
hasCard()
Checks whether the 'card' field has been set, however the value could be null
|
boolean |
hasCashBackAmount()
Checks whether the 'cashBackAmount' field has been set, however the value could be null
|
boolean |
hasCashTendered()
Checks whether the 'cashTendered' field has been set, however the value could be null
|
boolean |
hasEmployeeId()
Checks whether the 'employeeId' field has been set, however the value could be null
|
boolean |
hasEmployeeName()
Checks whether the 'employeeName' field has been set, however the value could be null
|
boolean |
hasExternalPaymentId()
Checks whether the 'externalPaymentId' field has been set, however the value could be null
|
boolean |
hasId()
Checks whether the 'id' field has been set, however the value could be null
|
boolean |
hasLineItems()
Checks whether the 'lineItems' field has been set, however the value could be null
|
boolean |
hasOrderId()
Checks whether the 'orderId' field has been set, however the value could be null
|
boolean |
hasServiceChargeAmount()
Checks whether the 'serviceChargeAmount' field has been set, however the value could be null
|
boolean |
hasSinglePayToken()
Checks whether the 'singlePayToken' field has been set, however the value could be null
|
boolean |
hasTaxableAmountRates()
Checks whether the 'taxableAmountRates' field has been set, however the value could be null
|
boolean |
hasTaxAmount()
Checks whether the 'taxAmount' field has been set, however the value could be null
|
boolean |
hasTender()
Checks whether the 'tender' field has been set, however the value could be null
|
boolean |
hasTimestamp()
Checks whether the 'timestamp' field has been set, however the value could be null
|
boolean |
hasTipAmount()
Checks whether the 'tipAmount' field has been set, however the value could be null
|
boolean |
isNotEmptyLineItems()
Checks whether the 'lineItems' field is set and is not null and is not empty
|
boolean |
isNotEmptyTaxableAmountRates()
Checks whether the 'taxableAmountRates' field is set and is not null and is not empty
|
boolean |
isNotNullAmount()
Checks whether the 'amount' field is set and is not null
|
boolean |
isNotNullAuthorizationCode()
Checks whether the 'authorizationCode' field is set and is not null
|
boolean |
isNotNullCard()
Checks whether the 'card' field is set and is not null
|
boolean |
isNotNullCashBackAmount()
Checks whether the 'cashBackAmount' field is set and is not null
|
boolean |
isNotNullCashTendered()
Checks whether the 'cashTendered' field is set and is not null
|
boolean |
isNotNullEmployeeId()
Checks whether the 'employeeId' field is set and is not null
|
boolean |
isNotNullEmployeeName()
Checks whether the 'employeeName' field is set and is not null
|
boolean |
isNotNullExternalPaymentId()
Checks whether the 'externalPaymentId' field is set and is not null
|
boolean |
isNotNullId()
Checks whether the 'id' field is set and is not null
|
boolean |
isNotNullLineItems()
Checks whether the 'lineItems' field is set and is not null
|
boolean |
isNotNullOrderId()
Checks whether the 'orderId' field is set and is not null
|
boolean |
isNotNullServiceChargeAmount()
Checks whether the 'serviceChargeAmount' field is set and is not null
|
boolean |
isNotNullSinglePayToken()
Checks whether the 'singlePayToken' field is set and is not null
|
boolean |
isNotNullTaxableAmountRates()
Checks whether the 'taxableAmountRates' field is set and is not null
|
boolean |
isNotNullTaxAmount()
Checks whether the 'taxAmount' field is set and is not null
|
boolean |
isNotNullTender()
Checks whether the 'tender' field is set and is not null
|
boolean |
isNotNullTimestamp()
Checks whether the 'timestamp' field is set and is not null
|
boolean |
isNotNullTipAmount()
Checks whether the 'tipAmount' field is set and is not null
|
void |
mergeChanges(PaymentRequest src)
Copy all the changed fields from the given source to this instance.
|
void |
resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
|
PaymentRequest |
setAmount(Long amount)
Sets the field 'amount'.
|
PaymentRequest |
setAuthorizationCode(String authorizationCode)
Sets the field 'authorizationCode'.
|
PaymentRequest |
setCard(PaymentRequestCardDetails card)
Sets the field 'card'.
|
PaymentRequest |
setCashBackAmount(Long cashBackAmount)
Sets the field 'cashBackAmount'.
|
PaymentRequest |
setCashTendered(Long cashTendered)
Sets the field 'cashTendered'.
|
PaymentRequest |
setEmployeeId(String employeeId)
Sets the field 'employeeId'.
|
PaymentRequest |
setEmployeeName(String employeeName)
Sets the field 'employeeName'.
|
PaymentRequest |
setExternalPaymentId(String externalPaymentId)
Sets the field 'externalPaymentId'.
|
PaymentRequest |
setId(String id)
Sets the field 'id'.
|
PaymentRequest |
setLineItems(List<LineItemPayment> lineItems)
Sets the field 'lineItems'.
|
PaymentRequest |
setOrderId(String orderId)
Sets the field 'orderId'.
|
PaymentRequest |
setServiceChargeAmount(ServiceChargeAmount serviceChargeAmount)
Sets the field 'serviceChargeAmount'.
|
PaymentRequest |
setSinglePayToken(Boolean singlePayToken)
Sets the field 'singlePayToken'.
|
PaymentRequest |
setTaxableAmountRates(List<TaxableAmountRate> taxableAmountRates)
Sets the field 'taxableAmountRates'.
|
PaymentRequest |
setTaxAmount(Long taxAmount)
Sets the field 'taxAmount'.
|
PaymentRequest |
setTender(Tender tender)
Sets the field 'tender'.
|
PaymentRequest |
setTimestamp(Long timestamp)
Sets the field 'timestamp'.
|
PaymentRequest |
setTipAmount(Long tipAmount)
Sets the field 'tipAmount'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<PaymentRequest> CREATOR
public static final JSONifiable.Creator<PaymentRequest> JSON_CREATOR
public PaymentRequest()
protected PaymentRequest(boolean noInit)
public PaymentRequest(String json) throws IllegalArgumentException
IllegalArgumentException
public PaymentRequest(JSONObject jsonObject)
public PaymentRequest(PaymentRequest src)
public String getId()
public String getOrderId()
public Long getTimestamp()
public Tender getTender()
public Long getAmount()
public Long getTipAmount()
public Long getTaxAmount()
public Long getCashBackAmount()
public Long getCashTendered()
public String getEmployeeId()
public String getEmployeeName()
public String getAuthorizationCode()
public String getExternalPaymentId()
public ServiceChargeAmount getServiceChargeAmount()
public Boolean getSinglePayToken()
public List<TaxableAmountRate> getTaxableAmountRates()
public List<LineItemPayment> getLineItems()
public PaymentRequestCardDetails getCard()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullId()
public boolean isNotNullOrderId()
public boolean isNotNullTimestamp()
public boolean isNotNullTender()
public boolean isNotNullAmount()
public boolean isNotNullTipAmount()
public boolean isNotNullTaxAmount()
public boolean isNotNullCashBackAmount()
public boolean isNotNullCashTendered()
public boolean isNotNullEmployeeId()
public boolean isNotNullEmployeeName()
public boolean isNotNullAuthorizationCode()
public boolean isNotNullExternalPaymentId()
public boolean isNotNullServiceChargeAmount()
public boolean isNotNullSinglePayToken()
public boolean isNotNullTaxableAmountRates()
public boolean isNotEmptyTaxableAmountRates()
public boolean isNotNullLineItems()
public boolean isNotEmptyLineItems()
public boolean isNotNullCard()
public boolean hasId()
public boolean hasOrderId()
public boolean hasTimestamp()
public boolean hasTender()
public boolean hasAmount()
public boolean hasTipAmount()
public boolean hasTaxAmount()
public boolean hasCashBackAmount()
public boolean hasCashTendered()
public boolean hasEmployeeId()
public boolean hasEmployeeName()
public boolean hasAuthorizationCode()
public boolean hasExternalPaymentId()
public boolean hasServiceChargeAmount()
public boolean hasSinglePayToken()
public boolean hasTaxableAmountRates()
public boolean hasLineItems()
public boolean hasCard()
public PaymentRequest setId(String id)
public PaymentRequest setOrderId(String orderId)
public PaymentRequest setTimestamp(Long timestamp)
public PaymentRequest setTender(Tender tender)
public PaymentRequest setAmount(Long amount)
public PaymentRequest setTipAmount(Long tipAmount)
public PaymentRequest setTaxAmount(Long taxAmount)
public PaymentRequest setCashBackAmount(Long cashBackAmount)
public PaymentRequest setCashTendered(Long cashTendered)
public PaymentRequest setEmployeeId(String employeeId)
public PaymentRequest setEmployeeName(String employeeName)
public PaymentRequest setAuthorizationCode(String authorizationCode)
public PaymentRequest setExternalPaymentId(String externalPaymentId)
public PaymentRequest setServiceChargeAmount(ServiceChargeAmount serviceChargeAmount)
public PaymentRequest setSinglePayToken(Boolean singlePayToken)
public PaymentRequest setTaxableAmountRates(List<TaxableAmountRate> taxableAmountRates)
public PaymentRequest setLineItems(List<LineItemPayment> lineItems)
public PaymentRequest setCard(PaymentRequestCardDetails card)
public void clearId()
public void clearOrderId()
public void clearTimestamp()
public void clearTender()
public void clearAmount()
public void clearTipAmount()
public void clearTaxAmount()
public void clearCashBackAmount()
public void clearCashTendered()
public void clearEmployeeId()
public void clearEmployeeName()
public void clearAuthorizationCode()
public void clearExternalPaymentId()
public void clearServiceChargeAmount()
public void clearSinglePayToken()
public void clearTaxableAmountRates()
public void clearLineItems()
public void clearCard()
public boolean containsChanges()
public void resetChangeLog()
public PaymentRequest copyChanges()
public void mergeChanges(PaymentRequest src)