What are Payment Method Views?
A payment method view is a particular type of E-Commerce view. While payment views allow you to accept a payment from someone, payment method views allow you to store, update, or remove a specific user’s payment method.
The payment method can then be used to facilitate future payments, whether it’s the user paying themselves or an account administrator charging the user on their behalf.
Payment method views sync the payment information to your Stripe payment processor, so the credit card information cannot be seen in Knack.
Manage Payment Method Views
Add Payment Method Views
First you’ll need to enable E-Commerce features for your app. You can learn how to do that here.
Payment method views can be added in two different places:
-
In a login-protected "start page"
-
In a child page that has access to a specific user record
To add your first payment method view, locate the "E-Commerce" option in the view menu and select the “Payment Method” view type:
You’ll then be guided through a series of options to customize the payment method view. First, select your payment processor:
Only Stripe payment processors are supported; you will not be able to choose a Paypal processor with this view type.
Next, select the user record that the payment method belongs to. Sometimes this may be the logged-in user, other times you may want to update someone’s payment information on their behalf:
The final step is to review the view’s Summary to confirm everything was selected properly:
Edit Payment Method Views
To access the payment method view settings, access the "Settings" option from its dropdown menu options:
Delete Payment Method Views
You can delete your payment method view at any time by click the "Delete" option in its dropdown menu:
Note: Deleting a payment method view will not delete any payment information stored in your Stripe account.
Payment Method View Settings
Payment method views have settings similar to payment views.
Settings
Payment method view settings let you change the behavior and looks of your view.
Payment Action
This section displays what your current payment method view is doing and allows you to go through the setup wizard again, if you need to change any settings.
Payment Processors
Each payment method view can use its own payment processor. You can only select Stripe payment processors in this view type.
Test Mode
Every Payment Processor can be used in Test Mode. Stripe will store TEST customers in a separate section, so if you want to store real customer information be sure to toggle test mode OFF.
Since E-Commerce is only available on Pro plans and above, Starter plans will always have Test Mode enabled.
Submit Payment Method Button Text
Here you can set the display text of the button that submits payment information to your selected Stripe payment processor.
Update Billing Button Text
Here you can set the display text of the button that allows the user to change existing payment information.
Remove Card Button Text
Here you can set the display text of the button that allows the user to permanently remove their payment information from your payment processor.
Emails
Control any emails sent after the payment information is successfully completed.
The submitted payment method details are not available to be displayed in an email.
Knack Tip: Click here to learn more about Emailing your Users
Payment Rules
Payment rules work exactly like record rules in a form view. A great example of when to use a payment method rule is to update a field in the user’s record so you can tell who has yet to update their payment information.
Payment Rules will only trigger for successful changes to the connected payment method.
To add a payment rule, click on the "Add Rule" button in either “Submit Rules” or “Record Rules” tab, then set your criteria:
Knack Tip: You can learn more about using form rules here.
Using the Payment Method View in Your App
Now that you’ve got a payment method view fully configured, it’s time to see how it all works.
Store Payment Method
If the user has not had their payment method stored before, the view will display the credit card form:
When this form is submitted, a Stripe Customer will be created in Stripe and a Payment Method record will be added in Knack. You can find these records in your builder:
You can then use the Payment Method ID to locate the payment method in your Stripe Dashboard:
Knack Tip: You can learn more about payment method records here.
Update payment information
If the user has stored their payment method already, they’ll see a link so they can choose to update or remove their existing payment method:
If they choose to update the payment method, they’ll have access to a pre-filled credit card form:
Remove payment information
Using the same link, if they click the "Remove Payment Information" button, they’ll be redirected to the original payment method view with the credit card form: