Skip to Content
Docs

Change the drop-in's text

Replace any text the drop-in shows, for example to translate the sheet or match your app's wording.

PayDropInStrings holds every text the drop-in displays. All default strings are in English. Supply localized values from your app to support other languages, and pass them as the configuration's strings. Placeholders in braces, such as {amount} and {method}, are replaced where they appear.

var strings = PayDropInStrings()
strings.title = String(localized: "Payment")
configuration.strings = strings

Properties

PropertyDefaultWhere it shows
titlePaymentThe sheet's title in a setup session. At checkout, the sheet has no title. It shows your merchantDisplayName and the total.
closeCloseWhat VoiceOver reads for the close button.
payWithPay withAbove the list of methods.
cardCardThe card's row in the list.
cardInformationCard informationAbove the card form.
cardNumber, expiry, cvc, nameCard number, Expiry date, CVV, Name on cardWhat VoiceOver reads for each card input.
numberPlaceholder, expiryPlaceholder, cvcPlaceholder, namePlaceholderCard number, MM / YY, CVV, Name on cardThe card inputs' placeholders. An empty namePlaceholder shows none.
requiredRequiredUnder an empty required field after the customer taps the Pay button, and under an invalid name.
numberInvalidCard number is invalidUnder an invalid card number, or an incomplete one after the customer taps the Pay button.
expiryInvalidExpiry date is invalidUnder an invalid or incomplete expiration date, in the same way.
cvcInvalidCVV must be 3 or 4 digitsUnder an invalid or incomplete CVV, in the same way, and under a saved card's CVV at checkout.
saveCardSave card for future useThe save-card switch, when there's no merchantDisplayName.
saveCardAtMerchantSave card for future use at {merchant}The save-card switch, with merchantDisplayName.
payPayThe Pay button, when the session has no amount.
payAmountPay {amount}The Pay button, with the session's amount formatted in its currency.
addPaymentMethodAdd your payment methodThe button in a setup session.
usePaymentMethodUse payment methodThe button for a saved method, and for any method in a payout session.
acceptedCardsAccepted cardsWhat VoiceOver reads before the card brands under the Pay button, as in "Accepted cards: Visa, Mastercard".
declinedYour payment method has been declined.After a decline the customer can retry.
maxAttemptsYou have reached the maximum number of payment attempts.After the session's last attempt was declined.
sessionExpiredThe session has expired and payment can no longer be made.When the session has expired.
sessionEndedThis payment can no longer be completed.When the session was already paid, or the payment ended.
amountChangedThe total has changed. Check the new total, then pay again.When the session's total changed before the payment was charged. The button then shows the new total.
networkCheck your connection and try again.After a network failure.
genericSomething went wrong. Please try again.After any other failure.
payoutTitlePayout methodThe sheet's title in a payout session.
getPaidWithGet paid withAbove the list of methods, in a payout session.
savedPaymentMethodsSaved payment methodsAbove the customer's saved methods.
defaultBadgeDefaultMarks the customer's default saved method.
savedCardCardA saved card without a known brand.
bankAccountBank accountA saved bank account without a bank name.
expiresExpires {date}Under a saved card. {date} is MM/YY.
removeTitleRemove {method}?Confirming a removal. {method} is the row's title.
removeRemoveThe confirmation's button, and what VoiceOver reads for a row's remove control.
cancelCancelThe confirmation's cancel button.
orSeparatororBetween the Apple Pay button and the other methods.
changePaymentMethodChange payment methodAt checkout, the button under a returning customer's carousel.
paymentMethodsPayment methodsThe title of the page that lists the customer's saved methods.
otherWaysToPayOther ways to payThe last row of Payment methods, which opens the card form and the session's other methods.
cvcForCardCVV for {method}Above a saved card's CVV field at checkout. {method} is the card's title, for example "Visa •••• 4242".
cvcDigits{count} digitsThe placeholder of that field (3 digits, or 4 for American Express).
paymentMethod, endingIn, position, savedPayment method, {name} ending in {last4}, {index} of {count}, SavedWhat VoiceOver reads for the carousel and the tiles, as in "Payment method, Visa ending in 4242, default, 1 of 4".
removeMethodRemove {method}What VoiceOver reads for a tile's remove control, as in "Remove Visa ending in 4242".
methodNames[:]Row titles for alternative payment methods, by API type, for example ["paypal": "PayPal"]. Types not listed use the name Pay.com.js shows for the method, or else the SDK's built-in name.

Example

import PayDropIn

var strings = PayDropInStrings()
strings.title = String(localized: "Checkout")
strings.payAmount = String(localized: "Pay {amount} now")
strings.saveCardAtMerchant = String(localized: "Remember this card at {merchant}")
strings.methodNames = ["ideal": "iDEAL", "klarna": String(localized: "Pay later with Klarna")]

let dropIn = PayDropIn(checkout: checkout, configuration: .init(merchantDisplayName: "My Shop", strings: strings))

Next steps

Was this page helpful?