# Checkout Credit Card Form (Pro)

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FdJ7oRqu6aM2Dj18VjWyv%2Fimage.png?alt=media&#x26;token=240d821b-13da-4fa1-b925-e1d353d6982e" alt=""><figcaption></figcaption></figure></div>

> In this sample, both the <mark style="color:red;">**Elementor Pro**</mark> and our <mark style="color:red;">**Payment Addons Pro**</mark> are required

### Create form fields

1. To begin, create a new page or post, and use Elementor for editing.
2. Next, drag and drop the Elementor Form onto your page (you can search for it using the keyword "form" or find it under the "PRO" category)

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FeyX1yivAV4H8rPmiIdpb%2Fimage.png?alt=media\&token=0d0cca8f-b971-4150-b991-e52ebd17f446)

3. Add form fields one by one, such as Email, First Name, Last Name, and Event. It's important to assign meaningful **IDs** to the email and event fields, as they will be used as the customer's email and payment price, respectively. These IDs are crucial because they will be linked with **shortcodes**.

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FYMY87wDEJWPJktWs4fTg%2Fimage.png?alt=media\&token=e9adf02e-d0bb-43d9-8aea-b9b259cffa1e)

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FQDjAW9WC19ArCS5d7qjU%2Fimage.png?alt=media\&token=de38f6d6-53f6-43f9-9485-a12a6507b304)

{% hint style="info" %}
You can replace the **Event** field with any field that represents a price, whether it's a fixed value like in this example or a number input field that allows users to enter a dynamic price. The key is to ensure that the field is properly linked to the payment process.
{% endhint %}

4. Add credit card field

Continue above, we can insert a <mark style="color:red;">**Credit Card**</mark> type field which is exclusively available for our Professional plan users

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2F6GptoQMhpa3UF5ESeOmb%2Fimage.png?alt=media\&token=aa211ef6-81da-4c92-8ec1-bd941358cff4)

Our form UI settings are now complete and will look similar to the example below. However, the payment form is not yet complete, as we still need to add the form submission action to process payment collection.

<div align="left"><figure><img src="https://1471993180-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FxR6dkNchhWd9R4yC66zZ%2Fimage.png?alt=media&#x26;token=f2dd7cfa-f272-4fef-84af-04c0241d4c0c" alt=""><figcaption></figcaption></figure></div>

### Form submission actions

Similar to other built-in submissions like '*collection submission'***, '***Email', 'Redirect', etc,* we provide a payment submission called \`<mark style="color:red;">**Credit Card submission**</mark>\` to handle the checkout-related collection.

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FgKVTpTNgmvkl26PTpVQz%2Fimage.png?alt=media\&token=4c0a4337-9bd2-43c6-a01a-cdba4cfc6ea1)

Here we keep 'Collect Submissions' and we also add the <mark style="color:red;">**Credit Card submission**</mark>, the submission section will be shown below:

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FDwiPVTs2VEmcMmHyCJiM%2Fimage.png?alt=media\&token=056be0c3-408f-4d83-b727-9e76a01c86c4)

In this section, we can specify the supported **customer name** which can be combined by `last_name` and \`first\_name\` fields as full name, the **custom email** field that links to the email field we defined earlier, and the **Payment Type** field that consists of three options: <mark style="color:red;">**one-time**</mark>, <mark style="color:red;">**subscription**</mark>, and <mark style="color:red;">**flex**</mark>.

* One-time - For only standalone purchases
* Subscription - For only recurring subscriptions
* Flex - Collects either one-time or subscription based on conditional logic

When you choose a specific payment type, the corresponding settings for one-time or subscription payments will become active. For instance, if a checkbox with the ID `sub-checked` is selected during submission, the payment will be considered a subscription and will use the subscription settings.

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2F5Dls6l4SzlUqzNB4ptJk%2Fimage.png?alt=media\&token=544bf240-346e-4401-9636-3d664f97b37c)

### **One-Time Payment Settings**

If the Payment Type is chosen as One-Time or the subscription field condition is not met under Flex mode, the payment will be treated as a one-time payment. Configure the following settings:

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2F0SJc5BckRVXTiSlleer5%2Fimage.png?alt=media&#x26;token=e54ec303-bc21-431e-9319-0419b5d6cd7c" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
If desired, we can specify a fixed value for the **amount** field instead of using a shortcode. For instance, we can set a fixed value of 40 for the amount field.

For **Quantity** field, we set it as 1 because we don't want it dynamic, but it's free to use it as a shortcode as well.

For **Product** field, it will help to display the transaction description in the stripe dashboard so you can see which payment is for. (Tips: the form shortcode is supported for these fields.)
{% endhint %}

### Subscription **Payment Settings**

When the Payment Type is chosen as Subscription or the subscription field condition is met under Flex mode, the payment will be considered a subscription. Configure the following settings:

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FknDUsByALNYULwBthDJD%2Fimage.png?alt=media\&token=cfc658dc-b460-44ce-8799-f9a022414e3e)

All of these fields support shortcodes and we can leverage them to build some customized forms with credit cards to do recurring payments:

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FrOY9bpMXieJjKdW2z8FP%2Fimage.png?alt=media&#x26;token=d35e4fa4-fa89-4622-be7e-d30c40ab7309" alt=""><figcaption></figcaption></figure></div>

#### Using stripe price

![](https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FYwdAD1B1UY5ob5ExhNYF%2Fimage.png?alt=media\&token=87258dbb-be7d-4a61-a010-17ea022696b4)

We recommend using predefined Stripe prices for recurring payments if the price is fixed. This allows customers to select from your existing prices in the Stripe dashboard during checkout.

The alternative is creating inline recurring payments as above section, which generates a new product and price on every transaction, even if the details are the same. This can lead to duplicated products and make inventory management more difficult.

With Stripe prices, a customer simply chooses from your listed prices, streamlining the checkout process. And you maintain one consistent product catalog in Stripe to manage pricing, inventory, and reporting.

The <mark style="color:red;">**Price ID**</mark> field is a list fetching from the stripe product's price list, selecting one means the check out will use this price to checkout all the time.&#x20;

In some cases, the subscription price mean chosen by end-user such as in pricing-table or from a dropdown, if that so, we can specify the <mark style="color:red;">**Price ID field**</mark> as shortcode to make it flexible

<figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2Fyh9PXE6FcHlpEJvzMBMV%2Fimage.png?alt=media&#x26;token=8a55430d-169b-473c-ac49-caa212249c2f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FEYwgHSIEymyJi5uXMLtc%2Fimage.png?alt=media&#x26;token=8bbfa424-f287-4ef2-8263-998efcecdbc9" alt=""><figcaption></figcaption></figure>

#### Subscription occurrences

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FUJ3kP8EC9ExBkdibPMZS%2Fimage.png?alt=media&#x26;token=32805981-5c38-41e2-ab0f-9c2e23bfa974" alt=""><figcaption></figcaption></figure></div>

The recurring occurrences field allows specifying the number of times a subscription payment should be repeated. This is useful for temporary donation campaigns or subscriptions with a set duration.

For example, vendors could allow users to choose a 6-month, $10 per month recurring donation by adding a \[field id="donate-times"] merge tag in this field. The form would populate the number of occurrences dynamically based on the user's input.

If no value is entered, the payments will continue indefinitely until manually canceled. This flexibility supports both ongoing and fixed-duration memberships or donations.

### Testing

{% hint style="info" %}
Success: 4242424242424242 Any 3 digits Any future date

Decline:  4000000000000002 Any 3 digits Any future date

For more testing cards sample, please refer <https://stripe.com/docs/testing#use-test-cards>
{% endhint %}

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FSr5FgaQu1YvI8hA1fIeO%2Fimage.png?alt=media&#x26;token=6393c0cb-f863-4b52-8d3c-6add375dd8a9" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
To customize the form success message, please go to form **Additional Options** section and check on Custom messages
{% endhint %}

If everything goes well, you should see the below result:

* [x] The form data will be saved in Elementor-> submission (because of the above collection submission)
* [x] The translation record will be shown in your [Stripe Dashboard](https://dashboard.stripe.com/test/payments).

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2Fp1qBBEcTRKZkfxDAfkAs%2Fimage.png?alt=media&#x26;token=9445df82-a31a-44a5-b2d5-d9a6c8faef87" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://1993841678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6FFXqELmFsGrfOxBauwC%2Fuploads%2FSIMlpMoum8ulPEtbdDKe%2Fimage.png?alt=media&#x26;token=c50ec4af-f631-4cfb-ab8b-bd4ece61a85c" alt=""><figcaption></figcaption></figure></div>

**Ok, That's it!**&#x20;
