CoreMethods

CoreMethods is the main class responsible for handling all core payment-related operations in the MercadoPago SDK. It provides methods for card tokenization, installment calculations, and payment method management. This class ensures secure handling of sensitive card data through PCI-compliant field states.

Example:

// Get CoreMethods instance
val coreMethods = MercadoPagoSDK.getInstance().coreMethods

See also

Types

Link copied to clipboard
object Companion

Companion object for the CoreMethods class.

Functions

Link copied to clipboard
suspend fun generateCardToken(cardNumberState: PCIFieldState, expirationDateState: PCIFieldState, securityCodeState: PCIFieldState, buyerIdentification: BuyerIdentification): Result<CardToken, ResultError>

Generates a secure card token from the provided card details. This method handles the tokenization of card information in a PCI-compliant manner, ensuring sensitive data is never exposed in the application.

suspend fun generateCardToken(cardId: String, securityCodeState: PCIFieldState, expirationDateState: PCIFieldState? = null, buyerIdentification: BuyerIdentification): Result<CardToken, ResultError>

Generate Card Token with a cardId call. This uses the PCIFieldState for pass the values of the card in a secure way

Link copied to clipboard
suspend fun getCardIssuers(bin: String, paymentMethodId: String): Result<List<CardIssuer>, ResultError>

Retrieves the list of available card issuers for a given card BIN and payment method. This method helps identify which banks or financial institutions can process the card based on its first digits and the selected payment method.

Link copied to clipboard

Retrieves the list of available identification types for the current country. This method helps identify which types of identification documents (CPF, CNPJ, DNI, etc.) are accepted for payment processing in the current market.

Link copied to clipboard
suspend fun getInstallments(bin: String, amount: BigDecimal, processingMode: ProcessingMode = ProcessingMode.Aggregator): Result<List<Installment>, ResultError>

Retrieves available installment options for a given card and amount. This method calculates all possible installment plans based on the card's BIN, transaction amount, and processing mode.

Link copied to clipboard

Retrieves the list of available payment methods for a given card BIN. This method helps identify which payment methods (credit card, debit card, etc.) can be used based on the card's first digits.