Remove transaction
removeTransaction()
Method to perform the process of removing a transaction, used in test scenarios.
Methods
| Assinatura |
Description |
void removeTransaction(RemoveTransactionRequest removeTransactionRequest, PaymentCallback<Void> insertTransactionCallback) |
Performs the process of removing a transaction. |
Parameters
| Name |
Type |
Mandatory |
Description |
request |
RemoveTransactionRequest |
Yes |
Data transfer object that will contain the information for the transaction request. |
callback |
PaymentCallback |
Yes |
Interface that will be executed for notifications of success or failure of the transaction process. |
Detail Parameters
request (RemoveTransactionRequest)
| Name |
Type |
Mandatory |
Description |
acquirerId |
String |
Yes |
Transaction identifier for the acquirer. This is the identifier found in the file provided by the acquirer (EDI). This way, it's possible to reconcile the payment with the integrated transaction. |
acquirerPackage |
String |
Yes |
Package or set of information that describes the payment method used by the acquirer. |
externalAppTransactionId |
String |
Yes |
Transaction ID in the external application. |
paymentDate |
Date |
Yes |
Date of the transaction. |
callback (PaymentCallback)
| Name |
Type |
Mandatory |
Description |
onSuccess |
|
|
Method for notification in case of success. |
onError |
|
|
Method for notification in case of failure. |
ErrorData.paymentsResponseCode |
String |
Yes |
Response code for the error that occurred. See Vide Response Codes |
ErrorData.acquirerResponseCode |
String |
No |
Response code for the error returned by the acquirer. Note that this error will only be returned if the transaction is not authorized by the acquirer. |
ErrorData.responseMessage |
String |
Yes |
Descriptive message of the cause of the non-authorization. If the transaction was denied by the acquirer, it will contain the message returned by the acquirer. |
ErrorData.acquirerAdditionalMessage |
String |
No |
Message sent in field 63 of EPS response, to be printed or displayed at the end of the transaction flow. The payment application is responsible for displaying this on the screen or verifying the content in this field, but it must also send the value received to the integrated application so it can apply its business rules based on this field's content. |
Exemplo
public class MyActivity extends Activity implements PaymentClient.PaymentCallback {
private PaymentClient paymentClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment);
paymentClient = new PaymentClientImpl();
}
@Override
protected void onResume() {
super.onResume();
paymentClient.bind(this);
}
@Override
protected void onDestroy() {
try {
paymentClient.unbind(this);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
super.onDestroy();
}
public void doExecute() {
RemoveTransactionRequest removeTransactionRequest = new RemoveTransactionRequest();
// set mandatory information of the request
try {
paymentClient.removeTransaction(removeTransactionRequest, this);
} catch (ClientException e) {
Log.e(TAG, "Error", e);
}
}
@Override
public void onError(ErrorData errorData) {
Log.e(TAG, "Error: " + errorData.getResponseMessage());
}
@Override
public void onSuccess(Object o) {
Log.i(TAG, "Success!");
}
}