Checkout Payments Controller - Liquid Controller Reference
On this page
Description
The Checkout Payments controller handles requests related to checkout payments functionality in your StoreConnect storefront.
| Property | Value |
|---|---|
| Controller | PaymentsController |
| Liquid Template Path | controllers/checkout/payments/ |
| Namespace | Checkout |
Actions
| Action | HTTP Method | Route | Liquid Page |
|---|---|---|---|
update |
PATCH | /checkout/payments/:id |
— |
complete |
GET | /checkout/payments/complete |
— |
Liquid templates
Each action runs the template below, if your theme has one.
| Action | Template |
|---|---|
ach |
controllers/checkout/payments/ach.liquid |
complete |
controllers/checkout/payments/complete.liquid |
create |
controllers/checkout/payments/create.liquid |
intents |
controllers/checkout/payments/intents.liquid |
postback |
controllers/checkout/payments/postback.liquid |
status |
controllers/checkout/payments/status.liquid |
update |
controllers/checkout/payments/update.liquid |
Liquid Controller Lifecycle
For each action, Liquid controller templates are executed in three phases:
- Before — runs before the Rails action
- After — runs after the Rails action but before the response is sent
- Final — runs after the response, useful for cleanup
Available Liquid Tags
Inside controller templates, these tags are available:
| Tag | Description |
|---|---|
{% params %} |
Set request parameters (e.g. {% params foo: "bar" %}) |
{% variables %} |
Set template variables (e.g. {% variables title: "Hello" %}) |
{% respond %} |
Respond with custom content, alert, or notice |
{% redirect %} |
Redirect the request (e.g. {% redirect to: "/products" %}) |
{% action %} |
Execute a server-side action (e.g. {% action "cart.add", product_identifier: "blue-widget", quantity: 1 %}) |
Example
Create controllers/checkout/payments/ach.liquid. The before phase sends a visitor who is not logged in to the login page instead of running the action:
```liquid
{% before %} {% unless current_customer %} {% redirect to: current_store.login_path, alert: “Log in to continue.” %} {% endunless %} {% endbefore %} ```
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.