You can set form fields like email address, cardholder's name, billing- and shipping address, apply coupons, and select the product to be purchased via URL parameters.
Imagine the following business cases:
WP Full Pay can be integrated into these and similar payment flows by using URL parameters and filter hooks.
In this article, we’ll describe the integration capabilities, starting from simple examples going to the more complex use cases.
Pre-filling form fields is disabled by default.
Pre-filling all fields of all forms can be enabled on the “Full Pay / Settings / Forms / Options” page in WP admin:
You have to implement the fullstripe_form_field_configuration filter.
Use the following API functins in conjunction with the filter to specify which fields can be set via URL parameters, and which fields will become read-only once set:
The following table summarizes which fields can be prefilled.
There are fields which are available only in one layout (inline or checkout), or on a certain form type. Some fields can be made readonly, others cannot. The table below documents all these attributes:
URL parameter | Layout | Readonly? | Comments |
---|---|---|---|
inline, checkout | ✅ | On checkout forms, the email address is read-only by default. | |
cardholdersName | inline | ✅ | |
customerId | checkout | 𐄂 | Selects the customer, freezes the email field. |
price | inline, checkout | 𐄂 | The value is the Stripe price ID of the product to be selected. |
coupon | inline, checkout | 𐄂 | The value is the name of a coupon or promotional code. |
amount | inline, checkout | ✅ | Sets the custom payment amount. The value is the payment amount in cents. |
customField | inline, checkout | ✅ | The parameter name is numbered, eg. customField1, customField2, etc. |
billingName | inline | ✅ | |
billingAddress | inline | ✅ | |
billingAddress2 | inline | ✅ | |
billingCity | inline | ✅ | |
billingZip | inline | ✅ | |
billingState | inline | ✅ | |
billingCountryCode | inline | ✅ | The two-letter ISO country code in uppercase. |
shippingName | inline | ✅ | |
shippingAddress | inline | ✅ | |
shippingAddress2 | inline | ✅ | |
shippingCity | inline | ✅ | |
shippingZip | inline | ✅ | |
shippingState | inline | ✅ | |
shippingCountryCode | inline | ✅ | The two-letter ISO country code in uppercase. |
Here is an URL example of pre-filling the email, and cardholder’s name fields via URL parameters:
https://example.com/pay?email=john.doe@example.com&cardholdersName=John
When the page is loaded, here is how the form looks:
Let’s say you don’t want to enable pre-filling form fields globally.
You’d like to implement the following rule set:
Here is the filter hook implementation:
Important notes:
Our support team is happy to help you.
Contact support
Feature requests are always welcome!
We consider each feature request carefully, and examine how it fits the roadmap for the plugin.