Skip to content

Instantly share code, notes, and snippets.

@mrezentes
Last active August 23, 2016 19:53
Show Gist options
  • Save mrezentes/78cb2a5284ef8a1f862c3d85ee053059 to your computer and use it in GitHub Desktop.
Save mrezentes/78cb2a5284ef8a1f862c3d85ee053059 to your computer and use it in GitHub Desktop.
Customize text in Express

Label and button text can be configured through the data attributes of the express script element (id='express-script').

Express has always supported configuration of these modal fields (current documentation):

data-amount
data-full-name
data-company-name
data-sidebar-top-description
data-sidebar-bottom-description

Now, the following fields are also supported:

  • data-spreedly-close-button - the inner HTML of the close button, defaults to "Cancel"
  • data-spreedly-name-label - the inner HTML of the name label, defaults to "Name"
  • data-spreedly-number-label - the inner HTML of the number label, defaults to "Credit Card Number"
  • data-spreedly-cvv-label - the inner HTML of the cvv label, defaults to "CVV"
  • data-spreedly-expiration-label - the inner HTML of the expiration label, defaults to "Expiration Date"
  • data-express-modal-submit - the inner HTML of the submit button, defaults to "Pay Now"

For example, the following code will set the label for the credit card number to "Test Label":

<script
  id="express-script"
  data-environment-key="your-environment-key-here"
  data-spreedly-number-label="Test Label">
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment