Skip to Content
Docs

Change the drop-in's text

Replace the texts the drop-in shows, to translate the sheet or to match your app's wording.

PayDropInStrings holds the texts displayed in the drop-in. All default strings are in English. Supply localized values from your app (for example, from your string resources) to support other languages, and pass them as the drop-in's strings.

Placeholders in braces, such as {amount} and {method}, are replaced where the defaults below show them. Card brand names aren't configured here, and the 3DS challenge screen's title comes from a string resource in pay-threeds.

val strings = PayDropInStrings(title = getString(R.string.checkout_title), pay = getString(R.string.checkout_pay))
val dropIn = PayDropIn(checkout, PayDropIn.Configuration(strings = strings))

Parameters

The sheet and its methods

These texts cover the sheet's title, its close button, and the list of methods.

ParameterTypeRequiredDescription
titleStringNoThe sheet's title in a setup session. At checkout, the sheet has no title. It shows your merchantDisplayName and the total. Default: Payment.
payoutTitleStringNoThe title in a payout session, instead of title. Default: Payout method.
closeStringNoThe close button's accessibility label. Default: Close.
payWithStringNoAbove the methods. Default: Pay with.
getPaidWithStringNoAbove the methods in a payout session, instead of payWith. Default: Get paid with.
cardStringNoThe card's row. Default: Card.
orSeparatorStringNoBetween the Google Pay button and the other methods. Default: or.
methodNamesMap<String, String>NoRow titles by payment method type, for example mapOf("ideal" to "iDEAL"). They come before the names the drop-in finds itself. Default: none.

Without a name in methodNames, a row shows the method's name as Pay.com.js shows it. Without that, it shows the built-in name for paypal, ideal, sofort, bancontact, giropay, eps, klarna, blik, p24, przelewy24, trustly, sepa, multibanco, mbway, cashapp, and venmo. Other types show their type, with spaces for underscores and hyphens, and a capital first letter.

The card form

These texts cover the card fields, their errors, and the save-card switch.

ParameterTypeRequiredDescription
cardInformationStringNoAbove the card fields. Default: Card information.
cardNumberStringNoThe card number field's label. Default: Card number.
expiryStringNoThe expiration date field's label. Default: Expiry date.
cvcStringNoThe security code field's label. Default: CVV.
nameStringNoThe name field's label. Default: Name on card.
numberPlaceholderStringNoIn the card number field, while it's focused and empty. Default: 1234 1234 1234 1234.
expiryPlaceholderStringNoIn the expiration date field, while it's focused and empty. Default: MM / YY.
cvcPlaceholderStringNoIn the security code field, while it's focused and empty. Default: 123.
namePlaceholderStringNoIn the name field, while it's focused and empty. Default: empty, for none.
numberInvalidStringNoUnder an invalid card number, and under an incomplete one after the customer taps the button. Default: Card number is invalid.
expiryInvalidStringNoUnder an invalid expiration date, and under an incomplete one after the customer taps the button. Default: Expiry date is invalid.
cvcInvalidStringNoUnder an invalid security code, and under an incomplete one after the customer taps the button, in the card form and under a saved card's CVV at checkout. Default: CVV must be 3 or 4 digits.
requiredStringNoUnder an empty required field after the customer taps the button, and under an invalid name. Default: Required.
saveCardStringNoThe save-card switch. Default: Save card for future use.
saveCardAtMerchantStringNoThe save-card switch, instead of saveCard, when you set merchantDisplayName. Default: Save card for future use at {merchant}.

The button

These texts cover the main button and the card brands under it.

ParameterTypeRequiredDescription
payAmountStringNoThe button, when the session has an amount and a currency. {amount} is formatted for the device's locale, for example $10.00. Default: Pay {amount}.
payStringNoThe button, when the session has no amount. Default: Pay.
addPaymentMethodStringNoThe button in a setup session. Default: Add your payment method.
usePaymentMethodStringNoThe button while a saved method is selected, and always in a payout session. Default: Use payment method.
acceptedCardsStringNoWhat TalkBack reads before the card brands under the button, as in "Accepted cards: Visa, Mastercard". Default: Accepted cards.

Saved methods

These texts cover the saved methods and removing them.

ParameterTypeRequiredDescription
savedPaymentMethodsStringNoAbove the saved methods, in a setup session. Default: Saved payment methods.
defaultBadgeStringNoNext to the customer's default method. Default: Default.
savedCardStringNoA saved card's title, when it has no brand. Default: Card.
bankAccountStringNoA saved bank account's title, when it has no bank name. Default: Bank account.
expiresStringNoUnder a saved card. {date} is its expiration date as MM/YY. Default: Expires {date}.
editStringNoThe button that lets the customer remove saved methods. Default: Edit.
doneStringNoThe same button, while they're removing. Default: Done.
removeTitleStringNoThe question before a method is removed. {method} is its row's title. Default: Remove {method}?.
removeStringNoThe answer that removes it, and each row's remove button. Default: Remove.
cancelStringNoThe answer that keeps it. Default: Cancel.

A saved method's row title is its card brand and last 4 digits (Visa •••• 4242), its bank name and last 4 digits, or its method's name and email.

Saved methods at checkout

These texts cover the carousel and the Payment methods page a returning customer sees at checkout.

ParameterTypeRequiredDescription
changeStringNoThe button under the carousel that opens Payment methods. Default: Change.
changePaymentMethodStringNoWhat TalkBack reads for that button. Default: Change payment method.
paymentMethodsStringNoThe title of the page that lists every saved method. Default: Payment methods.
otherWaysToPayStringNoThe last group of Payment methods, and the title of the page it opens (containing the card form and the session's other methods). Default: Other ways to pay.
backStringNoWhat TalkBack reads for the pages' back button. Default: Back.
cvcForCardStringNoThe label of a saved card's CVV field. {method} is the card, for example Visa •••• 4242. Default: CVV for {method}.
endingInStringNoWhat TalkBack reads for a saved method, as in "Visa ending in 4242". {name} is the brand, and {last4} the last 4 digits. Default: {name} ending in {last4}.
positionStringNoWhat TalkBack reads for a method's place in the carousel, as in "1 of 4". Default: {index} of {count}.
removeMethodStringNoWhat TalkBack reads for a row's delete button on Payment methods. {method} is the method as endingIn names it. Default: Remove {method}.

Failure messages

The sheet shows these messages after a failed attempt.

ParameterTypeRequiredDescription
declinedStringNoAfter a decline, when the customer can try again. Default: Your payment method has been declined.
maxAttemptsStringNoAfter the session's last attempt was declined. Default: You have reached the maximum number of payment attempts.
sessionExpiredStringNoWhen the session has expired. Default: The session has expired and payment can no longer be made.
sessionEndedStringNoWhen the session was paid, or its payment ended. Default: This payment can no longer be completed.
amountChangedStringNoWhen the session's total changed before the payment was charged. The button then shows the new total. Default: The total has changed. Check the new total, then pay again.
networkStringNoWhen a request didn't reach Pay.com. Default: Check your connection and try again.
genericStringNoAfter any other failure. Default: Something went wrong. Please try again.

Example

Take the texts from your app's string resources, so its translations apply:

fun Context.dropInStrings() = PayDropInStrings(
    title = getString(R.string.checkout_title),
    payWith = getString(R.string.checkout_pay_with),
    card = getString(R.string.checkout_card),
    cardInformation = getString(R.string.checkout_card_information),
    cardNumber = getString(R.string.checkout_card_number),
    expiry = getString(R.string.checkout_expiry),
    cvc = getString(R.string.checkout_cvc),
    name = getString(R.string.checkout_name),
    required = getString(R.string.checkout_required),
    numberInvalid = getString(R.string.checkout_number_invalid),
    expiryInvalid = getString(R.string.checkout_expiry_invalid),
    cvcInvalid = getString(R.string.checkout_cvc_invalid),
    saveCardAtMerchant = getString(R.string.checkout_save_card_at), // For example "Karte bei {merchant} speichern"
    pay = getString(R.string.checkout_pay),
    payAmount = getString(R.string.checkout_pay_amount),            // For example "{amount} bezahlen"
    declined = getString(R.string.checkout_declined),
    amountChanged = getString(R.string.checkout_amount_changed),
    network = getString(R.string.checkout_network),
    generic = getString(R.string.checkout_generic),
    methodNames = mapOf("ideal" to "iDEAL"),
)

val dropIn = PayDropIn(checkout, PayDropIn.Configuration(merchantDisplayName = "My Shop", strings = dropInStrings()))

Next steps

Was this page helpful?