Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
Transaction Class Reference
Inheritance diagram for Transaction:
CPBaseParcel BaseParcel

Classes

enum  ManualPromptOption
 

Public Member Functions

 Transaction (String type)
 
 Transaction (String type, String invoiceId)
 
String getOriginator ()
 
void setOriginator (String originator)
 
String getAcquirerMerchantId ()
 
void setAcquirerMerchantId (String acquirerMerchantId)
 
String getAcquirerTerminalId ()
 
void setAcquirerTerminalId (String acquirerTerminalId)
 
String getAcquirerId ()
 
void setAcquirerId (String acquirerId)
 
String getGatewayMerchantId ()
 
void setGatewayMerchantId (String gatewayMerchantId)
 
String getGatewayTerminalId ()
 
void setGatewayTerminalId (String gatewayTerminalId)
 
void setInvoiceId (String invoiceId)
 
String getInvoiceId ()
 
void setTransactionId (String transactionId)
 
String getTransactionId ()
 
void setReferenceTransactionId (String transactionId)
 
String getReferemceTransactionId ()
 
void setVenue (String venue)
 
String getVenue ()
 
void setLane (String lane)
 
String getLane ()
 
void setCashierId (String cashierId)
 
String getCashierId ()
 
void setCashierDisplayName (String cashierDisplayName)
 
String getCashierDisplayName ()
 
void setAmount (BigDecimal amount)
 
BigDecimal getAmount ()
 
void setTaxAmount (BigDecimal taxAmount)
 
BigDecimal getTaxAmount ()
 
void setGratuityAmount (BigDecimal gratuityAmount)
 
BigDecimal getGratuityAmount ()
 
void setDonationAmount (BigDecimal donationAmount)
 
BigDecimal getDonationAmount ()
 
void setAmountTotals (@Nullable final AmountTotals amountTotals)
 
AmountTotals getAmountTotals ()
 
void setCurrency (String currency)
 
String getCurrency ()
 
void setAllowsManualEntry (boolean allowsManualEntry)
 
boolean getAllowsManualEntry ()
 
void setManualPromptOptions (ManualPromptOption[] manualPromptOptions)
 
ManualPromptOption [] getManualPromptOptions ()
 
void setTransactionType (String transactionType)
 
String getTransactionType ()
 
void setCustomerPhoneNumber (String customerPhoneNumber)
 
String getCustomerPhoneNumber ()
 
void setCustomerEmail (String customerEmail)
 
String getCustomerEmail ()
 
ArrayList< PaymentgetPayments ()
 
void setPayments (ArrayList< Payment > payments)
 
String getResult ()
 
Basket getBasket ()
 
void setBasket (Basket basket)
 
Transaction getReferenceTransaction ()
 
void setReferenceTransaction (Transaction referenceTransaction)
 
Integer getShiftId ()
 
void setShiftId (Integer shiftId)
 
void merge (Transaction other, boolean aggressively)
 
 Transaction (Parcel in, int parcelVersion)
 
void setParcelVersion (int targetParcelVersion)
 
void writeToParcel (Parcel dest, int flags)
 
JSONObject getAsJsonObject () throws JSONException
 
- Public Member Functions inherited from CPBaseParcel
 CPBaseParcel (Parcel in, int parcelVersion)
 
- Public Member Functions inherited from BaseParcel
 BaseParcel (Parcel in, int parcelVersion)
 
void setParcelVersion (int targetParcelVersion)
 
final int getParcelVersion ()
 
String getClassName ()
 
void writeToParcel (Parcel dest, int flags)
 
int describeContents ()
 

Static Public Attributes

static final String PAYMENT_TYPE = "TRANSACTION_PAYMENT_TYPE"
 
static final String REFUND_TYPE = "TRANSACTION_REFUND_TYPE"
 
static final String VOID_TYPE = "TRANSACTION_VOID_TYPE"
 
static final String PRE_AUTHORISATION_TYPE = "TRANSACTION_PRE_AUTHORISATION_TYPE"
 
static final String PRE_AUTHORISATION_COMPLETION_TYPE
 
static final String DEFERRED_PAYMENT_TYPE = "TRANSACTION_DEFERRED_PAYMENT_TYPE"
 
static final String DEFERRED_PAYMENT_COMPLETION_TYPE
 
static final String RESULT_SUCCESS = "SUCCESS"
 
static final String RESULT_CANCELLED = "CANCELLED"
 
static final String ORIGINATOR_PAYMENT_APPLICATION = "PAYMENT_APPLICATION"
 
static final String ORIGINATOR_COMMERCE_APPLICATION = "CP_APPLICATION"
 
static final Creator< TransactionCREATOR
 
- Static Public Attributes inherited from BaseParcel
static final Parcelable.Creator< BaseParcelCREATOR
 

Additional Inherited Members

- Static Public Member Functions inherited from CPBaseParcel
static< CPEntityType extends CPBaseParcel > CPEntityType buildFromCpJson ( @NonNull JSONObject jsonObject, @NonNull Class< CPEntityType > clazz, @Nullable CPEntityType parentObject)
 
- Protected Member Functions inherited from CPBaseParcel
abstract< CPEntityType extends CPBaseParcel > CPEntityType buildFromCpJson ( @NonNull JSONObject jsonObject, @Nullable CPEntityType parentObject)
 
- Static Protected Member Functions inherited from CPBaseParcel
static< CPEntityType extends CPBaseParcel > ArrayList< CPEntityType > buildListFromCpJson ( @NonNull JSONObject jsonObject, @NonNull Class< CPEntityType > clazz, @NonNull String targetJsonAlias)
 
- Static Protected Member Functions inherited from BaseParcel
static void safelySetParcelVersion (final int targetParcelVersion, @Nullable BaseParcel item)
 
static void safelySetParcelVersion (final int targetParcelVersion, @Nullable List<? extends BaseParcel > items)
 
static< T extends BaseParcel > void safelySetParcelVersion (final int targetParcelVersion, @Nullable T[] items)
 

Detailed Description

This represents the data that is shared between the terminal and the Android application. Setting the fields is only relevant when sending the data to the terminal, and conversely, getting the fields is only relevant when receiving this object from the terminal.

A word on subtotals. In North America, we automatically calculate the subtotal by subtracting tax and gratuity from the total amount, but leaving donation amounts included.

Definition at line 37 of file Transaction.java.

Constructor & Destructor Documentation

◆ Transaction() [1/2]

Transaction ( String  type)

Create a new transaction with a type and auto-generated invoiceId.

Definition at line 138 of file Transaction.java.

◆ Transaction() [2/2]

Transaction ( String  type,
String  invoiceId 
)

Create a new transaction with a type and invoiceId.

Definition at line 145 of file Transaction.java.

Member Function Documentation

◆ getAcquirerId()

String getAcquirerId ( )

Get the ID for the acquirer if available, otherwise returns null.

Definition at line 203 of file Transaction.java.

◆ getAcquirerMerchantId()

String getAcquirerMerchantId ( )

Get the acquirer's merchant ID if available, otherwise returns null.

Definition at line 181 of file Transaction.java.

◆ getAcquirerTerminalId()

String getAcquirerTerminalId ( )

Get the acquirer's terminal ID if available, otherwise returns null.

Definition at line 192 of file Transaction.java.

◆ getAllowsManualEntry()

boolean getAllowsManualEntry ( )

◆ getAmount()

BigDecimal getAmount ( )

Refer to setAmount(BigDecimal amount)

Definition at line 351 of file Transaction.java.

◆ getAmountTotals()

AmountTotals getAmountTotals ( )

Creates a new AmountTotals object based off of the current values. See setAmountTotals(AmountTotals).

Definition at line 425 of file Transaction.java.

◆ getBasket()

Basket getBasket ( )

The basket currently associated with the transaction. The actual object may update over time as it is changed through the AIDL communications with the service and updated by the Basket Manager, but the contents will stay intact.

Definition at line 552 of file Transaction.java.

◆ getCashierDisplayName()

String getCashierDisplayName ( )

◆ getCashierId()

String getCashierId ( )

Refer to setCashierId(String cashierId)

Definition at line 319 of file Transaction.java.

◆ getCurrency()

String getCurrency ( )

Refer to setCurrency(String currency)

Definition at line 442 of file Transaction.java.

◆ getCustomerEmail()

String getCustomerEmail ( )

Refer to setCustomerEmail(String customerEmail)

Definition at line 522 of file Transaction.java.

◆ getCustomerPhoneNumber()

String getCustomerPhoneNumber ( )

◆ getDonationAmount()

BigDecimal getDonationAmount ( )

◆ getGatewayMerchantId()

String getGatewayMerchantId ( )

Get the gateway's merchant ID if available, otherwise returns null.

Definition at line 214 of file Transaction.java.

◆ getGatewayTerminalId()

String getGatewayTerminalId ( )

Get the gateway's terminal ID if available, otherwise returns null.

Definition at line 225 of file Transaction.java.

◆ getGratuityAmount()

BigDecimal getGratuityAmount ( )

◆ getInvoiceId()

String getInvoiceId ( )

Refer to setInvoiceId(String invoice)

Definition at line 245 of file Transaction.java.

◆ getLane()

String getLane ( )

Refer to setLane(String lane)

Definition at line 305 of file Transaction.java.

◆ getManualPromptOptions()

ManualPromptOption [] getManualPromptOptions ( )

◆ getOriginator()

String getOriginator ( )

◆ getPayments()

ArrayList<Payment> getPayments ( )

The payments applied to the transaction amount in the order they are initiated. This will update throughout the transaction, as the payment application may handle multiple tenders, or other applications may contribute alternate forms of payment.

Definition at line 531 of file Transaction.java.

◆ getReferemceTransactionId()

String getReferemceTransactionId ( )

The ID of a referenced transaction. Generally useful in the case of VOID or PRE_AUTHORISATION, referencing the original transaction as the reference transaction for voiding or completing.

Definition at line 277 of file Transaction.java.

◆ getReferenceTransaction()

Transaction getReferenceTransaction ( )

A reference transaction. Generally useful in the case of VOID or PRE_AUTHORISATION, include the original transaction as the reference transaction for voiding or completing.

Definition at line 568 of file Transaction.java.

◆ getResult()

String getResult ( )

The final result of the transaction, either RESULT_SUCCESS or RESULT_CANCELLED.

Definition at line 543 of file Transaction.java.

◆ getTaxAmount()

BigDecimal getTaxAmount ( )

Refer to setTaxAmount(BigDecimal taxAmount)

Definition at line 367 of file Transaction.java.

◆ getTransactionId()

String getTransactionId ( )

Refer to setTransactionId(String transactionId)

Definition at line 261 of file Transaction.java.

◆ getTransactionType()

String getTransactionType ( )

Refer to setTransactionType(String transactionType)

Definition at line 490 of file Transaction.java.

◆ getVenue()

String getVenue ( )

Refer to setVenue(String venue)

Definition at line 291 of file Transaction.java.

◆ merge()

void merge ( Transaction  other,
boolean  aggressively 
)

Merge in the values from the other item, useful when re-synchronizing copied data. Use aggressively if current valid values should be overriden by the other item.

Definition at line 591 of file Transaction.java.

◆ setAllowsManualEntry()

void setAllowsManualEntry ( boolean  allowsManualEntry)

Determines if the payment application on the terminal will accept manual entry of card data for payment. Defaults to false.

Definition at line 450 of file Transaction.java.

◆ setAmount()

void setAmount ( BigDecimal  amount)

The total amount of the transaction to be paid by the customer as a GAAP-standard BigDecimal. This amount may change throughout the transaction depending on basket modifications, discounts, offers, or other interactions by other applications. This is required.

Definition at line 344 of file Transaction.java.

◆ setAmountTotals()

void setAmountTotals ( @Nullable final AmountTotals  amountTotals)

Allows updating all of the totals at once. If null, resets the amounts back to their default values.

Definition at line 409 of file Transaction.java.

◆ setBasket()

void setBasket ( Basket  basket)

Refer to getBasket().

Definition at line 559 of file Transaction.java.

◆ setCashierDisplayName()

void setCashierDisplayName ( String  cashierDisplayName)

The display name of the cashier, to be used when printing the receipt or otherwise displaying cashier information. This is optional.

Definition at line 327 of file Transaction.java.

◆ setCashierId()

void setCashierId ( String  cashierId)

The ID of the cashier. This is optional.

Definition at line 312 of file Transaction.java.

◆ setCurrency()

void setCurrency ( String  currency)

The base currency for the transaction. This value should not change after the transaction is started. This is required.

Definition at line 435 of file Transaction.java.

◆ setCustomerEmail()

void setCustomerEmail ( String  customerEmail)

The email address of the customer. This may be added during or after the transaction. This is optional.

Definition at line 514 of file Transaction.java.

◆ setCustomerPhoneNumber()

void setCustomerPhoneNumber ( String  customerPhoneNumber)

The phone number of the customer. This may be added during or after the transaction. This is optional.

Definition at line 498 of file Transaction.java.

◆ setDonationAmount()

void setDonationAmount ( BigDecimal  donationAmount)

The total donation amount as a GAAP-standard BigDecimal. This amount may change throughout the transaction depending on basket modifications, discounts, offers, or other interactions by other applications. This is optional.

Definition at line 393 of file Transaction.java.

◆ setGratuityAmount()

void setGratuityAmount ( BigDecimal  gratuityAmount)

The total tip/gratuity amount as a GAAP-standard BigDecimal. This amount may change throughout the transaction depending on basket modifications, discounts, offers, or other interactions by other applications. This is optional.

Definition at line 376 of file Transaction.java.

◆ setInvoiceId()

void setInvoiceId ( String  invoiceId)

The ID of the invoice. This is generated by the system if not provided, and cannot be changed. The Invoice is an abstract structure containing relevant transactions, a basket, and payments.

Definition at line 238 of file Transaction.java.

◆ setLane()

void setLane ( String  lane)

The ID of the lane for this device. This is optional.

Definition at line 298 of file Transaction.java.

◆ setManualPromptOptions()

void setManualPromptOptions ( ManualPromptOption []  manualPromptOptions)

Sets the manual prompt options desired. Meaningful only when allowsManualEntry is true.

Definition at line 465 of file Transaction.java.

◆ setReferenceTransaction()

void setReferenceTransaction ( Transaction  referenceTransaction)

Refer to getReferenceTransaction().

Definition at line 575 of file Transaction.java.

◆ setReferenceTransactionId()

void setReferenceTransactionId ( String  transactionId)

Refer to getReferemceTransactionId().

Definition at line 268 of file Transaction.java.

◆ setTaxAmount()

void setTaxAmount ( BigDecimal  taxAmount)

The total tax amount applied as a GAAP-standard BigDecimal. This amount may change throughout the transaction depending on basket modifications, discounts, offers, or other interactions by other applications. This is optional.

Definition at line 360 of file Transaction.java.

◆ setTransactionId()

void setTransactionId ( String  transactionId)

Sets the ID for this transaction. This is generated by the system if not provided, and cannot be changed. This is primarily used for audit purposes.

Definition at line 253 of file Transaction.java.

◆ setTransactionType()

void setTransactionType ( String  transactionType)

Type of payment transaction the Payment Application is executing. The underlying service will automatically determine this based on the methods used to start the transaction if this is not provided.

Definition at line 482 of file Transaction.java.

◆ setVenue()

void setVenue ( String  venue)

The ID of the venue. This is optional.

Definition at line 284 of file Transaction.java.

Member Data Documentation

◆ CREATOR

final Creator<Transaction> CREATOR
static
Initial value:
=
new Transaction.ParcelCreator<Transaction>() {
@Override
public Transaction createFromParcel(Parcel source) {
BaseParcel createdObject = super.createFromParcel(source);
if (createdObject == null || !Transaction.class.isInstance(createdObject)) {
return new Transaction(source, getRecommendedParcelVersion());
} else {
return (Transaction) createdObject;
}
}
@Override
public Transaction[] newArray(int size) {
return new Transaction[size];
}
}

Definition at line 766 of file Transaction.java.

◆ DEFERRED_PAYMENT_COMPLETION_TYPE

final String DEFERRED_PAYMENT_COMPLETION_TYPE
static
Initial value:
=
"TRANSACTION_DEFERRED_PAYMENT_COMPLETION_TYPE"

Not currently supported. Finish a deferred payment plan.

Definition at line 66 of file Transaction.java.

◆ DEFERRED_PAYMENT_TYPE

final String DEFERRED_PAYMENT_TYPE = "TRANSACTION_DEFERRED_PAYMENT_TYPE"
static

Not currently supported. Begin or continue a deferred payment plan.

Definition at line 62 of file Transaction.java.

◆ ORIGINATOR_COMMERCE_APPLICATION

final String ORIGINATOR_COMMERCE_APPLICATION = "CP_APPLICATION"
static

The identifier for a Commerce Applcation as the originator of a transaction. This includes POS applications.

Definition at line 87 of file Transaction.java.

◆ ORIGINATOR_PAYMENT_APPLICATION

final String ORIGINATOR_PAYMENT_APPLICATION = "PAYMENT_APPLICATION"
static

The identifier for the payment application on the terminal as the originator of a transaction.

Definition at line 82 of file Transaction.java.

◆ PAYMENT_TYPE

final String PAYMENT_TYPE = "TRANSACTION_PAYMENT_TYPE"
static

A direct payment, attempting to collect the funds in full at once.

Definition at line 41 of file Transaction.java.

◆ PRE_AUTHORISATION_COMPLETION_TYPE

final String PRE_AUTHORISATION_COMPLETION_TYPE
static
Initial value:
=
"TRANSACTION_PRE_AUTHORISATION_COMPLETION_TYPE"

Completes a pre-authorisation

Definition at line 57 of file Transaction.java.

◆ PRE_AUTHORISATION_TYPE

final String PRE_AUTHORISATION_TYPE = "TRANSACTION_PRE_AUTHORISATION_TYPE"
static

Authorizes an amount to be completed at a later time.

Definition at line 53 of file Transaction.java.

◆ REFUND_TYPE

final String REFUND_TYPE = "TRANSACTION_REFUND_TYPE"
static

A refund for a specific payment.

Definition at line 45 of file Transaction.java.

◆ RESULT_CANCELLED

final String RESULT_CANCELLED = "CANCELLED"
static

The final result for a transaction that was cancelled.

Definition at line 76 of file Transaction.java.

◆ RESULT_SUCCESS

final String RESULT_SUCCESS = "SUCCESS"
static

The final result for a successful transaction.

Definition at line 72 of file Transaction.java.

◆ VOID_TYPE

final String VOID_TYPE = "TRANSACTION_VOID_TYPE"
static

Used to void a transaction.

Definition at line 49 of file Transaction.java.


The documentation for this class was generated from the following file:

This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.