What is E-Commerce?
E-commerce allows you to perform financial transactions online. With e-commerce, you can accept payments in your app for transactions such as invoices, registrations fees, and more.
Knack integrates e-commerce by accepting payments through a special payment view, and stores those payments as records in your database.
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.
Knack Tip: E-commerce is available on Pro plans or higher. Lower plans only have ‘Test Mode’ available to test out the functionality.
Note: It is important to note that only embedded apps and Knack URLs will allow an e-commerce view to work. Using a custom domain on your Knack App without embedding, will not allow the submission of credit card information. You can learn more about embedding your app here.
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 that works 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
Knack Tip: You can learn more about payment views here.
Store credit card information
Users can also store their payment information using payment method views; they can update their payment information at any time or choose to 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" object. This object 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 which translates a credit card number into a unique, encrypted string, that is only usable by the app that created it. Actual credit card information is never stored in your Knack database in order to meet PCI regulations.
Knack Tip: You can learn more about payment methods here.
Before you can accept payments you first must activate E-Commerce features for your application.
From the Knack Builder, navigate to the app settings and select the "E-Commerce Settings" tab. Click the “Enable E-Commerce” button.
You will then be prompted to confirm E-Commerce activation. Click "Submit" to officially activate the feature for your app.
Add 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 then charge the user and transfer the money to your account; this means that Knack does not store any credit card information.
To add your first processor, 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:
Knack Tip: You can learn more on locating the necessary credentials and other general payment processors information here.
Edit a payment processor
You can edit your payment processor credentials at any time; simply locate your payment processor in your app’s E-commerce settings and click on the edit icon:
Delete a payment processor
You can delete a payment processor at any time from your app’s E-commerce settings. Locate the processor you wish to remove and click the delete icon:
Add 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.
Knack Tip: There are several requirements a page must meet in order 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.
Edit a payment view
Payment views behave just like any other view types you may have interacted with. When clicked on, 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:
Add 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 one added in order to add your first payment method view.
To add a payment method view, find the "E-Commerce" option the view menu and click the “Payment Method” view:
Knack Tip: You can learn more about payment method views here.
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.
Use E-Commerce in your App
In order 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.