In our implementation, the Reversal interface is primarily used as a Void transaction. It applies when a previously successful transaction (such as a payment or pre-authorization completion) needs to be canceled within the same business day. Once voided, the original transaction becomes invalid and the funds will not be settled to the merchant account.
Typical scenarios:
Global reference of the sale transaction for the sale system.
Global reference of the original sale transaction for the sale system
The orgAuthorisationIdentification field specifies the identifier used to link the original pre-authorisation transaction.
Its value is obtained from the authorisationIdentification returned in the pre-authorisation response message, ensuring consistency and correctness between the original authorisation and its subsequent transactions.
Type of cardholder account used for the transaction.
Total transaction amount.
Amount that have been reversed.
Gratuity amount.
Currency associated with the transaction.
Three-letter ISO currency code.
A list of value added tax amounts.
Detailed amounts associated with the total amount of transaction.
Amount value.
Short description of the amount to display or print.
Identification of the cashier who carried out the transaction.
Cashback amount.
Indicates whether the transaction process should continue when the app is running in the background.
Transaction date time of the original sale transaction for the sale system.
Data: A particular point in the progression of time in a calendar year expressed in the yyyyMMdd format.
Identification of the transaction given by the Issuer.
POI identification of the transaction in an unambiguous way.
Value assigned by the authorising party.
Identification of the invoice.
Full Reversal is initiated to remove an approved transaction from a batch.
Partial Reversals Decreases the total authorized amount of a previously authorized transaction.
Additional information associated with the sale transaction.
Attendance context of the transaction.
Acquirer manager password for transaction verification.
Copy from Request.
Copy from Request.
Unique identification of the partner that is the recipient of the message exchange.
For example, the POS SN
Result of the requested transaction.
Detail of the response. This field will be gradually replaced by respReason in future versions.
Additional information to be logged for further examination.
Custom status field returned in the transaction result.
When you receive the terminal result through the SDK callback interface and ReversalResult.response = SUCC, you can obtain additional transaction details (including reference numbers returned by the payment channel) to support your business requirements.
The following fields are defined, and the availability of each field depends on the capabilities provided by the payment application.
Total transaction amount.
Transaction time. timestamp: A particular point in the progression of time in a calendar year expressed in the yyyyMMddHHmmss format.
Currency associated with the transaction.
Three-letter ISO currency code.
Type of cardholder account used for the transaction.
Gratuity amount.
Outcome of the authorisation, and actions to perform.
Masked PAN to be printed on payment receipts or displayed to the cardholder.
Brand of the card.
For example: Visa, MasterCard, CUP, JCB, DinersClub, AmericaExpress.
Identification of the cashier who carried out the transaction.
Identification of the invoice.
Unique identification of the merchant.
Name of the merchant.
Identification of the POI.
For example: Terminal ID.
Identification of the transaction given by the Issuer.
Unique identification of the reconciliation period between the acceptor and the acquirer.
For example: Batch Number.
POI identification of the transaction in an unambiguous way.
Customer or Merchant payment receipt.
Various receipts.
Destination of the message.
Content or reference of the message.
Maximum number of characters allowed is 20000.
Additional information associated with the sale transaction.
ReversalParam param = ReversalParam.newBuilder()
.transactionReference("00000003")
.orgTransactionReference("00000001")
.orgTransactionDateTime(new Date(1711680359167L)) //20240329
.reversalReason(ReversalReason1Code.CUSC) //Customer cancel
.build();
RetailerManager.provideFinancialService()
.newReversalExchange(param)
.startAsyncExchange(new Exchange.RetailerSDKCallback<ReversalResult>() {
@Override
public void onError(int code, String msg) {
Logger.e(TAG, "reversal failed: " + code + ", " + msg);
}
@Override
public void onResult(ReversalResult result) {
Logger.i(TAG, "reversal result: " + GsonUtils.toJson(result));
}
});using System;
using PayExplorerConnect;
public void HandleReversalError(int code, string message)
{
Console.WriteLine($"Error: {code}, Message: {message}");
}
public void HandleReversalResult(ReversalResult result)
{
Console.WriteLine($"Response: {result.Response}");
}
public string StartReversal()
{
// Replace the sample values with your reversal data and original payment details.
ReversalParam param = new ReversalParam.Builder()
.TransactionReference("00000003")
.OrgTransactionReference("00000001")
.OrgTransactionDateTime("2024-03-29T02:45:59.167+0000")
.ReversalReason(ReversalReasonCode.CUSC) //Customer cancel
.Build();
string exchangeId = RetailerManager
.ProvideFinancialService()
.NewReversalExchange(param)
.StartAsyncExchange(HandleReversalResult, HandleReversalError);
return exchangeId;
}#import <PayExplorerConnect/RetailerManager.h>
#import <PayExplorerConnect/ReversalParam+Builder.h>
// Use the reference of the original transaction.
ReversalParam *params = [ReversalParam makeWithBuilder:^(ReversalParamBuilder *builder) {
builder.transactionReference(@"00000003");
builder.orgTransactionReference(@"00000001");
builder.reversalReason(ReversalReason1CodeCUSC);
}];
[[RetailerManager sharedManager] reversal:params block:^(NSString *exchangeId) {
// Save the exchange ID to track this request.
} result:^(id result, NSInteger errcode, NSString *msg) {
if (errcode != 0 && result == nil) {
// Handle request error.
return;
}
ReversalResult *reversalResult = (ReversalResult *)result;
// Handle reversal result.
}];