What are Checkout Views?
With e-commerce enabled in your app and payment processors added, the final step is to add a checkout view.
A checkout view is a specialized view that integrates your Knack app with the payment processors to accept payments in your Knack app. It includes options for calculating the total charge, displaying the charge summary, sending email receipts, and rules for updating other database records.
In order to be able to add a checkout view to your app, the following requirements must be met:
- E-commerce must be enabled in your app. For instructions on activating e-commerce, see the article About E-Commerce.
- An existing form view: The checkout view must be enabled from an existing form view in your app.
- A numeric field: A numeric field is required to determine the amount that will be charged. Numeric fields include any field that can be selected from the ‘Number’ menu. This includes: number, currency, equation, sum, average, minimum, maximum, count, and auto-increment fields.
Manage Checkout Views
When e-commerce is enabled for a specific form, the user will be directed to a checkout view after the form’s submission; the checkout view will contain the payment fields.
Add Checkout Views
Click on the form view in your desired page to edit it:
Select the "Options" tab and click on the “Enable E-Commerce” button:
During activation, you’ll be able to choose the field from your object to be used as the final charge amount. You’ll also be able to select which payment processors you want to use on this checkout view.
After you have enabled e-commerce, you’ll see a new checkout page created as a child page to your form:
Knack Tip: Not seeing the e-commerce button? This object must not meet the first or third requirement above.
Edit Checkout Views
Click on the checkout view to open the view editor:
Delete Checkout Views
You can remove a checkout view from the form view that directs to the checkout view. Go to the form view:
In the “Options” tab, click on “Disable” in the e-commerce section:
This will delete the checkout view associated with that form.
Checkout Views Settings
The checkout view has many unique features that are not available anywhere else.This includes additional settings, separate checkout and summary sections, email receipts, and charge rules.
Settings control things like the Charge Field and your Payment Processors. Below is a full list of all settings available.
Total Charge Field
The “Total Charge Field” sets the payment amount to be submitted to the payment processor. Only one field can be selected, but you can use complex formulas and equations to calculate multiple values into one total.
Each checkout view can use its own payment processor. You can add one of each processor, giving your users the ability to choose a processor prior to checkout.
Every payment processor can be used in “Test Mode.” Credit cards will NOT be charged in test mode. Since e-commerce is only available on Pro plans and above, Starter and Trial plans will always have test mode enabled.
The Total Charge Field can be set to any currency. This will be the currency used when the payment is submitted to your payment processor. Note that Knack does not convert the currency, it will use the exact value present in the charge field and charge it in the currency set here.
The summary lets you configure and display multiple fields that contribute to the charge total. It always displays the charge total field by default; additional numeric fields (like shipping, handling, etc.) can be added by clicking on the ‘+’ icon:
This summary will display on the checkout page and the confirmation page. It can also be included in any emails from the “Emails” tab.
Similar to a details view, the checkout page will display record details above the summary prior to submitting a charge. This can be useful to present the full details to the user so they can confirm what they are paying for. Keep in mind that the summary fields (see above) will display below any details fields you add here.
You add fields to the checkout page by clicking on them in the left menu:
Here’s a preview of a checkout view using fields in its checkout page. You can see the four fields added (RMA ID, Request Date, Order, Status) along with the summary details below (Total Repair Fees):
The completion page works just like a checkout page, except it displays after a charge is submitted:
Control any emails to be sent after a successful charge. Paypal will automatically send a confirmation email, but Stripe does not.
The checkout email has access to a special summary placeholder; this will display any information you’ve included in the summary settings for this checkout:
Charge rules work exactly like record rules in a form view . Common examples of charge rules include updating an invoice status to ‘Paid’ or approving a user’s account after a paid registration.
Charge rules will only trigger for successful charges.
To add a charge rule, click on the "Add Rule" button, then set your criteria:
Knack Tip Click to learn more about record rules
Using Checkout Views
Once the user submits the payment form, a new charge record will be created and automatically connected to the record from the original parent form.
If a charge is successful, your user will be redirected to the completion page. At this time any emails and charge rules you defined in the checkout view will trigger immediately.
When a charge error occurs, a new charge record connected to the form record will be created with a “failed” status. A failed charge will not trigger any email or charge rules in the checkout view.
The user will be alerted that an error occurred, and will be able to fill out the form again and try submitting a successful charge:
More specific details about the error will be added to the notes field of the Charge record: