[
{
"title":"Testing",
"link":"https://docs.solidgate.com/payments/testing/",
"text":"Simulate payments to test your integration before launching in production.",
"imgSrc":"https://solidgate.com/wp-content/webp-express/webp-images/uploads/2023/09/Merchant-account-1.png.webp"
}
]
Create a seamless experience for customers by styling your payment form
The Solidgate Payment Form boasts unparalleled flexibility and extensive customization options. It accommodates various payment processing requirements across different countries. The form supports the display of additional fields essential for transaction processing and permits field whitelisting for easy display control, ensuring a personalized user experience.
Through the form, avail the opportunity to:
use one of the payment form templates
define styles for the selected form template or retain the default option
restrict
Guide
After completing all the steps described above and modifying all required parameters, you need to initiate Solidgate SDK.
optional field
from display
Template
Solidgate offers several default form templates with pre-configured styles.
Utilizing a template for a payment form from Solidgate simplifies the payment acceptance process on your website.
Templates offer a pre-designed and functional form, eliminating the need for customization. This ensures adherence to industry standards for both security and user experience.
Styles
The Solidgate Payment Form employs a styles object, consisting of nested CSS properties corresponding to diverse form elements. This enables easy and flexible form appearance modification without altering the underlying HTML or JavaScript code.
Allowed Classes
Description
styles
This class allows customization of all input fields’ CSS properties, aligning the form with your website’s design.
CSS properties are supported in the following classes:
Form styles properties
Expand all
Description
Class for editing styles of all input fields on the form.
The properties for input fields on the Payment Form could be applied for the following states:
not-empty
error
valid
default - without specifying the state
In case the state is not specified, properties are applied for all states.
The following pseudo-classes and pseudo-elements can also be styled using a nested object inside a variant:
:hover
:focus
:placeholder
There is no support for transferring images - neither via link or via data-uri.
For the Solidgate Payment Form, applying CSS styles enables control over form elements’ visibility, providing control over specific properties’ display within the form.
Please note that hiding price-related fields on the payment form might impact the form’s functionality, so thorough testing is recommended to ensure the form still functions correctly.
To customize all labels on the payment form, add the parameter fieldNameLabel with the new label name in the formParams object for each desired field.
To customize all placeholders on the payment form, add the parameter fieldNamePlaceholder with the new label name in the formParams object for each desired field.
The parameters for Card Data fields are presented below.
To get the value of fieldNameLabel or fieldNamePlaceholder for additional fields, you need to take the Field Class name on the table, remake it into camelcase, and add a Label or Placeholder at the end.
For example, bolivia_ci becomes boliviaCiLabel, and argentina_dni becomes argentinaDniLabel
The Solidgate Payment Form provides two options for payment submission:
click on the payment button
use the form.submit method
The option to display a custom payment button below the form is available, allowing for the collection of additional user data.
To hide the payment form submit button, set the allowSubmit display property in formParams to false during initialization. This action not only hides the button but also blocks form submission via the enter key.
<template><Payment:merchant-data="merchantData":form-params="formParams"width="100%"/></template><scriptlang="ts"setup>import{defineAsyncComponent}from'vue'import{InitConfig}from'@solidgate/vue-sdk'constPayment=defineAsyncComponent(()=>import('@solidgate/vue-sdk'))constmerchantData:InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}constformParams:InitConfig['formParams']={allowSubmit:false}</script>
To submit the payment form without a Solidgate button, call the form’s submit method.
<template><Payment:merchant-data="merchantData"@mounted="onMounted"@ready-payment-instance="onReadyPaymentInstance"/><buttonv-if="mounted"
@click="submit">Submit</button></template><scriptlang="ts"setup>import{defineAsyncComponent,ref}from'vue'import{InitConfig,ClientSdkInstance}from'@solidgate/vue-sdk'constPayment=defineAsyncComponent(()=>import('@solidgate/vue-sdk'))constmerchantData:InitConfig['merchantData']={merchant:'<<--YOUR MERCHANT ID-->>',signature:'<<--YOUR SIGNATURE OF THE REQUEST-->>',paymentIntent:'<<--YOUR PAYMENT INTENT-->>'}letmounted=ref(false)letformResolve:(form:ClientSdkInstance)=>{}=()=>{}constformPromise=newPromise<ClientSdkInstance>(resolve=>{formResolve=resolve})functiononReadyPaymentInstance(form:ClientSdkInstance):void{formResolve(form)}functiononMounted():void{mounted.value=true}functionsubmit():void{formPromise.then(form=>form.submit())}</script>
Actual submission does not occur if:
Additional fields require display Users see a validation error on the new field.
Some fields await validation Users see validation errors on the form.
Validation errors exist in form fields
Otherwise, the form submits successfully.