Simple Commerce Logo

Gateways

With the gateway tag, you can loop through and use a specific gateway. This tag is commonly used on checkout pages to display payment forms.

This page has documentation on the tag itself but if you're looking for docs on displaying payment forms, head over to the Gateway docs.

Tags

All gateways

This tag returns a loop of the gateways setup for your store.

1<label>Which payment gateway do you wish to use?</label>
2 
3<select>
4 {{ sc:gateways }}
5 <option value="{{ class }}">{{ display }}</option>
6 {{ /sc:gateways }}
7</select>

Get a gateway

This tag lets you get a particular gateway and its information, where stripe is the handle of the gateway.

1{{ sc:gateways:stripe }}
2 <h2>Payment with {{ display }}</h2>
3 <!-- Whatever else you need to do -->
4{{ /sc:gateways:stripe }}

Variables Available

You might have noticed in the above examples, it uses things like {{ display }} and {{ class }}. These are variables exposed by Simple Commerce. Here's a full list of the variables you can use inside the {{ sc:gateways }} tag.

  • name - Name of the gateway
  • handle - Camel cased version of the gateway name
  • class - Class name of the gateway
  • formatted_class - Formatted version of the gateway's class name
  • display - Display name
  • purchaseRules - Validation rules used on the submission of {{ sc:checkout }} form
  • gateway-config - Everything from the gateways's config
  • webhook_url - Gateway's Webhook URL

Need some help?

There's plenty of ways of getting help: either via opening a GitHub Issue, starting a conversation on the Statamic Discord or directly emailing me.