checkout.paymentMethods.subscribe((paymentMethods) => {
const creditCard = paymentMethods.find((m) => m.method === "creditcard");
if (creditCard) {
form.innerHTML = "";
creditCard.getPaymentElement({
hostedForm: {
panInputLabel: "Card number",
panPlaceholder: "•••• •••• •••• ••••",
cvvInputLabel: "Security code",
cvvPlaceholder: "•••",
expirationInputLabel: "Expiration date",
expirationPlaceholder: "••/••",
holderInputLabel: "Cardholder name",
holderPlaceholder: "John Doe"
}
}).appendTo("purse-hosted-form");
}
});