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
// Generate card token
val result = coreMethods.generateCardToken(
cardNumberState = cardNumberPCIState,
expirationDateState = expirationPCIState,
securityCodeState = securityCodePCIState,
buyerIdentification = buyerHolder
)
See also
Types
Companion object for the CoreMethods class.
Functions
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. The method returns a Result type that can be either Success with a CardToken or Error with details.
Generate Card Token with a cardId call.
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. The result includes issuer details such as ID, name, and processing capabilities.
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. The result includes validation rules for each identification type.
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. The result includes detailed information about each installment option including rates and fees.
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. The result includes detailed information about each payment method including fees, processing times, and required fields.