<p>Developer of <a href="https://squarebit.co.uk/software/craft/charge" rel="nofollow noreferrer">Charge</a> here.</p>

<p>Yes - you absolutely can control the label generated for the checkout button. </p>

<p>When setting the details for the checkout option, you just need to pass a sub-array called <code>checkout</code>, along with the extra parameters that get passed straight down the modal js.</p>

<p>Specifically you'd want do some thing like this :</p>

<pre><code>{% set options = {
    planAmount : 99.99,
    description : 'This is an optional description for the modal',
    checkout : {
        name: 'Company Name ltd.',
        image: 'https://s3.amazonaws.com/stripe-uploads/hSYxIZGM3U0DbmPKsJszRHm3OU3D4CtHmerchant-icon-641868-add-on-icon.png',
        label: 'Pay with Stripe Checkout'
    }
 } %}

 {{ craft.charge.setCheckoutOptions(options) }}
</code></pre>

<p>In that above example you can see we're passing values for <code>name</code>, <code>image</code> and <code>label</code> to the Checkout modal. </p>

<p>That'll return a button that looks something like this : </p>

<p><a href="https://i.sstatic.net/heSdi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/heSdi.png" alt="Example Stripe Checkout button with custom label"></a></p>

<p>The full details of all the configuration options you can pass through to the checkout modal are detailed in the <a href="https://stripe.com/docs/checkout#integration-simple-options" rel="nofollow noreferrer">Stripe Checkout documentation</a>. Just pass the values you want within that <code>checkout</code> array in the twig. </p>

<p>NB. We're working on updating the docs on this usage right now, and they'll be up shortly too <a href="http://squarebit.co.uk/software/craft/charge/usage/reference/checkout-options" rel="nofollow noreferrer">here</a></p>

CC BY-SA 3.0
2016-06-25T12:47:46.137Z
2016-06-25T12:47:46.137Z
Joel Bradbury
<p>I'm trying to set up a simple subscription based site using the Awesome Charge plugin and am wondering if I can change the button text using Stripe Checkout.</p>

<p>There doesn't seem to be any documentation around Checkout Options on the Squarebit site that indicates I can pass a value, through the options list, that changes the text 'Pay with card' to something else.</p>

<p>I understand I could customise the whole process using the Strip.js method but was hoping to just use the out of the box version.</p>

<p>Thanks.</p>

<plugin-charge>
Is it possible to change the default text for a Charge plugin checkout button
# Is it possible to change the default text for a Charge plugin checkout button

(Asked by: username_0 on 2016-06-25)

I'm trying to set up a simple subscription based site using the Awesome Charge plugin and am wondering if I can change the button text using Stripe Checkout.

There doesn't seem to be any documentation around Checkout Options on the Squarebit site that indicates I can pass a value, through the options list, that changes the text 'Pay with card' to something else.

I understand I could customise the whole process using the Strip.js method but was hoping to just use the out of the box version.

Thanks.

**Tags:** plugin-charge

---

## 1 answers

### Answer by username_1 on 2016-06-25. Score: 2 | Accepted answer

Developer of Charge here.
Yes - you absolutely can control the label generated for the checkout button. 
When setting the details for the checkout option, you just need to pass a sub-array called checkout, along with the extra parameters that get passed straight down the modal js.
Specifically you'd want do some thing like this :
{% set options = {
    planAmount : 99.99,
    description : 'This is an optional description for the modal',
    checkout : {
        name: 'Company Name ltd.',
        image: 'https://s3.amazonaws.com/stripe-uploads/hSYxIZGM3U0DbmPKsJszRHm3OU3D4CtHmerchant-icon-641868-add-on-icon.png',
        label: 'Pay with Stripe Checkout'
    }
 } %}

 {{ craft.charge.setCheckoutOptions(options) }}

In that above example you can see we're passing values for name, image and label to the Checkout modal. 
That'll return a button that looks something like this : 

The full details of all the configuration options you can pass through to the checkout modal are detailed in the Stripe Checkout documentation. Just pass the values you want within that checkout array in the twig. 
NB. We're working on updating the docs on this usage right now, and they'll be up shortly too here


---

