doTransaction
The doTransaction method initiates and processes payment transactions within the TweezerComm protocol. It enables client applications, such as point-of-sale (POS) systems or electronic cash registers (ECRs), to interact with the Agamento payment terminal for secure transaction execution.
This method supports multiple transaction types, including:
- Regular Transactions: Standard payments using credit cards or closed-loop payment methods.
- Pre-Authorizations: Reserve a specified amount on a customer’s card for later confirmation.
- Pre-Authorization Completion and Cancellation: Completing or voiding previously authorized transactions.
- MOTO (Mail Order/Telephone Order) Transactions: Processing card-not-present transactions securely.
- Refunds: Partial or full refunds of previous transactions.
- Deferred Payments: Approving transactions even in cases where there is no immediate network connectivity.
The sections below will describe the request parameters in more detail:
Requests
JSON-RPC 2.0All methods in TweezerComm follow a JSON-RPC 2.0 structure. See Get Startedfor more details on how the requests are structured and sent.
In the request, the method field needs to be set to doTransaction, the transaction is defined by the tranCode parameter. Check the example request for each transaction type on the tabs below:
Mandatory Fields
vuid,amountandtranTypeare mandatory for all requests. All others depend on the type of transaction made.
For a regular transaction, set the tranCode parameter to 1. The code block shows a request example for a regular transaction:
{
"jsonrpc": "2.0",
"method": "doTransaction",
"id": "123454352",
"params": [
"engine",
{
"vuid": "44d96006",
"amount": 100,
"tranCode": 1
}
]
}Parameter Definitions
The table below describes all parameters available in this request:
| Name | Type | Description | |
|---|---|---|---|
vuid | string | Vendor (client) unique transaction identifier. | |
amount | integer | Amount in cents. | |
tranCode | integer | The transaction type code. 1: Single Step Transaction. |
Responses
The service will return a response structured similarly to the examples provided in the code blocks below:
{
"jsonrpc": "2.0",
"id": "123454352",
"result": {
"statusCode": 0,
"statusMessage": "TRANSACTION APPROVED",
"appVersion": "01.06.62",
"vuid": "12354",
"amount": 100,
"transactionId": "2038584332",
"entryMode": 4,
"transactionOriginalRequestId": "6439809e-619f-414b-8c3e-f1a9f3c3bc49",
"transactionOriginalTime": "2025-03-05 23:08:06.597",
"transactionOriginalAmount": 100,
"serverResultMessage": "Sale is Approved",
"tranType": 1,
"dtId": "1741244869236399011",
"rrn": "250306070806",
"maskedPan": "541333******4111",
"currencyCode": "USD",
"currencyISOCode": "840",
"originalSiteId": 1,
"mainBoardSerial": "000177234933444",
"hwSerial": "0900044624102737"
}
}Response Parameters
Below is a table with all the possible response parameters and their description:
| Name | Type | Description |
|---|---|---|
statusCode | integer | Result of the request (0 for success). |
statusMessage | string | Text description of the status. |
appVersion | string | Version of the payment application. |
vuid | string | Vendor unique transaction identifier. |
amount | integer | Final transaction amount in cents. |
transactionId | string | Unique gateway transaction ID. |
entryMode | integer | Method used to read the card (e.g., Chip, Contactless). |
transactionOriginalRequestId | string | ID of the original request. |
transactionOriginalTime | string | Timestamp of the original transaction. |
transactionOriginalAmount | integer | Original amount requested. |
serverResultMessage | string | Detailed message from the processing server. |
tranType | integer | Transaction type code (1 for Regular). |
dtId | string | Device Transaction Identifier. |
rrn | string | Retrieval Reference Number. |
maskedPan | string | The masked card number used for the transaction. |
currencyCode | string | Alphanumeric currency code (e.g., USD). |
currencyISOCode | string | Numeric ISO currency code (e.g., 840). |
originalSiteId | integer | Identifier of the originating site. |
mainBoardSerial | string | Serial number of the device main board. |
hwSerial | string | Hardware serial number. |
Updated 20 days ago