user10178413
user10178413

Reputation:

change the Stripe button text "Pay" to other text

I have the code below to use Stripe. But the button that appears has the text like "Pay 10.05". Do you know how to change the text 'Pay' to other text?

With data-panel-label and data-label appears an error ": expected".

Do you know how to properly change the 'Pay' to other text?

$(function () {
    let stripe = StripeCheckout.configure({
        key: "{{config('services.stripe.key')}}",
        image: "",
        locale: "auto",
        token: (token) => {
            document.querySelector('#stripeToken').value = token.id;
            document.querySelector('#paymentForm').submit();
        }
    });

    document.getElementById('payment').addEventListener('click', function(e){
        stripe.open({
            name: 'Payment',
            description: '{{session('name')}}',
            amount: '{{session('totalStripe')}}',
            currency: 'eur',
            allowRememberMe: false
        });
        e.preventDefault();
    });
});

Upvotes: 2

Views: 1374

Answers (1)

Sookie Singh
Sookie Singh

Reputation: 1623

You can customize that with panelLabel option. Read more here

let stripe = StripeCheckout.configure({
    key: "{{config('services.stripe.key')}}",
    image: "",
    locale: "auto",
    panelLabel: "GiveMeMoney"
    token: (token) => {
        document.querySelector('#stripeToken').value = token.id;
        document.querySelector('#paymentForm').submit();
    }
});

Upvotes: 1

Related Questions