This module allows you to make payments part of your webforms. It makes embedding payment into your forms (nearly) as easy as adding a new textarea.
Features
- Seamless integration into webform: The payment is handled like any other webform component. No-popups - redirects only if required by the chosen payment method.
- form_builder support: You can use form_builder to configure this webform component.
- Support for JavaScript-based payment methods (PCI-SAQ A-EP) like Stripe and Braintree.
- Re-entrance: User can continue filling out the form after paying. They always land on the webform page again - even after being redirected off-site.
Limitations
The module works only with payment methods that are aware of their payment context.
Usage
Requirements
as of version 7.x-2.0-beta3
- PHP 7.0+ (as of version 2.0)
- currency
- jquery_update for jQuery 1.7+.
- little_helpers ≥ 2.0-alpha3 provides a nice API for accessing webform data.
- payment ≥ 1.6
- payment context
- psr0 for class autoloading.
- webform
Configuration
- Enable the module (ie.
drush en -y webform_paymethod_select
). - Configure your payment methods as usual at admin/config/services/payment/method.
- Add this component to your webform (type Payment Selector).
- Configure the component by filling the required fields.
Advanced usage: Read values from other webform components
The following properties of your payment can be read from other webform components:
- The payment’s currency. Perhaps you also want to use webform currency in this case.
- The line item’s amount.
- The line item’s quantity.
Take care that only valid values can be entered in the referenced component. No additional validations will be applied.
Advanced usage: Override values using special form keys
added in 7.x-2.0-beta4
You can also customize your payment line items for each form submission by using special form keys. Each of the keys must be prefixed with payment__item{N}__
(the {N}
references the n-th line item, starting with 1):
amount
: The line item amount (numeric value).quantity
: The line item quantity (non-negative integer).description
: The line item’s description (string).tax_rate
: The line item’s tax rate (numeric value).recurrence__interval_unit
: The base interval for recurrent payments.recurrence__interval_value
: Multiplicator of the base interval.recurrence__day_of_month
: Day of the month on which payment’s will be collected.recurrence__month
: Month when the payment’s will be collected (ie. for yearly payments).recurrence__start_date
: Earliest day for the first payment.recurrence__count
: Stop recurrence after a specific number of payments.
For example a component with form-key payment__item2__recurrence__interval_unit
with the value monthly
will turn the second line item (if configured) into a monthly payment.
Take care that only valid values can be entered in the referenced component. No additional validations will be applied.
Compatible payment methods
Please post an issue if something is missing here
Project information
- Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues. - Module categories: E-commerce
- Ecosystem: Payment, Webform
- 63 sites report using this module
- Created by torotil on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
success message