E-commerce allows you to perform financial transactions online. With E-commerce, you can accept payments in your Knack app for transactions such as invoices, registrations fees, and more.
There are several requirements a page must meet to be able to add a payment view, such as access to a numeric field in a record to calculate the total amount.
All payments are made through a payment provider like Stripe or Paypal, and although you can store a user’s payment method through Stripe, no actual credit card numbers are stored in your Knack database for security reasons.
Note: E-commerce is available on Pro plans or higher. Lower plans only have "Test Mode" available to test the functionality.
What can I do with E-commerce?
Accept a Payment
Using a payment view in your app, users can use their credit card to send you a payment, and they can also store that payment method to make future payments. Payment views can be added to any page with a single record (such as an edit form or a details view). Common use cases include:
Subscribing to your app
Purchasing tickets for events
Submitting and paying orders
Tip: You can learn more about Payment Views here.
Storing Credit Card Information
Users can also store their payment information using payment method views. They can update their payment information at any time or remove it altogether.
Payment method views simply require they be connected to a specific user record; meaning, it’s also possible for you to update the user’s information on their behalf.
Payment methods are stored in a special "Payment Methods" table. This table is automatically added when you add your first payment method view.
It stores specific information about each payment method, such as the expiration date and which user it belongs to:
Note: User payment methods are stored as a tokenized string that translates a credit card number into a unique, encrypted string only usable by the app that created it. For security purposes and to meet PCI regulations, actual credit card information is never stored in your Knack database.
Tip: You can learn more about payment methods here.
Before you can accept payments, you must first activate E-Commerce features for your application.
From the Knack Builder, navigate to the app Settings section and select the "E-Commerce Settings" tab. Click the “Enable E-Commerce” button:
You will then be prompted to confirm E-Commerce activation. Click "Enable" to officially activate the feature for your app:
Adding a Payment Processor
Before you can accept your first payment, you must connect a payment processor account to your Knack app. The user will submit their payment method using one of these processors, which will charge the user and transfer the money to your account.
Note: Knack does not store any credit card information.
To add your first processor, select the "Add Processor" button in your app’s e-commerce settings:
Regardless of the processor you choose, you must enter your live and test credentials:
Note: You can learn more about locating the necessary credentials and other general payment processor information here.
Editing a Payment Processor
You can edit your payment processor credentials at any time. Locate your payment processor in your app’s E-commerce settings and click on the edit icon to do so:
Adding a Payment View
With E-Commerce enabled in your app and payment processors added, the final step is to add a payment view.
To add a payment view, find the "E-Commerce" tab in the view menu and click the “Payment” option:
You will then be guided to choose a series of options to customize the view. The payment view includes options for calculating the total payment amount, displaying the payment summary, sending email receipts, and rules for updating other database records.
Note: There are several requirements a page must meet to be able to add a payment view, such as access to a numeric field in a record to calculate the total amount. You can learn more about payment views here.
Adding a Payment Method View
Payment Method views can store, update, or remove a specific user record’s payment information.
These views will only work with Stripe payment processors, so you must have your Stripe credentials added to your first payment method view.
To add a payment method view, find the "E-Commerce" option in the view menu and click the “Payment Method” view:
Tip: You can learn more about payment method views here.
Editing a Payment or Payment Method View
Payment and payment method views behave like any other view types you may have interacted with. When you click on the edit icon for either view type, you can access all of its options:
If you wish to change anything you selected when first adding the payment view (such as storing the user’s payment information), click the "Change Action" button in the view settings:
If you’d like to disable all e-commerce features in your app, navigate to your app’s e-commerce settings and click on the "Disable E-Commerce" button:
Note: Disabling e-commerce will delete any existing charge or payment method views in your app. It will not delete the payment/payment method records stored in the database.
Using E-Commerce in Your App
To accept your first payment, you’ll first need to configure a payment processor. Then, add your payment view to an existing page or form view within your app.
How To Guides