Ir para o conteúdo

Insert transaction

insertTransaction()


Method responsible for inserting a transaction, used in test scenarios to validate the payment flow.

Methods

Signature Description
void insertTransaction(InsertTransactionRequest insertTransactionRequest, PaymentCallback<Void> insertTransactionCallback) Perform the process of inserting a transaction.

Parameters

Name Type Mandatory Description
request InsertTransactionRequest Yes Data transfer object that will contain the transaction request information.
callback PaymentCallback Yes Interface that will be executed for success or error notifications of the transaction process.

Detail Parameters request (InsertTransactionRequest)

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 allows for the reconciliation of the payment with the integrated transaction.
acquirerPackage String Yes Package or set of information that describes the payment method used by the acquirer.
acquirerSpecificId String Yes Specific identifier for the acquirer, used to differentiate transactions or packages.
PayStorePaymentRequest.payment PayStorePaymentRequest Yes Details about the payment request made by the store, including values and methods.
PaymentServiceExecutionRequest.paymentServiceExecutionRequest PaymentServiceExecutionRequest Yes Specific details about the execution of the payment service, including transaction data.
ReversalServiceExecutionRequest.reversalServiceExecutionRequest ReversalServiceExecutionRequest Yes Details about the payment reversal request, including the reason and data from the original transaction.
authAppVersion String Yes Version of the authentication application used in the payment or verification process.
paymentAppVersion String Yes Version of the payment application used to complete the transaction.

PayStorePaymentRequest

Name Type Description
uuid String Unique identifier of the transaction.
nsu long Unique sequential number of the transaction.
value BigDecimal Value of the transaction.
cashback BigDecimal Cashback value applied to the transaction.
paymentDate Date Date of the transaction.
paymentDateStatus Integer Status of the payment date.
paymentStatus Integer Status of the payment.
resolutionType Integer Type of transaction resolution.
maskedPan String Masked card number.
panLast4Digits String Last 4 digits of the card number.
requiredPanSequenceNumber boolean Indicates whether the card sequence number is required.
panSequenceNumber Integer Card sequence number.
aid String Application identifier.
cardHolder String Cardholder name.
cardExpirationDate Date Card expiration date.
captureType Integer Type of transaction capture.
cardType String Type of card (e.g., credit, debit).
appLabel String Application label.
cryptoPan String Encrypted card number.
issuerScriptResults String Issuer script results.
finalRequiredData String Final required data.
cardRequiredData String Required card data.
paymentMerchantReceipt String Merchant payment receipt.
paymentClientReceipt String Client payment receipt.
installmentQuantity Integer Number of installments.
requiredPassword boolean Indicates whether the password is required for the transaction.
requiredSignature boolean Indicates whether the signature is required for the transaction.
currencySymbol String Currency symbol used in the transaction.
merchantSpecificId String Merchant-specific identifier.
terminalSpecificId String Terminal-specific identifier.
productType Integer Type of product involved in the transaction.
ksn String Terminal sequence number.
reverseMerchantReceipt String Merchant reversal receipt.
reverseClientReceipt String Client reversal receipt.
canUndoReverse boolean Indicates whether the reversal can be undone.
cardBrandName String Card brand name (e.g., Visa, MasterCard).
externalAppId String External application identifier.
externalAppVersion String External application version.
externalAppTransactionId String External application transaction ID.
ticketNumber Long Transaction receipt number.
batchNumber Long Transaction batch number.
pinCaptureType Integer Type of PIN capture.
authCode String Transaction authorization code.
reverseAuthCode String Reversal authorization code.
validityPreAuthorization String Pre-authorization validity.
terminalAcquirerSpecificId String Acquirer-specific terminal identifier.
softDescriptor String Product or service description.
transactionType String Transaction type (e.g., sale, cancellation).
transactionDesc String Transaction description.
plainTextPan String Card number in plain text.
cardBrandId Long Card brand ID.
paymentAppVersionCode Integer Payment application version code.
planId String Plan ID associated with the transaction.
productShortName String Abbreviated product name.
accountTypeId String Account type associated with the transaction.
reversable Boolean Indicates whether the transaction is reversible.
acquirerResponseCode String Acquirer response code.
merchantCode String Merchant code.
batchId Long Batch ID.
devolution Boolean Indicates whether the transaction is a return.
allowVeps Boolean Indicates whether VEPS (Virtual Electronic Payment System) is allowed.
vepsContactLimit String VEPS contact limit.
lastUpdate Date Last update date.
acquirerNsu String Acquirer NSU.
cardHolderNameExtended String Full cardholder name.
doc String Cardholder document.
originalAcquirerNsu String Original acquirer NSU.
acquirerResponseDate Date Acquirer response date.
acquirerResponseMessage String Acquirer response message.
acquirerResponseSuccessMessage String Acquirer success message.
acquirerReverseResponseCode String Acquirer reversal response code.
acquirerReverseResponseDate Date Acquirer reversal response date.
additionalValueType Integer Additional value type of the transaction.
authorizedOriginalValue BigDecimal Original authorized value of the transaction.
balance String Balance after the transaction.
cashbackValue BigDecimal Cashback value associated with the transaction.
correlationId String Transaction correlation ID.
cvv String Card security code.
cvvLegibleType String Legible CVV type.
dni String National Identity Document.
finalApplicationCryptogram String Final application cryptogram.
hasCardData Boolean Indicates if card data is present.
initializeAfterPayment Boolean Indicates if the system should initialize after the payment.
installmenPlanDescription String Installment plan description.
issuerName String Card issuer name.
maskFirst6Digits Boolean Indicates if the first 6 digits of the card should be masked.
merchantPhoneNumber String Merchant phone number.
notes String Additional notes related to the transaction.
originalAC String Original authorization code.
originalAID String Original AID of the transaction.
originalAuto String Original terminal automation code.
originalDate String Original transaction date.
originalHour String Original transaction time.
originalTerm String Original terminal where the transaction was made.
originalTicketNumber String Original ticket number.
originalValue String Original transaction value.
pan String Full card number (PAN).
payerDataName String Payer's name.
paymentPrintedReceipt Boolean Indicates whether the payment receipt was printed.
paymentUuid String Payment UUID.
printMessage String Message to be printed on the receipt.
printParcialPan Boolean Indicates if partial PAN should be printed on the receipt.
qrDiscountedValue BigDecimal Discounted value in QR code transactions.
qrId Long Generated QR code ID for the transaction.
qrOriginalValue BigDecimal Original value of the QR code transaction, before the discount.
rawAdditionalMessage String Raw additional message provided by the transaction.
receiptDisplayMessage String Message to be displayed on the receipt.
receiptPrintMessage String Message to be printed on the receipt.
requestedTokenizeCard Boolean Indicates if the card was requested for tokenization.
restored Boolean Indicates if the transaction was restored.
reversalBatchId Long Reversal batch ID.
reversalPrintedReceipt Boolean Indicates if the reversal receipt was printed.
reversalSignature String Reversal signature of the transaction.
reverseAcquirerNsu String Acquirer reversal NSU.
saleCode String Sale code associated with the transaction.
signature String Digital or physical signature associated with the transaction.
statisticAPNSIM String Statistical information about the SIM in the APN (Access Point Name).
statisticBatteryPercentage String Battery percentage on the device during the transaction.
statisticCommunicationType String Communication type used in the transaction (e.g., Wi-Fi, 4G, etc.).
statisticLatitude String Latitude at the time of the transaction.
statisticLongitude String Longitude at the time of the transaction.
statisticOperatorSIM String SIM card operator used during the transaction.
statisticSIMSerialNumber String Serial number of the SIM card used.
statisticStrengthSIM String Strength of the SIM card signal during the transaction.
statisticStrengthWireless String Strength of the wireless signal at the time of the transaction.
track1 String Track 1 data from the card (used in magnetic stripe card transactions).
track2 String Track 2 data from the card (used in magnetic stripe card transactions).
version Long Version of the transaction or system.
trxType Integer Type of transaction (e.g., purchase, refund, etc.).

PaymentServiceExecutionRequest

Name Type Description
serviceStatus Integer Status of the service.
serviceStatusDetail Integer Details of the service status.
serviceAcquirerStatus Integer Status of the service on the acquirer side.
startDate Date Start date of the service or transaction.
finishDate Date Finish date of the service or transaction.
clientRequestDate Date Date of the client's request.
serviceType String Type of service (e.g., purchase, reversal, etc.).
responseCode String Response code of the service or transaction.
responseMessage String Response message of the service or transaction.
responseDate Date Date of the response for the service or transaction.
acquirerNsu String NSU (Unique Sequential Number) provided by the acquirer.
processingCode String Processing code for the transaction.
mti Integer MTI (Message Type Indicator) of the transaction, indicating the type of message.
authCode String Authorization code for the transaction.
chipSerialNumber String Serial number of the card’s chip.
chipNameProvider String Name of the card chip provider.
phastTransactionProviderId String ID of the PHAST transaction provider (payment system).
phastTransactionServiceSpecificId String Specific service ID of the PHAST transaction.
connectionType String Type of connection used during the transaction (e.g., Wi-Fi, 4G, etc.).
statisticAPNSIM String Statistical information about the SIM on the APN (Access Packet Network).
statisticBatteryPercentage String Battery percentage on the device during the transaction.
statisticCommunicationType String Type of communication used during the transaction (e.g., Wi-Fi, 4G, etc.).
statisticLatitude String Latitude at the time of the transaction.
statisticLongitude String Longitude at the time of the transaction.
statisticOperatorSIM String SIM card operator used during the transaction.
statisticStrengthSIM String Signal strength of the SIM card during the transaction.
statisticStrengthWireless String Wireless signal strength at the time of the transaction.
acquirerNsuAuthApi String Authorization NSU obtained via the acquirer's API.
correlationId String Correlation ID between the transaction and other involved systems.
initializationType String Initialization type of the payment or transaction process.
lastTryDay Date Date of the last processing attempt.
numberAttemptsDay Integer Number of attempts made on the day.
numberAttemptsTotal Integer Total number of attempts made.
paymentAppVersion String Version of the payment application used in the transaction.
paymentNotify Boolean Indicates if the payment notification has been sent or not.
sdkResponseCode String SDK response code for the transaction.
sdkResponseMessage String SDK response message for the transaction.
synced Boolean Indicates if the data has been synchronized.
syncedAdditionalInfo Boolean Indicates if additional information has been synchronized.
totalDays Integer Total number of days involved in the transaction or service.
version Long Version of the system or transaction.

ReversalServiceExecutionRequest

Name Type Description
serviceStatus Integer Status of the service.
serviceStatusDetail Integer Details of the service status.
serviceAcquirerStatus Integer Status of the service on the acquirer side.
startDate Date Start date of the service or transaction.
finishDate Date Finish date of the service or transaction.
clientRequestDate Date Date of the client’s request.
serviceType String Type of service (e.g., purchase, reversal, etc.).
responseCode String Response code of the service or transaction.
responseMessage String Response message of the service or transaction.
responseDate Date Date of the response for the service or transaction.
acquirerNsu String NSU (Unique Sequential Number) provided by the acquirer.
originalDate Date Original date of the transaction.
originalNsu String Original NSU provided by the acquirer.
maskedPan String Masked PAN (card number).
panLast4Digits String Last 4 digits of the PAN (card number).
aid String AID (Application Identifier) of the card.
cardHolder String Cardholder’s name.
authCode String Authorization code for the transaction.
captureType Integer Type of capture for the transaction (e.g., full capture, partial capture, etc.).
appLabel String Label of the application used.
nsu Long NSU (Unique Sequential Number) generated for the transaction.
authAppVersion String Version of the authorization application used.
paymentAppVersion String Version of the payment application used.
requiredPassword Boolean Indicates if a password is required for the transaction.
chipSerialNumber String Serial number of the card’s chip.
batchNumber Long Batch number related to the transaction.
synced Boolean Indicates if the data was synchronized.
chipNameProvider String Name of the chip provider for the card.
connectionType String Type of connection used during the transaction (e.g., Wi-Fi, 4G, etc.).
correlationId String Correlation ID between the transaction and other systems involved.
initializationType String Initialization type for the payment or transaction process.
lastTryDay Date Date of the last processing attempt.
numberAttemptsDay Integer Number of attempts made on the day.
numberAttemptsTotal Integer Total number of attempts made.
sdkResponseCode String Response code from the SDK for the transaction.
sdkResponseMessage String Response message from the SDK for the transaction.
statisticAPNSIM String Statistical information about the SIM on the APN (Access Packet Network).
statisticBatteryPercentage String Battery percentage on the device during the transaction.
statisticCommunicationType String Type of communication used during the transaction (e.g., Wi-Fi, 4G, etc.).
statisticLatitude String Latitude at the time of the transaction.
statisticLongitude String Longitude at the time of the transaction.
statisticOperatorSIM String SIM card operator used during the transaction.
statisticStrengthSIM String Signal strength of the SIM card during the transaction.
statisticStrengthWireless String Wireless signal strength at the time of the transaction.
syncedAdditionalInfo Boolean Indicates if additional information was synchronized.
ticketNumber Long Ticket number related to the transaction.
totalDays Integer Total number of days involved in the transaction or service.
version Long Version of the system or 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.

Example

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() {

    InsertTransactionRequest insertTransactionRequest = new InsertTransactionRequest();
    // set mandatory information of the request

    try {
      paymentClient.insertTransaction(insertTransactionRequest, 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!");
  }
}