Android Models Documentation

This documentation provides detailed information about the models used in the Android SDK. Each model includes a code snippet and a comprehensive description of its properties and usage.

1. Language

@CommonParcelize
@Serializable
enum class Language(
    val isoCode: String
) : CommonParcelable {
    @SerialName("ar")
    ARABIC("ar"),

    @SerialName("en")
    ENGLISH("en"),

    @SerialName("fr")
    FRENCH("fr");

    companion object {
        fun fromIsoCode(isoCode: String): Language {
            return entries.firstOrNull { it.isoCode == isoCode } ?: ENGLISH
        }
    }
}
  • Description: Enum representing different languages supported by the SDK.
  • Enum Cases:
    • ARABIC: Arabic language.
    • ENGLISH: English language.
    • FRENCH: French language.

2. LogLevel

enum class LogLevel(
    val level: String
) {
    Verbose("VERBOSE"),
    Debug("DEBUG"),
    Info("INFO"),
    Warn("WARN"),
    Error("ERROR"),
    Assert("ASSERT");
}
  • Description: Enum representing different levels of logging.
  • Enum Cases:
    • Verbose: Verbose logging.
    • Debug: Debug-level logging.
    • Info: Informational messages.
    • Warn: Warning messages.
    • Error: Error messages.
    • Assert: Assertion failures.

3. DiscountType

@Serializable
@CommonParcelize
enum class DiscountType(val type: String) : CommonParcelable {
    @SerialName("amount")
    AMOUNT("amount"),

    @SerialName("percentage")
    PERCENTAGE("percentage");
}
  • Description: Enum representing the type of discount.
  • Enum Cases:
    • AMOUNT: The discount is a fixed amount.
    • PERCENTAGE: The discount is a percentage of the total.

4. DiscountItem

@Serializable
@CommonParcelize
data class DiscountItem(
    @SerialName("title")
    val title: Map<Language, String>? = null,
    @SerialName("type")
    val type: DiscountType? = null,
    @SerialName("value")
    val value: String? = null
) : CommonParcelable
  • Description: Represents a discount applied to a fee or intent.
  • Properties:
    • title: A map of titles by language, describing the discount.
    • type: The type of discount (DiscountType).
    • value: The value of the discount.

5. DiscountData

@Serializable
@CommonParcelize
data class DiscountData(
    @SerialName("discount")
    val discount: DiscountItem? = null,
    @SerialName("amount")
    val amount: String? = null
) : CommonParcelable
  • Description: Represents data related to a discount applied to an intent.
  • Properties:
    • discount: The DiscountItem associated with the intent.
    • amount: The amount after the discount is applied.

6. FeeItem

@Serializable
@CommonParcelize
data class FeeItem(
    @SerialName("title")
    val title: Map<Language, String>? = null,
    @SerialName("value")
    val value: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("discount")
    val discount: DiscountItem? = null
) : CommonParcelable
  • Description: Represents a fee item associated with an intent.
  • Properties:
    • title: A map of titles by language, describing the fee.
    • value: The value of the fee.
    • discount: The discount applied to this fee, if any.

7. FeesData

@Serializable
@CommonParcelize
data class FeesData(
    @SerialName("amount")
    val amount: String? = null,
    @SerialName("fees")
    val fees: List<FeeItem>? = null
) : CommonParcelable
  • Description: Represents the fees data associated with the intent.
  • Properties:
    • amount: The total amount of the fees.
    • fees: A list of FeeItem objects representing individual fees.

8. ErrorType

@Serializable
@CommonParcelize
enum class ErrorType : CommonParcelable {
    @SerialName("network")
    NETWORK,

    @SerialName("unknown")
    UNKNOWN,

    @SerialName("card_validation")
    CARD_VALIDATION,

    @SerialName("cancelled")
    CANCELLED
}
  • Description: Enum representing different types of errors that can occur in the SDK.
  • Enum Cases:
    • NETWORK: Indicates a network-related issue, such as connectivity problems or API errors.
    • UNKNOWN: An unexpected or unknown error occurred.
    • CARD_VALIDATION: Validation failed for card details provided by the user.
    • CANCELLED: The operation was cancelled by the user or the system.

9. ErrorInfo

@Serializable
@CommonParcelize
data class ErrorInfo(
    @SerialName("key")
    val key: String,
    @SerialName("message")
    val message: String
) : CommonParcelable
  • Description: Represents detailed information about an error.
  • Properties:
    • key: The error key or code.
    • message: The error message.

10. MHThrowable

@Serializable
@CommonParcelize
open class MHThrowable(
    @SerialName("message")
    override val message: String? = null,
    @SerialName("errors")
    val errors: List<ErrorInfo> = listOf(),
    @SerialName("type")
    val type: ErrorType
) : CommonParcelable, Throwable(message)

@Serializable
@CommonParcelize
data class MHError(
    @SerialName("type")
    val type: ErrorType,
    @SerialName("message")
    val message: String,
    @SerialName("errors")
    val errors: List<ErrorInfo>
) : MHThrowable(message, errors, type)
  • Description: Represents an error occurring in the SDK.
  • Properties:
    • type: The type of error (ErrorType).
    • message: A human-readable error message.
    • errors: An array of ErrorInfo objects providing details about the error.

11. AmountData

@Serializable
@Parcelize
data class AmountData(
    @SerialName("value")
    val value: String? = null,
    @SerialName("formatted")
    val formatted: Double? = null,
    @SerialName("currency")
    val currency: String? = null,
    @SerialName("maxPayout")
    val maxPayout: Double? = null
) : Parcelable
  • Description: Represents the monetary value related to an intent.
  • Properties:
    • value: The raw value of the amount.
    • formatted: The formatted amount value.
    • currency: The currency code (e.g., "USD").
    • maxPayout: The maximum payout amount allowed.

12. CardTokenData

@Serializable
@CommonParcelize
data class CardTokenData(
    @SerialName("bin")
    val bin: String? = null,
    @SerialName("brand")
    val brand: String? = null,
    @SerialName("card_holder_name")
    val cardHolderName: String? = null,
    @SerialName("country")
    val country: String? = null,
    @SerialName("expiry_month")
    val expiryMonth: String? = null,
    @SerialName("expiry_year")
    val expiryYear: String? = null,
    @SerialName("issuer")
    val issuer: String? = null,
    @SerialName("last_4")
    val last4: String? = null,
    @SerialName("logo")
    val logo: String? = null,
    @SerialName("payment_methods")
    val paymentMethods: List<String>? = null,
) : CommonParcelable
  • Description: Represents token data for a card used in payment processing.
  • Properties:
    • bin: Bank Identification Number of the card.
    • brand: Brand of the card (e.g., Visa, MasterCard).
    • cardHolderName: Name of the cardholder.
    • country: Country where the card was issued.
    • expiryMonth: Expiry month of the card.
    • expiryYear: Expiry year of the card.
    • issuer: Issuer of the card.
    • last4: Last four digits of the card number.
    • logo: Logo associated with the card brand.
    • paymentMethods: List of payment methods associated with the card.

13. OptionItem

@Serializable
@CommonParcelize
data class OptionItem(
    @SerialName("label")
    val label: String,
    @SerialName("value")
    val value: String
) : CommonParcelable
  • Description: Represents an option item in a selectable list within an input field.
  • Properties:
    • label: The label displayed to the user.
    • value: The value associated with the option.

14. InputFieldType

@Serializable
@CommonParcelize
enum class InputFieldType(val type: String) : CommonParcelable {
    @SerialName("text")
    Text("charfield"),

    @SerialName("email")
    Email("emailfield"),

    @SerialName("phone_number")
    PhoneNumber("phonenumberfield"),

    @SerialName("date_field")
    Date("datefield"),

    @SerialName("number_field")
    Number("numberfield"),

    @SerialName("choice_field")
    Select("choicefield");

    companion object {
        fun from(type: String): InputFieldType {
            return entries.firstOrNull { it.type.equals(type, ignoreCase = true) } ?: Text
        }
    }
}
  • Description: Enum representing the type of an input field.
  • Enum Cases:
    • Text: Standard text input field.
    • Email: Email input field.
    • PhoneNumber: Phone number input field.
    • Date: Date input field.
    • Number: Numeric input field.
    • Select: Dropdown or select input field.

15. InputField

@CommonParcelize
@Serializable
data class InputField(
    @SerialName("type")
    val type: InputFieldType,
    @SerialName("name")
    val name: String?,
    @SerialName("value")
    var value: String?,
    @SerialName("label")
    val label: String?,
    @SerialName("max_length")
    val maxLength: Int?,
    @SerialName("is_required")
    val isRequired: Boolean,
    @SerialName("optionsList")
    val optionsList: List<OptionItem>?,
    @SerialName("options")
    val optionsMap: Map<String, List<OptionItem>>?,
    @SerialName("hint")
    val hint: String?,
    @SerialName("min_length")
    val minLength: Int?,
    @SerialName("read_only")
    val readOnly: Boolean,
    @SerialName("depends_on")
    val dependsOn: String?
) : CommonParcelable
  • Description: Represents a field in a form used for collecting user input.
  • Properties:
    • type: Type of the input field (InputFieldType).
    • name: Name of the input field.
    • value: Current value of the input field.
    • label: Label for the input field.
    • maxLength: Maximum length of the input.
    • isRequired: Indicates if the field is required.
    • optionsList: List of selectable options (List<OptionItem>).
    • optionsMap: Map of selectable options.
    • hint: Hint message for the input field.
    • minLength: Minimum length of the input.
    • readOnly: Indicates if the field is read-only.
    • dependsOn: Specifies another field that this field depends on.

16. IntentStatus

@Serializable
@CommonParcelize
enum class IntentStatus(val status: String) : CommonParcelable {
    @SerialName("PROCESSED")
    PROCESSED("processed"),

    @SerialName("UNPROCESSED")
    UNPROCESSED("unprocessed"),

    @SerialName("TIME_EXPIRED")
    TIME_EXPIRED("timeExpired"),

    @SerialName("CLOSED")
    CLOSED("closed");

    companion object {
        fun from(status: String): IntentStatus {
            return entries.first { it.status == status }
        }
    }
}
  • Description: Enum representing the possible statuses of an intent.
  • Enum Cases:
    • PROCESSED: The intent has been processed.
    • UNPROCESSED: The intent remains unprocessed.
    • TIME_EXPIRED: The intent has expired due to time constraints.
    • CLOSED: The intent has been closed.

17. IntentType

enum class IntentType {
    Payment,
    Payout
}
  • Description: Enum representing the type of intent.
  • Enum Cases:
    • Payment: Represents a payment intent.
    • Payout: Represents a payout intent.

18. IntentData

@Serializable
@CommonParcelize
data class IntentData(
    @SerialName("amount")
    val amount: AmountData? = null,
    @SerialName("secret")
    val secret: String? = null,
    @SerialName("expiration_date")
    val expirationDate: String? = null,
    @SerialName("is_live")
    val isLive: Boolean? = null,
    @SerialName("id")
    val id: String? = null,
    @SerialName("status")
    val status: IntentStatus? = null,
    @SerialName("fees")
    val fees: List<FeeItem>? = null,
    @SerialName("totalDiscount")
    val totalDiscount: String? = null,
    @SerialName("subtotalAmount")
    val subtotalAmount: String? = null
) : Parcelable
  • Description: Represents a payment or payout intent.
  • Properties:
    • id: The unique identifier for the intent.
    • amount: The associated amount data for the intent.
    • secret: A secret key for the intent.
    • isLive: Indicates if the intent is in live mode.
    • status: The current status of the intent.
    • expirationDate: The expiration date of the intent.
    • fees: A list of fees associated with the intent.
    • totalDiscount: The total discount applied to the intent.
    • subtotalAmount: The subtotal amount before discounts and fees.

19. TransactionData

@Serializable
@Parcelize
data class TransactionData(
    @SerialName("billing_data")
    val billingData: String? = null,
    @SerialName("amount")
    val amount: Double? = null,
    @SerialName("external_action_message")
    val externalActionMessage: List<String>? = null,
    @SerialName("amount_currency")
    val amountCurrency: String? = null,
    @SerialName("id")
    val id: String? = null,
    @SerialName("method_name")
    val methodName: String? = null,
    @SerialName("method")
    val method: String? = null,
    @SerialName("created_date")
    val createdDate: String? = null,
    @SerialName("status")
    val status: String? = null,
    @SerialName("custom_fields")
    val customFields: String? = null,
    @SerialName("provider_transaction_fields")
    val providerTransactionFields: String? = null,
    @SerialName("custom_form_answers")
    val customFormAnswers: String? = null
) : Parcelable
  • Description: Represents a transaction in the intent process.
  • Properties:
    • id: The unique identifier for the transaction.
    • createdDate: The date the transaction was created.
    • status: The status of the transaction.
    • amount: The amount involved in the transaction.
    • amountCurrency: The currency of the transaction amount.
    • method: The method used in the transaction.
    • methodName: The name of the payment method.
    • billingData: Billing data associated with the transaction.
    • customFields: Custom fields related to the transaction.
    • customFormAnswers: Custom form answers provided during the transaction.
    • externalActionMessage: External action messages, if any.
    • providerTransactionFields: Fields specific to the transaction provider.

20. ProductItem

@Serializable
@CommonParcelize
data class ProductItem(
    @SerialName("name")
    val name: String? = null,
    @SerialName("type")
    val type: String? = null,
    @SerialName("amount")
    val amount: String? = null,
    @SerialName("category")
    val category: String? = null,
    @SerialName("quantity")
    val quantity: Int? = null,
    @SerialName("description")
    val description: String? = null,
    @SerialName("subcategory")
    val subcategory: String? = null,
    @SerialName("reference_id")
    val referenceId: String? = null
) : CommonParcelable
  • Description: Represents a product item associated with an intent.
  • Properties:
    • name: The name of the product item.
    • type: The type of the product item.
    • amount: The amount associated with the product item.
    • category: The category of the product item.
    • quantity: The quantity of the product item.
    • description: A description of the product item.
    • subcategory: The subcategory of the product item.
    • referenceId: A reference ID associated with the product item.

21. IntentDetails

@Serializable
@Parcelize
data class IntentDetails(
    @SerialName("selected_method")
    val selectedMethod: String? = null,
    @SerialName("intent")
    val intent: IntentData? = null,
    @SerialName("walletBalance")
    val walletBalance: Double? = null,
    @SerialName("transaction")
    val transaction: TransactionData? = null,
    @SerialName("state")
    val state: IntentStateDetails? = null,
    @SerialName("productItems")
    val productItems: List<ProductItem>? = null
) : Parcelable
  • Description: Provides detailed information about an intent.
  • Properties:
    • selectedMethod: The payment method selected for the intent.
    • walletBalance: The wallet balance associated with the current customer.
    • intent: The IntentData object containing core details of the intent.
    • transaction: Details about the transaction (TransactionData).
    • state: The current state of the intent (IntentStateDetails).
    • productItems: A list of product items related to the intent.

22. MethodType

@Serializable
@CommonParcelize
enum class MethodType(val type: String) : CommonParcelable {
    @SerialName("express_method")
    EXPRESS_METHOD("expressMethod"),

    @SerialName("customer_balance")
    CUSTOMER_BALANCE("customerBalance"),

    @SerialName("saved_card")
    SAVE_CARD("savedCard"),

    @SerialName("payment_method")
    PAYMENT_METHOD("paymentMethod"),

    @SerialName("payout_method")
    PAYOUT_METHOD("payoutMethod");
}
  • Description: Enum representing different types of methods available for an intent.
  • Enum Cases:
    • EXPRESS_METHOD: Represents an express payment method.
    • CUSTOMER_BALANCE: Represents a customer balance method.
    • SAVE_CARD: Represents a saved card method.
    • PAYMENT_METHOD: Represents a standard payment method.
    • PAYOUT_METHOD: Represents a payout method.

23. CustomerBalance

@Serializable
@CommonParcelize
data class CustomerBalance(
    @SerialName("balance")
    val balance: Double? = null,
    @SerialName("id")
    val id: String? = null,
    @SerialName("icon")
    val icon: String? = null,
    @SerialName("isSelected")
    val isSelected: Boolean? = null,
    @SerialName("type")
    val type: MethodType? = MethodType.CUSTOMER_BALANCE
) : CommonParcelable
  • Description: Represents a customer balance available for use in an intent.
  • Properties:
    • balance: The balance amount.
    • id: The unique identifier of the customer balance.
    • icon: An icon associated with the balance.
    • isSelected: Indicates if this balance is selected.
    • type: The type of method (MethodType).

24. PaymentMethod

@Serializable
@CommonParcelize
data class PaymentMethod(
    @SerialName("id")
    val id: String? = null,
    @SerialName("title")
    val title: String? = null,
    @SerialName("isSelected")
    val isSelected: Boolean? = null,
    @SerialName("confirmation_required")
    val confirmationRequired: Boolean? = null,
    @SerialName("icons")
    val icons: List<String>? = null,
    @SerialName("type")
    val type: MethodType? = MethodType.PAYMENT_METHOD,
    @SerialName("required_billing_fields")
    val requiredBillingFields: List<InputField>? = null
) : CommonParcelable
  • Description: Represents a payment method available for the user.
  • Properties:
    • id: The unique identifier of the payment method.
    • title: The title or name of the payment method.
    • isSelected: Indicates if this method is selected.
    • confirmationRequired: Indicates if confirmation is required for this method.
    • icons: Icons associated with the payment method.
    • type: The type of method (MethodType).
    • requiredBillingFields: A list of input fields required for billing data (List<InputField>).

25. PayoutMethod

@Serializable
@CommonParcelize
data class PayoutMethod(
    @SerialName("id")
    val id: String? = null,
    @SerialName("title")
    val title: String? = null,
    @SerialName("isSelected")
    val isSelected: Boolean? = null,
    @SerialName("confirmation_required")
    val confirmationRequired: Boolean? = null,
    @SerialName("icons")
    val icons: List<String>? = null,
    @SerialName("type")
    val type: MethodType? = MethodType.PAYOUT_METHOD
) : CommonParcelable
  • Description: Represents a payout method available for the user.
  • Properties:
    • id: The unique identifier of the payout method.
    • title: The title or name of the payout method.
    • isSelected: Indicates if this method is selected.
    • confirmationRequired: Indicates if confirmation is required for this method.
    • icons: Icons associated with the payout method.
    • type: The type of method (MethodType).

26. ExpressMethod

@Serializable
@CommonParcelize
data class ExpressMethod(
    @SerialName("id")
    val id: String? = null,
    @SerialName("title")
    val title: String? = null,
    @SerialName("isSelected")
    val isSelected: Boolean? = null,
    @SerialName("confirmation_required")
    val confirmationRequired: Boolean? = null,
    @SerialName("icons")
    val icons: List<String>? = null,
    @SerialName("type")
    val type: MethodType? = MethodType.EXPRESS_METHOD,
    @SerialName("required_billing_fields")
    val requiredBillingFields: List<InputField>? = null
) : CommonParcelable
  • Description: Represents an express payment method.
  • Properties:
    • id: The unique identifier of the express method.
    • title: The title or name of the express method.
    • isSelected: Indicates if this method is selected.
    • confirmationRequired: Indicates if confirmation is required for this method.
    • icons: Icons associated with the express method.
    • type: The type of method (MethodType).
    • requiredBillingFields: A list of input fields required for billing data (List<InputField>).

28. SavedCard

@Serializable
@CommonParcelize
data class SavedCard(
    @SerialName("id")
    val id: String? = null,
    @SerialName("brand")
    val brand: String? = null,
    @SerialName("last_4")
    val last4: String? = null,
    @SerialName("expiry_month")
    val expiryMonth: String? = null,
    @SerialName("expiry_year")
    val expiryYear: String? = null,
    @SerialName("country")
    val country: String? = null,
    @SerialName("logo")
    val logo: String? = null,
    @SerialName("bin")
    val bin: String? = null,
    @SerialName("type")
    val type: MethodType? = MethodType.SAVE_CARD
) : CommonParcelable
  • Description: Represents a saved card used in transactions.
  • Properties:
    • id: The unique identifier of the saved card.
    • brand: The brand of the card (e.g., Visa, MasterCard).
    • last4: The last four digits of the card number.
    • expiryMonth: The expiry month of the card.
    • expiryYear: The expiry year of the card.
    • country: The country where the card was issued.
    • logo: The logo associated with the card brand.
    • bin: Bank Identification Number of the card.
    • type: The type of method (MethodType).

29. IntentMethods

@Serializable
@CommonParcelize
data class IntentMethods(
    @SerialName("customer_balances")
    val customerBalances: List<CustomerBalance>? = null,
    @SerialName("payment_methods")
    val paymentMethods: List<PaymentMethod>? = null,
    @SerialName("express_methods")
    val expressMethods: List<ExpressMethod>? = null,
    @SerialName("saved_cards")
    val savedCards: List<SavedCard>? = null,
    @SerialName("payout_methods")
    val payoutMethods: List<PayoutMethod>? = null
) : CommonParcelable
  • Description: Represents different payment methods available for an intent.
  • Properties:
    • customerBalances: A list of available customer balances.
    • paymentMethods: A list of available payment methods.
    • expressMethods: A list of available express methods.
    • savedCards: A list of saved cards.
    • payoutMethods: A list of available payout methods.

30. MethodsResult

@Serializable
@CommonParcelize
data class MethodsResult(
    @SerialName("intentMethods")
    val intentMethods: IntentMethods? = null,
    @SerialName("intentDetails")
    val intentDetails: IntentDetails? = null
) : CommonParcelable
  • Description: Represents the result of available methods for an intent.
  • Properties:
    • intentMethods: Contains the available payment methods (IntentMethods).
    • intentDetails: Provides detailed information about the intent (IntentDetails).

31. IntentStateDetails

@CommonParcelize
@Serializable
sealed class IntentStateDetails : CommonParcelable {

    /**
     * Represents the state where the user can select from available payment methods.
     *
     * @property methods The methods available for selection during intent processing.
     */
    @Serializable
    @SerialName("method_selection")
    data class MethodSelection(
        @SerialName("methods")
        val methods: IntentMethods
    ) : IntentStateDetails()

    /**
     * Represents the state where the intent form is need to be displayed for user input.
     */
    @Serializable
    @SerialName("intent_form")
    object IntentForm : IntentStateDetails()

    /**
     * Represents the state where the intent has been successfully processed.
     */
    @Serializable
    @SerialName("intent_processed")
    object IntentProcessed : IntentStateDetails()

    /**
     * Represents the state where the transaction is waiting for user action.
     */
    @Serializable
    @SerialName("transaction_waiting_user_action")
    object TransactionWaitingUserAction : IntentStateDetails()

    /**
     * Represents the state where the transaction has failed.
     *
     * @property recommendedMethods A list of recommended methods for the user to attempt another transaction if available.
     */
    @Serializable
    @SerialName("transaction_failed")
    data class TransactionFailed(val recommendedMethods: IntentMethods?) : IntentStateDetails()

    /**
     * Represents a state indicating that the intent has expired.
     */
    @Serializable
    @SerialName("expired")
    object Expired : IntentStateDetails()

    /**
     * Represents a state indicating that the intent has been closed.
     */
    @Serializable
    @SerialName("closed")
    object Closed : IntentStateDetails()

    /**
     * Represents the state where the card intent has been succeeded.
     */
    @Serializable
    @SerialName("card_intent_successful")
    object CardIntentSuccessful : IntentStateDetails()

    /**
     * Represents the state where the card intent has been failed.
     */
    @Serializable
    @SerialName("card_intent_failed")
    object CardIntentFailed : IntentStateDetails()

    /**
     * Represents the state where form fields are presented for user input.
     *
     * @property tokenizeCardInfo The information required to render/tokenize card data, if applicable.
     * @property billingFields A list of input fields required for billing information.
     * @property shippingFields A list of input fields required for shipping information.
     */
    @Serializable
    @SerialName("form_fields")
    data class FormFields(
        @SerialName("tokenizeCardInfo")
        val tokenizeCardInfo: TokenizeCardInfo? = null,
        @SerialName("billingFields")
        val billingFields: List<InputField>? = null,
        @SerialName("shippingFields")
        val shippingFields: List<InputField>? = null
    ) : IntentStateDetails()

    /**
     * Represents the state where a URL needs to be rendered, potentially for web interaction.
     *
     * @property url The URL to be rendered.
     * @property renderStrategy The strategy for rendering the URL (e.g., IFRAME or REDIRECT).
     */
    @Serializable
    @SerialName("url_to_render")
    data class UrlToRender(
        @SerialName("url")
        val url: String?,
        @SerialName("renderStrategy")
        val renderStrategy: RenderStrategy?
    ) : IntentStateDetails()

    /**
     * Represents the state where a saved card's CVV is required for processing.
     *
     * @property cvvField The input field used to capture the CVV.
     * @property cardTokenData The tokenized data for the card being processed.
     */
    @Serializable
    @SerialName("saved_card_cvv")
    data class SavedCardCVV(
        @SerialName("cvvField")
        val cvvField: InputField,
        @SerialName("cardTokenData")
        val cardTokenData: CardTokenData?
    ) : IntentStateDetails()

    /**
     * Represents the state where native payment options (e.g., Apple Pay, Google Pay) are available.
     *
     * @property nativePayData The data required to process a payment using a native payment method.
     */
    @Serializable
    @SerialName("native_pay")
    data class NativePay(
        @SerialName("nativePayData")
        val nativePayData: NativePayData?
    ) : IntentStateDetails()
}
  • Description: Class representing various states of an intent during the payment or payout process.
  • Subsections:

MethodSelection

@Serializable
@SerialName("method_selection")
data class MethodSelection(
    @SerialName("methods")
    val methods: IntentMethods
) : IntentStateDetails()
  • Description: Represents the state where the user selects a payment method from the available options.
  • Properties:
    • methods: The available methods for selection (IntentMethods).

IntentForm

@Serializable
@SerialName("intent_form")
object IntentForm : IntentStateDetails()
  • Description: Represents the state where a form is displayed to the user for entering payment or other details.

IntentProcessed

@Serializable
@SerialName("intent_processed")
object IntentProcessed : IntentStateDetails()
  • Description: Represents the state where the intent has been processed successfully.

TransactionWaitingUserAction

@Serializable
@SerialName("transaction_waiting_user_action")
object TransactionWaitingUserAction : IntentStateDetails()
  • Description: Represents the state where the transaction is waiting for user action (e.g., confirmation or additional input).

TransactionFailed

@Serializable
@SerialName("transaction_failed")
data class TransactionFailed(val recommendedMethods: IntentMethods?) : IntentStateDetails()
  • Description: Represents the state where the transaction has failed.
  • Properties:
    • recommendedMethods: Optional recommended methods for retrying the transaction (IntentMethods?).

Expired

@Serializable
@SerialName("expired")
object Expired : IntentStateDetails()
  • Description: Represents the state where the intent has expired due to time constraints or other conditions.

Closed

@Serializable
@SerialName("closed")
object Closed : IntentStateDetails()
  • Description: Represents the state where the intent has been closed.

CardIntentSuccessful

@Serializable
@SerialName("card_intent_successful")
object CardIntentSuccessful : IntentStateDetails()
  • Description: Represents the state where the card intent has been successfully processed.

CardIntentFailed

@Serializable
@SerialName("card_intent_failed")
object CardIntentFailed : IntentStateDetails()
  • Description: Represents the state where the card intent has failed.

FormFields

@Serializable
@SerialName("form_fields")
data class FormFields(
    @SerialName("tokenizeCardInfo")
    val tokenizeCardInfo: TokenizeCardInfo? = null,
    @SerialName("billingFields")
    val billingFields: List<InputField>? = null,
    @SerialName("shippingFields")
    val shippingFields: List<InputField>? = null
) : IntentStateDetails()
  • Description: Represents the state where form fields (e.g., billing, shipping, or card details) are required for the intent.
  • Properties:
    • tokenizeCardInfo: Information for tokenizing a card (TokenizeCardInfo?).
    • billingFields: A list of billing input fields (List<InputField>?).
    • shippingFields: A list of shipping input fields (List<InputField>?).

UrlToRender

@Serializable
@SerialName("url_to_render")
data class UrlToRender(
    @SerialName("url")
    val url: String?,
    @SerialName("renderStrategy")
    val renderStrategy: RenderStrategy?
) : IntentStateDetails()
  • Description: Represents the state where a URL needs to be rendered or the user needs to be redirected to it.
  • Properties:
    • url: The URL to render or redirect to (String?).
    • renderStrategy: The strategy for rendering the URL (e.g., IFRAME, REDIRECT) (RenderStrategy?).

SavedCardCVV

@Serializable
@SerialName("saved_card_cvv")
data class SavedCardCVV(
    @SerialName("cvvField")
    val cvvField: InputField,
    @SerialName("cardTokenData")
    val cardTokenData: CardTokenData?
) : IntentStateDetails()
  • Description: Represents the state where the user is required to enter the CVV for a saved card.
  • Properties:
    • cvvField: The CVV input field (InputField).
    • cardTokenData: Token data for the saved card (CardTokenData?).

NativePay

@Serializable
@SerialName("native_pay")
data class NativePay(
    @SerialName("nativePayData")
    val nativePayData: NativePayData?
) : IntentStateDetails()
  • Description: Represents the state where native payment options (e.g., Apple Pay, Google Pay) are available for the transaction.
  • Properties:
    • nativePayData: Data related to native payment methods (NativePayData?).

32. MethodMetaData

data class MethodMetaData(
    val cvv: String? = null
)
  • Description: Contains metadata related to a payment method, such as CVV.
  • Properties:
    • cvv: The CVV code for a card.

33. RenderStrategy

@Serializable
@CommonParcelize
enum class RenderStrategy(val strategy: String) : CommonParcelable {
    @SerialName("iframe")
    IFRAME("iframe"),

    @SerialName("popup_iframe")
    POPUP_IFRAME("popup_iframe"),

    @SerialName("redirect")
    REDIRECT("redirect"),

    @SerialName("none")
    NONE("none");
}
  • Description: Enum representing different strategies for rendering web content within the SDK.
  • Enum Cases:
    • IFRAME: Content is rendered within an iframe.
    • POPUP_IFRAME: Content is rendered within a popup iframe.
    • REDIRECT: Content is rendered via a URL redirect.
    • NONE: No rendering strategy is applied.

34. SaveCardCheckbox

@Serializable
@CommonParcelize
data class SaveCardCheckbox(
    @SerialName("mandatory")
    val mandatory: Boolean? = null,
    @SerialName("show")
    val show: Boolean? = null
) : CommonParcelable
  • Description: Represents the configuration for the save card checkbox.
  • Properties:
    • mandatory: Indicates if saving the card is mandatory.
    • show: Indicates if the save card checkbox should be shown.

35. TokenizeCardInfo

@Serializable
@CommonParcelize
data class TokenizeCardInfo(
    @SerialName("access_token")
    val accessToken: String? = null,
    @SerialName("is_live")
    val isLive: Boolean? = null,
    @SerialName("save_card")
    val saveCard: Boolean? = null,
    @SerialName("save_card_checkbox")
    val saveCardCheckbox: SaveCardCheckbox? = null
) : CommonParcelable
  • Description: Represents the data needed to tokenize a card in the payment process.
  • Properties:
    • accessToken: An access token used for tokenizing the card.
    • isLive: Indicates if the card is in live mode.
    • saveCard: Indicates if the card should be saved.
    • saveCardCheckbox: Configuration for the save card checkbox (SaveCardCheckbox).

36. NativePayData

@Serializable
@CommonParcelize
sealed class NativePayData : CommonParcelable {

    @Serializable
    @CommonParcelize
    @SerialName("apple_pay")
    data class ApplePayData(
        @SerialName("country_code")
        val countryCode: String? = null,
        @SerialName("merchant_id")
        val merchantId: String? = null,
        @SerialName("currency_code")
        val currencyCode: String? = null,
        @SerialName("amount")
        val amount: Double? = null,
        @SerialName("supported_networks")
        val supportedNetworks: List<String>? = null
    ) : NativePayData(), CommonParcelable

    @Serializable
    @CommonParcelize
    @SerialName("google_pay")
    data class GooglePay(
        @SerialName("country_code")
        val countryCode: String? = null,
        @SerialName("gateway")
        val gateway: String? = null,
        @SerialName("currency_code")
        val currencyCode: String? = null,
        @SerialName("amount")
        val amount: Double? = null,
        @SerialName("gateway_merchant_id")
        val gatewayMerchantID: String? = null,
        @SerialName("merchant_id")
        val merchantId: String? = null,
        @SerialName("merchant_name")
        val merchantName: String? = null
    ) : NativePayData(), CommonParcelable
}
  • Description: Contains data necessary for configuring a native payment transaction.
  • Subsections:

GooglePay

@Serializable
@CommonParcelize
@SerialName("google_pay")
data class GooglePay(
    @SerialName("country_code")
    val countryCode: String? = null,
    @SerialName("gateway")
    val gateway: String? = null,
    @SerialName("currency_code")
    val currencyCode: String? = null,
    @SerialName("amount")
    val amount: Double? = null,
    @SerialName("gateway_merchant_id")
    val gatewayMerchantID: String? = null,
    @SerialName("merchant_id")
    val merchantId: String? = null,
    @SerialName("merchant_name")
    val merchantName: String? = null
) : NativePayData(), CommonParcelable
  • Description: Contains data necessary for configuring a Google Pay transaction.
  • Properties:
    • countryCode: The country code for the transaction (e.g., "US").
    • gateway: The payment gateway used for processing the transaction.
    • currencyCode: The currency code for the transaction (e.g., "USD").
    • amount: The amount to be charged in the transaction.
    • gatewayMerchantID: The merchant ID associated with the payment gateway.
    • merchantId: The Google Pay merchant identifier.
    • merchantName: The name of the merchant handling the transaction.

GooglePay

@Serializable
@CommonParcelize
@SerialName("google_pay")
data class GooglePay(
    @SerialName("country_code")
    val countryCode: String? = null,
    @SerialName("gateway")
    val gateway: String? = null,
    @SerialName("currency_code")
    val currencyCode: String? = null,
    @SerialName("amount")
    val amount: Double? = null,
    @SerialName("gateway_merchant_id")
    val gatewayMerchantID: String? = null
) : NativePayData(), CommonParcelable
  • Description: Contains data necessary for configuring a Google Pay transaction.
  • Properties:
    • countryCode: The country code for the transaction (e.g., "US").
    • gateway: The payment gateway used for Google Pay.
    • currencyCode: The currency code for the transaction (e.g., "USD").
    • amount: The amount to be charged.
    • gatewayMerchantID: The merchant ID associated with the payment gateway.

37. CardFieldType

@Serializable
@CommonParcelize
enum class CardFieldType(val type: String, val label: String) : CommonParcelable {
    @SerialName("card_number")
    CARD_NUMBER("card_number", LocalizationManager.strings.card_number),

    @SerialName("expire_month")
    EXPIRE_MONTH("expire_month", LocalizationManager.strings.expiry_month),

    @SerialName("expire_year")
    EXPIRE_YEAR("expire_year", LocalizationManager.strings.expiry_year),

    @SerialName("cvv")
    CVV("cvv", LocalizationManager.strings.cvv),

    @SerialName("card_holder_name")
    CARD_HOLDER_NAME("card_holder_name", LocalizationManager.strings.card_holder_name);
}
  • Description: Enum representing different types of card fields used in forms.
  • Enum Cases:
    • CARD_NUMBER: Represents the card number field.
    • EXPIRE_MONTH: Represents the expiration month field.
    • EXPIRE_YEAR: Represents the expiration year field.
    • CVV: Represents the CVV field (Card Verification Value).
    • CARD_HOLDER_NAME: Represents the cardholder’s name field.

38. CardInputFieldState

data class CardInputFieldState(
    val isValid: Boolean? = null,
    val errorMessage: String? = null,
    val isOnFocused: Boolean = false,
    val length: Int = 0
)
  • Description: Represents the state of a card input field.
  • Properties:
    • isValid: Indicates whether the input in the field is valid.
      • A value of null means the validity is unknown at this moment.
    • errorMessage: Contains an error message when the input is invalid.
      • A value of null implies there is no error message to display.
    • isOnFocused: Indicates whether the input field is currently focused by the user.
      • Useful for applying different styles or behaviors when a user interacts with the field.
      • The default value is false.
    • length: The length of the current input.

39. VaultData

@Serializable
@CommonParcelize
data class VaultData(
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("first_six_digits")
    val firstSixDigits: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("last_four_digits")
    val lastFourDigits: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("card_scheme")
    val cardScheme: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("card_holder_name")
    val cardHolderName: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("expiry_year")
    val expiryYear: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("expiry_month")
    val expiryMonth: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("is_live")
    val isLive: Boolean? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("access_token")
    val accessToken: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("card_token")
    val cardToken: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("cvv")
    val cvv: String? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("save_card")
    val saveCard: Boolean? = null,
    @EncodeDefault(EncodeDefault.Mode.NEVER)
    @SerialName("fingerprint")
    val fingerprint: String? = null
) : CommonParcelable
  • Description: Represents the data stored in the vault for a card used in payment processing.
  • Properties:
    • firstSixDigits: The first six digits of the card number.
    • lastFourDigits: The last four digits of the card number.
    • cardScheme: The payment card scheme (e.g., VISA, MasterCard).
    • cardHolderName: The name of the cardholder.
    • expiryYear: The expiration year of the card.
    • expiryMonth: The expiration month of the card.
    • isLive: Indicates whether the card is live or not.
    • accessToken: The access token for authorizing the card.
    • cardToken: The token associated with the card for secure transactions.
    • cvv: The CVV code for the card.
    • saveCard: Indicates whether to save the card details for future use.
    • fingerprint: A unique identifier for the card to prevent fraud.

40. Brand

@Serializable
@CommonParcelize
enum class Brand : CommonParcelable {
    @SerialName("visa")
    VISA,

    @SerialName("mastercard")
    MASTERCARD,

    @SerialName("mada")
    MADA,

    @SerialName("unknown")
    UNKNOWN
}
  • Description: Enum representing different card brands.
  • Enum Cases:
    • VISA: Visa card brand.
    • MASTERCARD: MasterCard brand.
    • MADA: Mada card brand.
    • UNKNOWN: Unknown card brand.

41. CardBrand

@Serializable
@CommonParcelize
data class CardBrand(
    @SerialName("brand")
    val brand: Brand,
    @SerialName("first6Digits")
    val first6Digits: String = "",
    @SerialName("brandIconUrl")
    val brandIconUrl: String
) : CommonParcelable
  • Description: Represents the card brand information based on the first six digits.
  • Properties:
    • brand: The brand of the card (Brand enum).
    • first6Digits: The first six digits of the card number.
    • brandIconUrl: The URL of the brand’s icon.

42. NativeGooglePayConfig

@CommonParcelize
@Serializable
data class NativeGooglePayConfig(
    @SerialName("environment")
    val environment: GooglePayEnvironment,

    @SerialName("allowedCards")
    val allowedCards: List<AllowedCards>,

    @SerialName("supportedMethods")
    val supportedMethods: List<SupportedMethods>
) : CommonParcelable
  • Description: Represents the configuration details for Google Pay integration within the MoneyHash SDK.
  • Properties:
    • environment: The Google Pay environment to use, either TEST or PRODUCTION (GooglePayEnvironment).
    • allowedCards: A list of card brands allowed in the Google Pay flow (List<AllowedCards>).
    • supportedMethods: A list of supported payment methods, such as PAN_ONLY and CRYPTOGRAM_3DS (List<SupportedMethods>).
  • Companion Object:
    • The companion object provides a default() method that returns the default configuration for Google Pay:
      • environment: GooglePayEnvironment.PRODUCTION
      • allowedCards: All card types supported by Google Pay (AllowedCards.entries)
      • supportedMethods: All payment methods supported by Google Pay (SupportedMethods.entries)

43. SupportedMethods

@CommonParcelize
@Serializable
enum class SupportedMethods : CommonParcelable {
    @SerialName("PAN_ONLY")
    PAN_ONLY,

    @SerialName("CRYPTOGRAM_3DS")
    CRYPTOGRAM_3DS
}
  • Description: Enum representing the supported payment methods in Google Pay.
  • Enum Cases:
    • PAN_ONLY: Traditional card number entry (PAN).
    • CRYPTOGRAM_3DS: 3D Secure cryptogram for more secure transactions.

44. GooglePayEnvironment

@CommonParcelize
@Serializable
enum class GooglePayEnvironment(val value: Int) : CommonParcelable {
    @SerialName("TEST")
    TEST(WalletConstants.ENVIRONMENT_TEST),

    @SerialName("PRODUCTION")
    PRODUCTION(WalletConstants.ENVIRONMENT_PRODUCTION)
}
  • Description: Enum representing the environment in which Google Pay operates.
  • Enum Cases:
    • TEST: Google Pay operates in a testing environment.
    • PRODUCTION: Google Pay operates in a production environment.

45. AllowedCards

@CommonParcelize
@Serializable
enum class AllowedCards : CommonParcelable {
    @SerialName("AMEX")
    AMEX,

    @SerialName("DISCOVER")
    DISCOVER,

    @SerialName("INTERAC")
    INTERAC,

    @SerialName("JCB")
    JCB,

    @SerialName("MASTERCARD")
    MASTERCARD,

    @SerialName("VISA")
    VISA
}
  • Description: Enum representing the card networks that are allowed for Google Pay transactions.
  • Enum Cases:
    • AMEX: American Express.
    • DISCOVER: Discover.
    • INTERAC: Interac (Canada).
    • JCB: Japan Credit Bureau (JCB).
    • MASTERCARD: MasterCard.
    • VISA: Visa.