Getnet DocsGetnet Docs

API Reference

This page provides a technical reference for the redsys-tpv-business-lib repositories. It lists the available methods, parameters, and return types for each feature.

Common Types

RepositoryResult<T>

A generic sealed class wrapper for all asynchronous repository responses.

  • Success<T>: Contains the result data (val data: T).
  • ConnectionError: Indicates a network or service connection failure.
  • Cancelled: Indicates the operation was cancelled by the user (val message: String).
  • ProtocolError: Indicates an integration or data mapping error (val type: ProtocolErrorType, val description: String?).

1. InitializationRepository

Purpose: Manage TPV initialization and configuration.

Methods

MethodDescriptionParametersReturn Type
initTpvInitializes the TPV with the host.NoneRepositoryResult<TpvInfo>
getTpvInfoRepositoryResultRetrieves cached TPV information.NoneRepositoryResult<TpvInfo>
saveTerminalInformationUpdates local terminal info.tpvInfo: TpvInfoUnit (Suspend)

2. PaymentRepository

Purpose: Process card payments.

Methods

MethodDescriptionParametersReturn Type
makePaymentPerforms a standard payment.amount: Money
tip: Money?
shiftInfo: ShiftInfo?
financialConditions: FinancialConditions?
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<PaymentResult>

PaymentResult (Sealed Interface)

  • Accepted(val data: Transaction)
  • Denied(val data: Transaction)
  • CardNotFound

3. RefundRepository

Purpose: Process refunds.

Methods

MethodDescriptionParametersReturn Type
makeRefundRefund by original operation ID.operationId: String
amount: Money
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<RefundResult>
makeRefundReadingCardRefund by ID, forcing card read.operationId: String
amount: Money
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<RefundResult>
makeRefundWithoutOriginalRefund without previous ID.amount: Money
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<RefundResult>

RefundResult (Sealed Interface)

  • Accepted(val data: Transaction)
  • Denied(val data: Transaction)
  • ExceededAmount

4. PreauthorizationRepository

Purpose: Manage funds reservations.

Methods

MethodDescriptionParametersReturn Type
makePreauthorizationCreate a new pre-auth.amount: Money
shiftInfo: ShiftInfo?
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<PreauthorizationResult>
confirmPreauthorizationConfirm/Charge a pre-auth.amount: Money
operationId: String
shiftInfo: ShiftInfo?
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<PreauthorizationResult>
replacePreauthorizationUpdate the amount.amount: Money
operationId: String
shiftInfo: ShiftInfo?
proprietaryExtraData: ProprietaryExtraData?
language: LanguageIso6391?
RepositoryResult<PreauthorizationResult>
annulPreauthorizationCancel the reservation.operationId: String
language: LanguageIso6391?
RepositoryResult<PreauthorizationResult>

PreauthorizationResult (Sealed Interface)

  • Accepted(val data: Transaction)
  • Denied(val data: Transaction)

5. TransactionRepository

Purpose: Search historical transactions.

Methods

MethodDescriptionParametersReturn Type
getTransactionsSearch transactions by date range.initDate: Date
endDate: Date
filter: TransactionFilter?
resultsFilter: TransactionResultsFilter?
RepositoryResult<GetTransactionsResult>
getTransactionsBySessionSearch by session.initDate: Date
endDate: Date
sessionDate: Date
sessionId: Int?
filter: TransactionFilter?
resultsFilter: TransactionResultsFilter?
RepositoryResult<GetTransactionsResult>

6. TotalsRepository

Purpose: Query accumulated totals.

Methods

MethodDescriptionParametersReturn Type
getSessionsTotals for all sessions on a date.date: Date
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>
getSessionTotals for a specific session ID.date: Date
sessionId: Int
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>
getSessionsBetweenDatesTotals for sessions in range.initDate: Date
endDate: Date
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>
getLastSessionTotals for the last closed session.NoneRepositoryResult<GetLastSessionResult>
getShiftsTotals for all shifts on a date.date: Date
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>
getShiftTotals for a specific shift ID.date: Date
shiftId: String
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>
getShiftBetweenDatesTotals for shifts in range.initDate: Date
endDate: Date
wantBrandDetails: Boolean
RepositoryResult<TotalsResult>

TotalsResult (Sealed Interface)

  • IncomingData(val data: TotalsModel)
  • EmptyData
  • WrongIdentifierError

7. ShiftRepository and SessionRepository

Purpose: Manage operational periods.

Methods

RepositoryMethodParametersReturn Type
ShiftRepositoryopenShiftnumber: Int
date: Date
RepositoryResult<Boolean>
SessionRepositorycloseSessionwantBrandDetails: BooleanRepositoryResult<CloseSessionResult>

8. PrinterRepository

Purpose: Control device printer.

Methods

MethodDescriptionParametersReturn Type
checkPaperCheck paper status.NoneRepositoryResult<Boolean>
printBitmapPrint a custom bitmap.bitmap: BitmapRepositoryResult<Boolean>
printDefaultTicketPrint standard receipt.context: Context
headerIcon: Bitmap
transaction: Transaction
RepositoryResult<Boolean>

9. TicketDigitalRepository

Purpose: Manage digital receipts.

Methods

MethodDescriptionParametersReturn Type
sendTicketDigitalSend receipt via email.operId: String
email: String
RepositoryResult<TicketDigitalResult>
getTicketDigitalURLGet receipt URL (for QR).operId: StringRepositoryResult<TicketDigitalUrlResult>

10. SettingsRepository and AuthRepository

Purpose: Configuration and Authentication.

Methods

RepositoryMethodParametersReturn Type
SettingsRepositoryupdateShowTransactionResultshowTransactionResult: BooleanRepositoryResult<Boolean>
SettingsRepositoryupdateLanguagelanguage: LanguageIso6391RepositoryResult<Boolean>
AuthRepositorygetTokenNoneRepositoryResult<AuthResult>

11. APM Repositories (Bizum, Alipay, WeChat)

Purpose: Alternative Payment Methods.

Methods

RepositoryMethodParametersReturn Type
BizumRepositorysendBizumamount: Money
phoneNumber: String
shiftInfo: ShiftInfo?
language: LanguageIso6391?
RepositoryResult<SendBizumResult>
AlipayRepositorymakePaymentamount: Money
tip: Money
qrId: String
transactionName: String
qrIdType: QrIdType
languageIso6391: LanguageIso6391
RepositoryResult<AlipayResult>
AlipayRepositorymakeRefundamount: Money
originalOperationId: String
languageIso6391: LanguageIso6391
RepositoryResult<AlipayResult>
WeChatRepositorymakePaymentamount: Money
tip: Money
qrId: String
transactionName: String?
languageIso6391: LanguageIso6391
RepositoryResult<WeChatResult>
WeChatRepositorymakeRefundamount: Money
originalOperationId: String
languageIso6391: LanguageIso6391
RepositoryResult<WeChatResult>