1. Home
  2. WP Simple Pay Pro 2.5 & Lite 1.6
  3. Basic Shortcodes (Pro 2.5 & Lite 1.6)

Basic Shortcodes (Pro 2.5 & Lite 1.6)

You can quickly create a Stripe Checkout button and overlay form using the [stripe] shortcode within your page or post content.

Shortcode Examples

Each example below represents an individual Stripe payment button and checkout overlay.

Basic product checkout:

[stripe name="My Store" description="My Product" amount="1999"]

Require billing address:

[stripe name="My Store" description="My Product" amount="1999" billing="true"]

Require billing and shipping addresses:

[stripe name="My Store" description="My Product" amount="1999" billing="true" shipping="true"]

Use a custom image on overlay:

[stripe name="My Store" description="My Product" amount="1999" image_url="http://www.example.com/book_image.jpg"]

Change the checkout button label and disable option to remember Stripe login:

[stripe name="My Store" description="My Product" amount="1999" checkout_button_label="Now only {{amount}}!" enable_remember="false"]

Pre-fill email of current logged in user:

[stripe name="My Store" description="My Product" amount="1999" prefill_email="true"]

Set to Mexican Peso currency:

[stripe name="My Store" description="My Product" amount="250" currency="MXN"]

Show the payment details below the content:

[stripe name="My Store" description="My Product" amount="250" payment_details_placement="below"]

Note: In the post/page editor, we recommend switching to the Text tab (HTML source) when entering shortcodes to make sure they work properly.

Shortcode Options

Below are the available options (attributes) for this shortcode.

OptionDescriptionDefault
idA custom ID for the form. If omitted, a unique ID for the page will be generated automatically. Custom IDs should follow standard CSS rules and not contain spaces.

sc_checkout_form_#
nameThe name of your company or website.Site title
descriptionA description of the product or service being purchased (optional).
amountAmount in desired currency. Use the smallest common currency unit (see zero-decimal currencies). U.S. amounts are in cents. Amount is required.
image_urlA relative or absolute URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px. The recommended image types are .gif, .jpeg, and .png.
currencySpecify a currency by using it's 3-letter ISO code.USD
payment_button_labelText to display on the default payment button that launches the checkout overlay.Pay with Card
billingUsed to gather the billing address during the checkout process. (true or false)false
shipping(Pro only) Used to gather the shipping address during the checkout process. When a shipping address is required, the customer is also required to enter a billing address. (true or false)false
enable_rememberAdds a "remember me" checkbox to the checkout form. (true or false)true
bitcoinEnable accepting Bitcoin as a payment option.false
alipayAlipay support was removed for the time being due to a change in Stripe's implementation.
locale"auto" is used by default to select a language based on the user's browser configuration. To select a particular language, pass the 2-letter ISO country code, such as "zh" for Chinese. See list of languages supported by Stripe Checkout.auto
checkout_button_labelText to display on the button within the checkout overlay. Insert {{amount}} where you'd like to show the amount. If {{amount}} is omitted, it will be appended at the end of the button text unless it is a free trial.Pay {{amount}}
success_redirect_urlThe URL that the user should be redirected to after a successful payment.Originating page
failure_redirect_urlThe URL that the user should be redirected to after a failed payment.Originating page
prefill_emailPrefill the email address box with the email address of the current logged in user.false
verify_zipVerifies the zip/postal code of the card. You should also enable the option to decline charges that fail zip/postal code verification in your Stripe.com account.false
test_modePuts this particular form into test mode even if live mode is selected in the main settings. false
payment_details_placementChoose location to display the payment details. (above or below)above
payment_button_style(Pro only) Set to "none" to remove Stripe's button styles (CSS class "stripe-button-el"). Omit attribute or set to "stripe" to use Stripe's button styles. Base button CSS class "sc-payment-btn" exists either way for further styling.stripe

Note: Charge amounts must meet a minimum requirement (such as 50 cents USD) to be allowed by Stripe. See the minimum charge for various currencies.

Note: The amount attribute is required.

Shortcode copy and paste instructions:

First, double-click the shortcode to get the “plain text” version, then copy (Cmd-C or Ctrl-C).

Second, paste the example code into the “Text” tab in your WordPress editor. Pasting into the “Visual” tab may result in errors.

Alternatively, you could use WP Simple Pay Pro Companion, which is a 3rd party premium add-on that makes it faster and easier for you to insert your shortcodes directly into the WordPress editor without mistakes.

For WP Simple Pay Lite for Stripe, you can use WP Simple Pay Lite Companion.

Custom HTML note: If you are adding your own custom HTML within the page you will need to make sure that the HTML is well-formed (opening and closing tags match up) or there could be issues.

Multiple shortcodes note: If you are including multiple [stripe] shortcodes on one page you must close each one with [/stripe] or you will run into errors.

Need more features? Upgrade to WP Simple Pay Pro

Updated on November 19, 2018

Was this article helpful?

Related Articles