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.
This tag returns a loop of the gateways setup for your store.
<label>Which payment gateway do you wish to use?</label><select>{{ sc:gateways }}<option value="{{ class }}">{{ display }}</option>{{ /sc:gateways }}</select>
<label>Which payment gateway do you wish to use?</label><select>{{ sc:gateways }}<option value="{{ class }}">{{ display }}</option>{{ /sc:gateways }}</select>
This tag returns the number of gateways you have setup for your store.
We have {{ sc:gateways:count }} gateways available for payment!
We have {{ sc:gateways:count }} gateways available for payment!
This tag lets you get a particular gateway and its information, where stripe
is the handle of the gateway.
{{ sc:gateways:stripe }}<h2>Payment with {{ display }}</h2><!-- Whatever else you need to do -->{{ /sc:gateways:stripe }}
{{ sc:gateways:stripe }}<h2>Payment with {{ display }}</h2><!-- Whatever else you need to do -->{{ /sc:gateways:stripe }}
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 gatewayhandle
- Camel cased version of the gateway nameclass
- Class name of the gatewayformatted_class
- Formatted version of the gateway's class namedisplay
- Display namepurchaseRules
- Validation rules used on the submission of {{ sc:checkout }}
formpurchaseMessages
- Validation messages used for errors after the submission of the {{ sc:checkout
}}` form.gateway-config
- Everything from the gateways's configwebhook_url
- Gateway's Webhook URL