Response and Request Objects
In this article
Request
A request object is sent in all EFT transaction functions, each with its own request type. These types are:
- BaseRequest: Base for other request types.
- PaymentRequest: Only specific values needed to initiate a purchase, full-capture for a given amount.
- RefundRequest: Only specific values needed to initiate a refund request. Those PSPs that support referenced refund need information of the previously given purchase respond.
- VoidRequest: Only specific values needed to initiate a void request. Some PSPs only support void for the last successful purchase (or refund) function.
- FinalizePreAuthRequest: Specific details needed of the previous pre-authorization.
BaseRequest
- TransactionId
- A mandatory ID that references the transaction on the client side. In many plugins it is forwarded as an ID of the transaction to the terminal gateway.
- AmountBreakdown
- See below
- ManualEntry
- Activate manual entry for a card on the PED. Not supported by all PSPs
- Token
- If PSP supports EFT functions initiation with a Token (Card reference).
AmountBreakdown
This is an object sent to LS Pay in a request and is returned in the response object (TransactionResponse). It is, however, not guaranteed that the response includes the same information that was sent in the request.
Note: Information from the response should be used and the received amounts from LS Pay to be displayed or for storing.
- TotalAmount
- This is the total amount to be charged from the card, and the only amount that is required when sending in a transaction. The other amounts are optional and could be treated differently, depending on the PSP.
- TaxAmount
- The total tax amount in the transaction, the amount is included in the total amount.
- CashBackAmount
- The amount to be given back as cash, the amount is included in the total amount.
- SurchargeAmount
- A surcharge, also known as checkout fee, is an extra fee charged by a merchant when receiving a payment by check, credit card, charge card, or debit card (but not cash). This amount covers the cost to the merchant of accepting that means of payment, such as the merchant service fee imposed by a credit card company. This amount is included in the total amount.
- TipAmount
- The amount that the customer tipped. This can be empty when sent in, but if added on the device LS Pay will return a value here. If included, the amount is included in the total amount in the response.
- CurrencyCode
- The currency code is not always used, it depends on the PSP device. The currency inserted might be discarded in the payment process.
Note: Check the response to establish the currency used for the transaction.
- The currency code is not always used, it depends on the PSP device. The currency inserted might be discarded in the payment process.
Response
The response will include all information provided by the PSP. Only one type of response will be returned by the EFT functions in LS Pay, TransactionResponse.
TransactionResponse:
- Ids
- See description above.
- CardDetails
- See description below
- BatchNumber
- Supplied by the PSP. This is a collection of transactions, for instance within a day. Added for reconciliation purposes.
- AuthorizationStatus
- An enum stating the status of the transaction, can be: Approved, Declined, Cancelled, UserRejected, or None.
- ResultCode
- Is an enum: Success; or Error
- The result code indicates if the request was processed correctly or if the PED reported an error. Errors from within the LS Pay Engine are usually thrown as exceptions. If the communication with the PED is working but it reports some error in the request, this field is set to Error. Additional information can be found in the EFTMessage field of the response.
Note: This cannot be used as information about the result of the request. This will show success even though the transaction has been declined. This only conveys information about errors in the process.
- AmountBreakdown
- Same object as in the request but LS Pay might have changed some values.
Important: Use the response.AmountBreakdown.
- Same object as in the request but LS Pay might have changed some values.
- EftMessage
- A message from the PSP. Can be displayed as a message in the POS but will be unhandled by LS Pay, no localization or translations.
- VerificationMethod
- This is an enum and can be: None, Signature, OnlinePin, OfflinePIN, OnlinePinAndSignature, OfflinePINAndSignature, or Unknown.
- This displays what type of verification was used for the customer to verify the transaction.
- CustomerReceipt
- Of the type
Receipt
, a list of objects called ReceiptLine (see ReceiptLines below). - The receipt should always be certified on the LS Pay side.
Important: Do not change unless there is a need to re-certify the receipt part. - See the API documentation for Receipt.
- Receipts are usually optional when printing, but sometimes they are mandatory. Check by calling
IsMandatory
in the receipt object.
- Of the type
- MerchantReceipt
- Of the type
Receipt
, a list of objects called ReceiptLine (see ReceiptLines below). - The receipt should always be certified on the LS Pay side.
Important: Do not change unless there is a need to re-certify the receipt part. - See the API documentation for Receipt.
- Receipts are usually optional when printing, but sometimes they are mandatory. Check by calling
IsMandatory
in the receipt object.
- Of the type
- TenderType
- This is an enum and can be: Unknown, Credit, Debit, or GiftCard.
- This indicates what tender type was used by the cardholder and is sometimes required when a transaction is voided.
- TransactionType
- An enum: Unknown, Payment, Refund, and Void.
- This indicates what transaction was being processed.
- CustomerSignature
- Is an object of the type Signature holding a string value of the signature and of what mime type, see the API documentation.
- Gets or sets the customer signature.
- Token
- A token identifying card as a unique identifier (credit card, debit card, bank account for direct debit).
- Once obtained, a transaction can be managed without storing other card data.
CardDetails
This object stores all information related to the card used in the transaction:
- CardNumber
- The masked number of the card used in the process, returned by the PSP
- CardExpiryDate
- Used when sending request, otherwise empty.
- CardIssuer
- Name of card, issuer, application name.
ReceiptLines
ReceiptLine includes line data and settings for printing purposes. The list of lines in TransactionResponse returns the string value of the receipt and does not try to match the text size and text weight.
public class ReceiptLine
{
public string Line { get; set; } = String.Empty;
public TextSize TextSize { get; set; } = TextSize.MEDIUM;
public TextWeight TextWeight { get; set; } = TextWeight.NORMAL;
}
public enum TextSize
{
SMALL,
MEDIUM,
LARGE
}
public enum TextWeight
{
NORMAL,
BOLD
}
The Valitor (AltaPay) A920 device accepts text for printing (see information regarding IPrinter in Printing Interface) where text lines can have weight and text size.