Execute Transaction
EXECUTE_TRANSACTION_REQUEST
EXECUTE_TRANSACTION_UPDATE
EXECUTE_TRANSACTION_ACTION
EXECUTE_TRANSACTION_RESPONSE
Use this message to execute a transaction on a connected device:
{
"tag": "c8d08dcf-e1c6-4736-a7a6-30aee58d7a12",
"type": "EXECUTE_TRANSACTION_REQUEST",
"resource": "devices/usbReader",
"executeTransactionRequest": {
"mode": "ONLINE | OFFLINE",
"transactionParameters": {
"amount": 5.00,
"currency": <Currency>,
"autoCapture": true | false,
"type": "CHARGE",
"subject": "My Subject",
"customIdentifier": "my-custom-identifier",
"statementDescriptor": "My Statement Descriptor",
"applicationFee": 1.00,
"includedTipAmount": 1.00,
"metadata": {
"my": "metadata"
}
},
"sessionIdentifier": "62c155b6-6f7e-47e1-83b6-b13a1e4e2303",
"processParameters": {
"steps": {
"askForTip | askForTotalAmount": {
"suggestedAmount": 2.00,
"maxTipAmount": 3.0,
"showAddTipConfirmationScreen": true | false,
"showTotalAmountConfirmationScreen": true | false
}
}
}
}
}
When using the
transactionParameters
you need to provide at least the
amount
,
currency
,
type
and
autoCapture
for the transaction. If you set
autoCapture
to false, the transaction will be only pre-authorized and you need to capture it later using
AMEND_TRANSACTION_REQUEST
or from your backend.
The
processParameters
are optional steps that can be performed during the transaction process.
askForTip
will cause the reader to ask shopper for about adding a tip before performing the transaction.
suggestedAmount
is optional. When you set the
askForTotalAmount
, this will enable the reader to ask for adding the total amount of the transaction before performing it.
When using total amount tipping strategy, the number the client will have to type in is the sum between the transaction amount and the tip.
In addition, both
askForTip
and
askForTotalAmount
tipping strategies benefit from reader screen configuration when performing the transaction; while
showAddTipConfirmationScreen
is used for the first confirmation screen that pops up,
showTotalAmountConfirmationScreen
is managing the second confirmation screen that appears when confirming the total amount of the transaction. Both screen configuring properties are optional and by default
showAddTipConfirmationScreen
is
true
and
showTotalAmountConfirmationScreen
is
false
. Optional, in case there is a need to set a maximum amount for tipping, "maxTipAmount" property can be used. As the name suggests, the tip amount added to the transaction should not be higher than the value set using "maxTipAmount" .
For
resource
, provide the
resource
of the device.
Since executing transactions is a long running operation, the server provides the client with update messages which inform about the current state of the transaction process.
{
"tag": "c8d08dcf-e1c6-4736-a7a6-30aee58d7a12",
"type": "EXECUTE_TRANSACTION_UPDATE",
"resource": "devices/usbReader",
"executeTransactionUpdate": {
"state": <TransactionProcessDetailsState>,
"stateDetails": <TransactionProcessDetailsStateDetails>,
"information": ["Processing", "payment..."],
"abortable": true|false,
"transaction": {
"amount": 5.00,
"mode": "ONLINE | OFFLINE",
"currency": <Currency>,
"type": "CHARGE",
"details": {
"applicationFee": 1.00,
"includedTipAmount": 1.00,
"metadata": {
"my": "data"
}
}
"subject": "My Subject",
"statementDescriptor": "My Statement Descriptor",
"status": <TransactionStatus>,
"identifier": "7e2fc2585cd24f648d96760f56fba26c",
"referencedTransactionIdentifier": null,
"customIdentifier": "my-custom-identifier"
}
}
}
The field
information
is an array of exactly two strings which contain localized, human-readable information about the state of the transaction. You can use them straight in your system UI.
The field
abortable
informs you whether the transaction process can be aborted at the moment. If
true
you can send an Abort Operation message for this resource. Before implementing aborts in your system make sure to understand the flow of a transaction abort. Beware that, due to the nature of networking, sending in an abort when transaction appears abortable might still result in a
CANNOT_BE_ABORTED
response if the abortable state has changed meanwhile, but this should happen very rarely.
{
"tag": "c8d08dcf-e1c6-4736-a7a6-30aee58d7a12",
"type": "EXECUTE_TRANSACTION_ACTION",
"resource": "devices/usbReader",
"executeTransactionAction": {
"type": "SIGNATURE"
}
}
At the moment, the only possible value for
type
is
SIGNATURE
. Do not rely on this, in the future more possible values will be added.
This message tells you that the transaction process is paused and waiting for an input -- the shopper's signature which you send in a
SUBMIT_SIGNATURE_REQUEST
message.
This message is not sent out by default, you need to explicitly enable it in the
server configuration.
Receiving an execute transaction response means that the long running operation is over and there will be no more related updates.
{
"tag": "c8d08dcf-e1c6-4736-a7a6-30aee58d7a12",
"type": "EXECUTE_TRANSACTION_RESPONSE",
"resource": "devices/usbReader",
"executeTransactionResponse": {
"state": <TransactionProcessDetailsState>,
"stateDetails": <TransactionProcessDetailsStateDetails>,
"transaction": {
"amount": 5.00,
"mode": "ONLINE | OFFLINE",
"currency": <Currency>,
"type": <TransactionType>,
"details": {
"applicationFee": 1.00,
"includedTipAmount": 1.00,
"metadata": {
"my": "data"
}
}
"subject": "My Subject",
"statementDescriptor": "My Statement Descriptor",
"status": <TransactionStatus>,
"identifier": "7e2fc2585cd24f648d96760f56fba26c",
"referencedTransactionIdentifier": null,
"createdTimestamp": 1464009191,
"customIdentifier": "myIdentifier",
"captured": true|false,
"paymentDetails": {
"scheme": <PaymentDetailsScheme>,
"source": <PaymentDetailsSource>,
"customerVerification": <PaymentDetailsCustomerVerification>,
"maskedAccountNumber": "541333******0086"
},
"refundDetails": {
"status": <RefundDetailsStatus>,
"process": [<RefundDetailsProcess>],
"refundTransactions": [
{
"identifier": "c735ec8ed1794e83882fba8c99ccd7d2",
"createdTimestamp": 1464609191,
"amount": 3.00,
"currency": <Currency>,
"type": "REFUND",
"code": <RefundTransactionCode>,
"status": <TransactionStatus>,
"statusDetails": {
"code": <TransactionStatusDetailsCodes>,
"description": "A description",
"developerDescription": "A developer description",
}
}
]
},
"dccDetails": {
"status": "APPLIED",
"statusDetails": "APPLIED",
"convertedAmount": 123.23,
"convertedCurrency": "USD",
"rate": 12.23,
"markup": 2.14
},
"cardDetails": {
"fingerprint": "a5e2188a-f676-11e5-b944-593944fafab9",
"scheme": <PaymentDetailsScheme>,
"maskedCardNumber": "541333******0086",
"expiryMonth": 2,
"expiryYear": 2017,
"cardholderName": "John Doe"
},
"shopperDetails": {
"identifier": "c3d185cc-4c49-43d9-80f4-16a49a8660ec",
"email": null
},
"merchantReceipt": {
// ...
},
"customerReceipt": {
// ...
},
}
}
}
More information on the transactionStatus messages can be found
here.
The
transaction
object has the same structure in all transaction related updates and responses (Get Transaction, Query Transactions, Execute Transaction, Amend Transaction)
Providing a Printed Payment Receipt
Information on creating your own custom receipts can be found
here.