About Checkout Views
With E-Commerce enabled in your app and payment processors added, the final step is to add a checkout view. The checkout view 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 insert a checkout view in your app, the following requirements must be met:
An existing form view to attach the checkout view to
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:
Enable E-Commerce in a Form
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 special payment fields.
Click on the form view in your desired page to edit it. Select the "Options" tab and click on the “Enable E-Commerce” button:
Knack Tip Not seeing the E-commerce button? This object must not meet the second requirement.
Master the Checkout View
The checkout view has a lot of unique features that are not available anywhere else, this includes additional Settings, separate Checkout / 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 1 amount field can be selected, but you can use complex formulas 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 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 in the Checkout Page and the Confirmation Page. It can also be included in any e-mails 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 can start dragging your own, or click the Add Fields button to pre-populate with the first 5 fields:
Here’s a preview of a checkout view using fields in its checkout page:
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 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:
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 / 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: