Basic Payments are a way to take a payment when a form is submitted. They may be useful for allowing Users to pay invoices etc.
Basic Payments are a way to take a payment against a standard Form submission.
You set the currency, and the minimum payment value in Form Builder.
When submitting the form, a value is sent to our payment processor, and validated server-side to check that it's higher than the minimum payment value you have set.
Here's 3 examples of when you'd use this payment system:
The following steps are for setting up a Basic Payment Form which will accept a fixed payment amount e.g. all customers submitting the Form will pay the same. The same steps should also be followed if you intend the amount paid to be decided based on the User's interaction with the Form- but there will be additional steps described below.
Basic Payment is available using the following Payment Gateways:
Note: depending on the Payment Gateway, some specific fields may be needed in order to capture the necessary payment details. Those fields will be specified in step 5.
In order to use Secure Zones in this process, they first need to be set up. For instructions on how to use Secure Zones on a Form, click here.
If you apply a Secure Zone to the Form, then the user will be given access after a successful payment.
When creating a Form, navigate to the 'Payments' tab.
Here you should enter the following data:
For further instructions on how to set up Forms, click here.
Please see below for code relevant to your Payment Gateway.
Stripe There is no extra code required for Stripe.
Authorize.net You must include 3 extra fields for Authorize.net to work.
Field Name | Example | Notes |
Card Number | <input id="s_e_card_num" class="required" type="text" /> | |
Card Expiry | <input id="s_e_card_exp" class="required" type="text" placeholder="MM-YYYY" /> | The data format must follow that in the placeholder in our example |
Card CVV | <input id="s_e_card_cvv" class="required" type="text" /> | |
To test your new Basic Payment Form, you first must put it on a Page. You can do so using Toolbox's 'Insert Form' feature.
Once you have created a Page and navigated to it, you will need to fill in the fields and submit.
If your Payment Gateway is in 'Test Mode', then you may need to enter card details specific to the testing environment. You can find those under 'Test Cards' on our Payment Gateways documentation page.
In some use-cases you may wish the amount to be paid to depend on the User's input into the Form Fields e.g.
Both use-cases will require you to write a JavaScript function which will update the value of the amount due.
You may find the following Liquid tags helpful while developing:
Liquid | Role | Example |
{% include 'ecommerce/basic_payment_currency' %} | The currency for the Form defined in Admin | gbp |
{% include 'ecommerce/basic_payment_currency', format: 'symbol' %} | The symbol for the currency for the Form defined in Admin | £ |
{% include 'ecommerce/basic_payment_min_amount' %} | The minimum payment value defined in Admin, in the lowest denomination of that currency | 100 |
{% include 'ecommerce/basic_payment_min_amount', format: 'decimal' %} | The minimum payment value defined in Admin, formatted | 1.00 |
The end goal of such a JavaScript function will be to set the value of hidden field with the ID "s_e_amount". The default value of this field will be the same as the minimum payment value you set in Admin, until it is changed via JavaScript. The final value should be an integer (whole number) of the number of cents that will be paid. We'll give you an example of how this JavaScript may work here. You can adapt this example to suit your use case. The important thing is that you set the value of the field with the ID "s_e_amount".
The following example allows the User to enter an amount of their choice into an input in the Form. Our function changes the format, then sets the value of the hidden field. Note that the entire example should sit inside a Liquid {% form %} tag.
This example shows how you can add an "amount" parameter to the URL- if this parameter exists then the s_e_amount will be updated. The following Javascript can be added to your Basic Payment Form's Layout. The first half of the function will store the amount parameter within the "amount" variable, the second half checks if "amount" exists (this prevents "null" from getting added to s_e_amount) if so then s_e_amount is updated with the new price:
Remember, this kind of payment is designed for use cases where the customer intends to make a charitable donation or pay an invoice that is due. It is possible for the customer to modify the JavaScript and pay less (but not less than the minimum payment value). You should only use this kind of payment either when the customer does have a genuine choice, or the Client will be reconciling invoices and chasing where the correct amount has not been paid.
Basic payment forms are just one of the ways that Siteglide eCommerce can take payments from customers. You can also use: