Documentation, Reference Materials and Tutorials for WPForms
With WPForms, you can easily accept payments from your customers using PayPal or Stripe. You can also use both in one form and allow your users to decide which payment method they prefer. In this article, we’ll show you how to allow your users to choose a payment method.
Before we get started, you’ll need to have the PayPal and Stripe addons installed on your site in order to accept payments. Our smart conditional logic feature is already included into the core, so users can choose their preferred payment method.
Creating an Order Form
First off, create a new form or edit an existing form with WPForms.
If you are creating a new form, you’ll need to provide your form a title and choose a template. We’re using the Blank Form template.
Now add the following fields to your form: Name, Email, Multiple Choice and Credit Card.
Allowing Different Payment Methods
Click on the Multiple Choice field in your form. In the left panel, you can edit the name and choices of that field. Rename label to “Payment method” and rename the choices to PayPal and Stripe. You can remove the third field by clicking on the – button next to it. Be sure to set this field as required.
Now click on the Credit Card option in your form. In the left panel, make sure to set it as NOT required. Just below the Conditionals column, choose to show the field only if your user selects Stripe as the payment method.
That means the credit card option will only be shown to users who have selected Stripe as their payment method. If a user selects PayPal and hits the submit button, we need to redirect them to PayPal site to make a payment.
Configuring PayPal Settings
Go to Payments tab and click on PayPal Standard option. You’ll need to configure the payments settings.
Be sure to enable conditional logic and choose to process PayPal payment only if your user selects PayPal option under the Payment Method field.
Configuring Stripe Settings
Finally, return to the Stripe option under the Payments tab. Now enable Stripe Payments and Conditional Logic. Then, choose to process Stripe payment only if Stripe is selected as the payment method.
We hope this guide helped you to learn how to allow users to choose the payment method they prefer while making a payment.