forCode

fun forCode(context: Context, code: String, declineCode: String? = null): String?

Returns a localized user-facing message for a given error code. This method can be used to display an appropriate error message to the user.

Return

A localized error message, or null if the error code is not recognized.

Parameters

context

The object containing Android context information

code

The error code string from Stripe API (e.g., "incorrect_number", "card_declined")

declineCode

The decline code string from Stripe API (e.g., "insufficient_funds", "card_velocity_exceeded")