Integrate your WordPress forms with Stripe to process your one-time and recurring payments. Stripe forms enhance the user experience by allowing users to stay on your site while securely making a payment.
As of Formidable Stripe version 3.0, the add-on has been updated to accept payments with Link by Stripe. Learn more on how to setup Stripe Link.
Download and install
This plugin requires Formidable Forms Pro and the Stripe Payments add-on.
- If you haven't already done so, install and activate Formidable Forms Pro.
- In your WordPress admin, go to Formidable → Add-Ons and click the Install button for the WordPress Stripe plugin.
Set up Stripe API integration
Now that the Stripe Forms plugin is activated you'll need to connect your Stripe account. To do this, follow the steps below.
- Go to the Formidable → Global settings → Stripe tab, and click the Connect to Stripe button. This will need to be done once for testing and once for live.
- You will be redirected to connect.stripe.com where you can log in and select your Stripe account. If you are not the account owner and only have developer access, you can use this code snippet to use the API keys for integration.
- Follow any steps in the Stripe wizard and you will be returned to your site. Now you are ready to start collecting secure payments. All the webhooks are covered, and need no additional setup.
Set up a Stripe form to collect payments
Once you have the Stripe plugin activated and have connected your Stripe account, you can set up a form to take Stripe payments. Follow the directions below to collect Stripe payments with a Formidable form.
- Go into edit the form you would like to use with Stripe. Click on Settings → Actions & Notifications → Collect a Payment.
- Give your Payment action an Action Name for easy reference. This name will only be seen on the back-end.
- Give your Payment action a Description to attach to the payment. This information will be sent to Stripe along with the payment. You can either type in a description, or use a field from your form to set the description dynamically. If you would like to use a field for the description, click the icon in the Description box and then select your field in the modal box. This will insert a value like [3130] for your Description setting.
- Set the Amount for the payment. You can either type in an amount, or use a field from your form to calculate the amount. If you would like to use a field for the amount, click the icon in the amount box and then click your field in the modal box. This will insert a value like [3138] for your Amount setting.
It may be helpful to use field calculations to calculate a total in your form. Note: If you are using a field that uses separate values in the Amount field, insert [x show=value] instead of [x], where x is the field ID. - Next, make sure you have a Credit Card field in your form so that Stripe can process payment. If you do not have a Credit Card field in your form, you will be reminded to add one.
- Your Payment Type can be one-time or recurring. You can add multiple actions to your form if you would like both one-time and recurring payments. If you would like to allow either a one-time payment or recurring subscription, be sure to add conditional logic to both actions so they will only trigger at the times you would like. If you have chosen a recurring payment type, you will see the following options:
- Would you like to Capture the Payment later? You can authorize the payment now, and manually collect it later. Or finalize and collect the payment when the entry is submitted.
- Set your preferred currency for Stripe. By default, this will be set to the global currency.
- The Customer Information fields can be associated with field values in your form.
If you would like to pass a custom address to Stripe, you will need to add an Address field to your form. - You can also change field values automatically when a payment is completed, fails, or is refunded. Anything you set here will be also be triggered with every payment in a subscription.
For example, if you are creating posts, and would only like the post published when it is paid, use the After Payment settings. When the Payment is Completed, set your post status field to "publish". When Failed, set it back to "draft." - After saving the Collect a Payment form action, a Payment method field is added automatically on your form. This field is required. Do not remove it or your payments will not be sent to Stripe for processing.
- With Strong Customer Authentication (SCA) implementation, the credit card field is not visible when editing an entry.
- When the form is submitted, an entry is created. If the payment fails, the entry is deleted immediately after.
- If you have set up your emails to trigger when an entry is created, it will still be sent even if the payment fails. If you only want to send the emails for completed payments, change the trigger to Successful payment.
Trigger Actions after payment
There are several actions that can be triggered after a payment is complete or fails. Email notifications, Twilio (text messages), and MailChimp actions are currently setup to work this way. In each of these actions, you'll find options in the "Trigger this action after ____" setting. If you would like an email to be sent after the payment is complete, uncheck "Create" and check "Successful Payment."
When a one-time payment fails initially, only the entry created trigger is activated. The "Failed Payment" event will not trigger in this case, only for a recurring payment that fails.
With recurring payments, each payment will trigger one of these actions ("Successful Payment" or "Failed Payment"). The "Failed Payment" event occurs when a payment that is part of a recurring subscription fails.
Run a test payment
It is often helpful to run test payments to ensure that your form and Stripe are functioning well. Follow the steps below to run a test payment.
- Go to the Formidable → Global settings → Stripe tab.
- Select the option to Use the Stripe test mode. Make sure you have connected to your Stripe account for the Test connection. Hit Update.
- Open the page where your Stripe form is published.
- Submit a test entry. Use 4242424242424242 for the credit card number, any 3 digits for the CVC and any future date. Enter at least 50 cents for the amount.
- That's it! The form should submit normally if it is configured well and there are no errors.
If you want to test a variety of situations, see Stripe's testing documentation.
Save payment status in a field
If you would like to save the status of a payment in a field in your form, follow the instructions below.
- Go into a form that has a Stripe action included.
- Add a hidden field and Name it 'Payment status'.
- Go into your form's Settings → Actions & Notifications and open the Stripe form action.
- Scroll down to the After Payment section. Click the Add button.
- In the 'Payment Status' column, select Completed. In the 'Field' column, select your 'Payment status' field. In the Value column, select Completed. You can do the same for the Refunded and Canceled payment status.
- Hit Update. When a form payment is successfully completed, the payment status field will switch to Completed' to reflect the status of the Stripe payment. If the payment status is not updating properly, please make sure that your API keys are set up and saved accurately.
Add sales tax to total
You can calculate sales tax by following our guide to calculating sales tax. Then you can add it to the total amount collected in your Stripe payment action.
Conditionally collect payments
If you would like to set up different payment options in your form using Stripe, you'll need Conditional Logic. Suppose you have three payment plans in your form: Basic, Pro, and Enterprise.
- In your form, add a 'Dropdown', 'Radio', or 'Checkboxes' field called 'Payment Plan'. For this example, you would add the options: 'Basic', 'Pro', and 'Enterprise'. When your users fill out the form, they will select the payment plan that they would like to avail.
- Go to your form Settings → Actions & Notifications. Click Collect a Payment.
- Rename the label to 'Basic Plan' and select your preferred payment type, if it is a one-time payment or recurring.
- Select Add Conditional Logic. In this example, you would set 'Payment Plan' is equal to 'Basic'.
- Click the Update button to save the form action.
- Now, users who selected the 'Basic' payment plan will only be charged for the amount relevant to their chosen payment option.
- Repeat steps 2-5 to create the form actions for the other payment plans.
- To be sure that the one-time payment is processed, go to the Formidable → Global settings → Stripe tab, and select After entry is created.
- Click the Update button to save the Stripe settings.
Need to conditionally collect payments through Stripe and PayPal in the same form? See how to add optional online payment processing to WordPress Forms.
Set up a recurring payment
If you would like to set up a Stripe form action to take recurring payments, follow the steps below:
- Set up your WordPress form to take Stripe payments.
- Under Payment type select 'Recurring'.
- In the Repeat Every section, select how often the payment will recur.
- You may include a trial period before the actual subscription begins. If you would like to include a trial period, select how long the 'Trial Period' will be.
- Click Update. Now when a user submits the form, Stripe will automatically bill the user at intervals determined by your 'Repeat Every' setting.
Set up multiple types of payment
With Stripe, any number of payment options can be triggered on single form submission. Here's an example of how you can allow multiple payments such as one-time (non-recurring) payment, payment with a trial, and recurring payment. All of these form actions should trigger upon form submission.
- Go to Settings → Actions & Notifications. Click Collect a Payment to add a Stripe form action.
- In the Action Name box, insert 'Collect a Payment'.
- In the Amount box, type in the amount of the non-recurring payment or use a field from your form to calculate the amount.
- In the Payment Type, select 'One-time Payment'.
- In the Actions & Notifications, add another Collect a Payment form action.
- In the Action Name box, insert 'Collect a Payment with trial'.
- In the Amount box, type in the amount of the recurring payment or use a field from your form to calculate the amount.
- In the Payment Type, select 'Recurring'.
- In the Repeat Every section, select how often the recurring payment will take place. In the Trial Period section, select how long the 'Trial Period' will take place.
- In the Actions & Notifications, add another Collect a Payment form action.
- In the Action Name box, insert 'Collect a Recurring Payment'.
- In the Amount box, type in the amount of the recurring payment or use a field from your form to calculate the amount.
- In the Payment Type, select 'Recurring'.
- In the Repeat Every section, select how often the recurring payment will take place.
- Click Update. When the user submits the form, all form actions will be triggered for each type of payment.
Conditionally allow credit card payments
To conditionally allow credit card payments in your Stripe form, you will need Conditional Logic. Suppose you have two payment plans in your form: Pay via credit card and pay in person.
- In your form, add a dropdown or radio field called Choose Payment. For this example, you would add the options: Pay via credit card and Pay in person.
- In your Credit Card field, add conditional logic that shows this field if the dropdown or radio field equals Pay via credit card.
- Go to your form Settings → Actions & Notifications. Click Collect a Payment.
- Rename the label to Credit Card Payment. Add in the amount and select your preferred payment type if it is a one-time payment or recurring.
- Add conditional logic to the Stripe form action. Set it up to trigger when the dropdown or radio field equals Pay via Credit Card.
- Click the Update button to save the form action.
When your users fill out the form, they can select which payment plan they would like to use. If they choose Pay via credit card, the users will only be charged for the amount configured in the Stripe form action.
How to find the payment action ID
To find the payment action ID, go to your form Settings → Actions & Notifications → Collect a Payment and look for the payment action ID at the bottom right corner.
Set up Stripe Link
Link by Stripe is a secure and fast way to collect payments with the one-click checkout process. It allows users to store their encrypted information easily for future transactions. Learn more about Stripe Link.
- To get started, go to your Stripe Dashboard → Settings → Payment Methods and select your site from the dropdown on the upper left corner. Scroll down to the Wallets section and click the Turn on button for the Link payment method.
- If you haven’t yet, set up your Stripe form to collect payments.
- In the Stripe form action, switch the toggle on for Use previously saved card with Stripe link to enable it.
- Upon checkout, user accounts are authenticated by Stripe link using their email address.
- Collect email at payment. If you have not added an email field in your Stripe form action, the Stripe Link will automatically insert an email field on the payment form, right above the credit card field.
- Collect email before payment. If you have added an email field in your Stripe form action, it will trigger the Link authentication flow when the user enters their email address.
- Collect email at payment. If you have not added an email field in your Stripe form action, the Stripe Link will automatically insert an email field on the payment form, right above the credit card field.
- When an existing user completes the payment form again, Stripe Link will verify their identity by prompting a one-time code.
- You can use Stripe Link without signing up for one-time payments. All you need is to fill in all of the fields.
- If you don't have Stripe Link set up (which happens at least on your first time, based on your email address), it will prompt you if you want to Check out faster with Link.
- If you have set up Stripe Link already, it will prompt you for your 6-digit code when you enter your email address (directly underneath the email address input). It is a number that gets texted to you from Stripe. During testing (though there will be no text message), you can use any code. See note about error codes.
Testing Stripe Link
You can use any valid email and any code during testing, except for a few codes that trigger errors. Note that the verification code will not actually get sent to your phone during test mode.
- Error 000001: Code invalid
- Error 000002: Code expired
- Error 000003: Max attempts exceeded
Not all 3D secure credit card numbers work with Stripe link for testing. The number 4000000000003220 does work and is intended for testing Stripe link with 3D secure.
Styling Stripe Link
The elements will use your form styling automatically. If a Stripe link input has not yet been validated, the submit button will be disabled. When it is disabled, it will appear at 0.5 (half) opacity/semi-transparent.
Other considerations
- Link by Stripe is fully launched in the US and several other countries. Learn more on Stripe's Website - Country Availability.
- Stripe link actions are not compatible with other Stripe actions. It's advised not to have more than one payment action when using link.
- In terms of browser compatibility, Stripe elements don't support Internet Explorer.
Set up a Stripe form to send emails
Once you have set up a form to collect Stripe payments, you can send an email by changing the trigger to Successful Payment.
Resend emails on complete payment
If you have set up an email to trigger after collecting a Stripe form payment, you can resend an email by following the steps below:
- Add a payment status field in your form if you don't have one already.
- Go into the form's Stripe action. In the After payment section, set the value to Paid when the payment status is Completed.
- Add another email action to your form, set the trigger to Entry is created.
- Add conditional logic to this email action to fire only when the Payment status field is equal to Paid.
- On your form Entries page, click the entry that you want to resend the email.
- In the Entry Actions section (right sidebar), click the Resend Emails link to resend the email.
Note: This process will work if you have selected After entry is created in your Formidable → Global settings → Stripe page.
Customize the subscription renewal email
To set this up, you can use the inline conditional statements. In this case, if the entry was created more than 14 days ago, the email content can be different.
[if created_at less_than='-7 days']Thanks for your renewal! Your next payment will be in x days.[/if created_at] [if created_at greater_than='-7 days']Thanks for your initial payment! Your first renewal will trigger in x days.[/if created_at]
Replace 7 with your renewal period.
Set up Authorize and Capture
Stripe has a two-step payment process which allows you to authorize a payment then capture it later. One of the benefits of using this feature is that you can capture the cardholder's payment only after an order or item is ready. This can help in reducing processing fees if there is a chargeback or refund. To get started, follow the steps below:
- Open the form action settings to create a Stripe payment. Change Capture Payment to Later (collect manually).
- Go to Formidable → Payments. When a payment is authorized but not captured, the status will be displayed as Authorized.
- Select the payment to manually capture and click Capture now.
- If the payment was successfully captured, the payment status will change to Completed. If the payment is not captured within 7 days, the authorization will expire and the funds will be released
Process refunds
Once you have received a payment, refunding said amount can be quickly done with the Stripe add-on.
- To do this, navigate to Formidable → Payments. Hover over the Receipt ID for the payment you want to refund and click on View.
- Inside this page, you can see several bits of information, but what we are looking for is located on the top right corner of your screen, the 'Payment Details' widget.
- Click on Refund and click Yes in the confirmation box that shows up. If everything works as expected, the word Refunded should appear where the Refund button used to be.
Export list of payments
If you would like a compiled list of all the payments made in your Stripe form, you can export the entries as a CSV file. This will include the payment details and status.
To get started, navigate to the Formidable → Entries page and select the form where the Stripe payments were made. Then click the Download CSV button above the entries table to export the payment details via CSV.
Show a list of subscriptions
As an admin, you can see all the subscriptions on the Formidable → Payments → Subscriptions page.
Each subscription can be canceled from here as well.
Show subscriptions for current user
If you would like to show your users a list of their subscriptions, along with cancellation links, insert [frm-subscriptions] on a page. If a user is logged in, they will see their subscriptions listed here.
Conditionally show active subscriptions
If you would like to display the active subscriptions for the current user but conditionally show the payment form when there is none, you can set this up by following the instructions below.
- In the form builder, add a hidden field called Payment Status and save the payment status in the field. Make sure that you have added a field for the Completed payment status.
- Create a single entry View of the same subscription form.
- Set up the View filter such as:
- User ID is equal to current_user.
- Payment Status is equal to completed.
- In the Listing Page Content box, insert the [frm-subscriptions] shortcode to show your users a list of their subscriptions.
- In the No Entries message box, insert your Payment form shortcode:
- Click Update and publish the View on a page.
Get receipt ID
If you would like to get the receipt ID for a specific entry, you may use this shortcode:
[frm-receipt-id entry="[id]"]
This shortcode may be placed in a View, email message, success message, or even an API action that fires after a payment is complete.
Publish a post on complete payment
If you would like to publish a post after collecting a Stripe form payment, follow the steps below.
- Set up your form to take a Stripe payment.
- Add a Create posts action.
- Add a post status field to your form, if you don't have one already.
- Select 'Draft' as the default value in your new 'Status' field.
If you do not want the user to have access to changing the status of this field, you can set the field to Read Only. You can also hide the whole field from the user by changing the Visibility to 'Administrator'. - Click Update.
- Go into the form's Stripe action. In the After Payment section, set the dropdown in the Payment Status column to 'Completed', set the dropdown in the Field column to your 'Status' field, and type 'publish' in the Value column.
- Click Update and Publish your form on a page. Now when a user submits the form with their payment information received, the post will be published.
Troubleshooting
The Stripe Token is missing
If you see this error message, check each of the following:
- Do you have a credit card field in your form? If not, this is required in order for a payment to process.
- Is your API key correct? Please review the steps above to make sure your API keys are setup and saved accurately.
- Do you have more than one payment form on the same page? This is a current limitation of the Stripe add-on that we plan to improve in the future.
- Are Formidable Forms and Formidable Forms Pro up to date? If not, please update.
- Do you have another plugin installed that uses Stripe? If so, try deactivating it to check for a conflict.
- Do you have the Formidable Authorize.net plugin installed? If so, you'll need to choose between the two. They are currently not designed to work together.
If you continue getting this message, please create a new ticket in the help desk.
No such plan
The Stripe form settings automatically create a plan in Stripe. However, if the Stripe account is changed, the plan will not exist in the new account. If you submit a payment form and see the 'No such plan' message, return to the Stripe payment settings for this form, and save the settings again. This will trigger the plan to be created in Stripe again. It may help to make a small change in these settings to ensure the plugin knows to create the plan.
No such customer
When a logged in user submits a payment, a customer is created for that user in Stripe. The customer ID is linked to the logged in user. If the Stripe account is changed, or the customer account deleted in Stripe, a logged in user who has previously submitted a payment may see the message "No such customer" when a payment form is submitted. When this happens the customer ID is unlinked from the user, and the next try from this user should be successful. This message will not appear for logged out users or for those submitting the first payment. To avoid this issue, do not delete customers in Stripe.
If this error continues, the customer id assigned to the user can be manually deleted in PHPMyAdmin or with a line of code.
$user_id = 1; // Change the user id to the user getting errors. delete_user_meta( $user_id, '_frmstrp_customer_id' ); delete_user_meta( $user_id, '_frmstrp_customer_id_test' );
Incomplete payments
When a form is loaded, an incomplete payment is created in Stripe. As the form is filled out, the value of the payment is updated.
If you would like to disable these incomplete payments in Stripe for $1 (or another currency), go to Formidable → Global Settings → Stripe. Set the option to Process One-time Payments to After entry is created.
Payment Intent status: requires_payment_method
If you are seeing this error in the Stripe logs, then it is possible that the automatically generated "Payment Method" field has been deleted or otherwise modified. This field is hidden, but required for Stripe to process the payment. If you don't see the field in your form, delete the credit card field and the Stripe form action, and then re-create them. If the field is present, make sure there is no conditional logic set on this field.
The provided PaymentMethod was previously used
If you are seeing an error message that looks similar to this: "The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment", first make sure that you are running the most current version of the Stripe add-on. If you are and continue to see this message, it's possible that the Payment Method field has become unlinked from the Stripe form action. Try deleting the Payment Method field from your form, along with the Stripe form action(s), and recreate the Stripe form action(s).
Please specify an amount for the payment
If you are seeing this error message when attempting to submit your payment form, then there is likely an issue with the Amount set in the Stripe form action. Please check the following:
- There are only numbers in the Amount field in the Stripe form action—no commas, currency symbols, or text.
- If using a field to calculate the total, make sure the correct field shortcode is in the Amount field in the Stripe form action, and the calculation is correct and contains no text.
- If the above steps do not resolve the issue, try deleting the Payment Method field from your form and the Stripe form action, and recreate the Stripe form action.
Logging for other errors
A log file is stored inside of the Stripe plugin that keeps a list of the most recent errors. If you run into an error related to the payments and are not sure where to start, a log message would be helpful. The log can be located in wp-content/plugins/formidable-stripe/formidable-payments/log/results.log. The most recent messages are at the bottom of the log.
In addition to the log stored in Formidable, Stripe has a separate log. It may be useful to compare the two and see if additional errors are appearing in your Stripe account log as well. You can find it in your Stripe dashboard under Developers → Logs.
No payments created
If no payments are showing up under your Formidable → Payments page, it's possible that your database has not created a Payments table or is not properly updating. On some servers, the database user doesn't have permissions to ALTER database tables. To grant and revoke rights to database tables using phpMyAdmin, follow the instructions below:
- Navigate to the Privileges tab which has a list of your users.
- Click the Edit Privileges link.
- Select your database.
- In the Database-specific privileges, select the wp_frm_payments table.
- In the Table-specific privileges, you can define the operations in detail.
- Manually make adjustments to the table to match the structure in our database schema.
Note: If you are using the PayPal add-on at the same time, leave the Completed column as is.
Cannot set id on this object
If you see the error message Cannot set id on this object. HINT: you can't set: id, check each of the following:
- Do you see anything related to this error in the Stripe logs?
- Do you have another plugin installed that uses Stripe? Try deactivating it to check for a conflict.
If you continue getting this message, please create a new ticket in the help desk.
The account id does not match its signature
If you see this error message, it means that no account ID is sent to our Stripe connect service. The data that is being passed to us isn't what we're expecting it to be.
You might want to check if your Stripe API integration has been disconnected or if the account password is wrong. If you continue to see this message, check for plugin/theme conflicts.
The payment method type link is invalid
If you see this message along with a 400 error in the Stripe dashboard, you have not enabled Link first in the Stripe dashboard. Please ensure that the provided type is activated in your dashboard.
Stripe connections are not working
If you click the Connect to Stripe button and it never reaches the initial Stripe setup page, you might be getting blocked by a security service on their server. If you see an error message cURL error 28: Connection timeout, please check the following:
- Your web host may be blocking communication with formidableforms.com and causing the Stripe connections to stop working. how to whitelist our IP.
- The cURL is not enabled on your server. If you need help checking this, contact your host to find out.
- If that does not eliminate the error message, you may be behind a corporate firewall preventing communication with formidableforms.com. Please get in touch with us through the help desk for assistance.
Additional Customizations
Change the user role
You may want to change the role back if a payment fails or is refunded. Use the frm_payment_status_complete hook if you want to change the user role when the payment is completed. With a recurring payment, this hook will be fired each time a payment is completed.
Similar hooks are fired each time the status on payment changes. These hooks work exactly the same way but simply fire at different times.
- frm_payment_status_complete
- frm_payment_status_refunded
- frm_payment_status_failed
- frm_payment_status_canceled
Trigger an action based on payment amount
If you want to trigger an action in another form (or the same form) when a payment is more than a certain amount, use the following example:
add_action( 'frm_payment_status_complete', 'frm_trigger_action_on_payment' ); function frm_trigger_action_on_payment( $atts ) { $payment_amount = $atts['payment']->amount; if( $payment_amount < 100.00 ) { // Change 100.00 to the payment amount above which you want to trigger the action return; } $entry_id = isset( $atts['entry'] ) ? $atts['entry'] : $atts['payment']->item_id; $entry = FrmEntry::getOne( $entry_id, true ); $form = FrmForm::getOne( $entry->form_id ); FrmFormActionsController::trigger_actions('update', $form, $entry, 'email'); }
As is, the above example will trigger all Email actions set to trigger on update, in the same form. If you want to trigger an action in a different form, change $entry_id to the entry ID of an entry in another form.
Trigger an action on complete payment
Use the frm_payment_status_complete hook if you want to target a specific payment action ID and send an email on complete payment.
Use the Stripe receipt
By default, an email form action can be used to send a receipt. In this case, the email would be set to trigger after successful payment. But this example will allow you to use the Stripe receipts.
add_filter( 'frm_strp_new_charge', 'set_stripe_to_trigger_receipt', 10, 2 ); function set_stripe_to_trigger_receipt( $new_charge, $atts ) { if ( $atts['action']->ID == 30 ) { // change 30 to your payment form action ID $email_field_id = 25; // change 25 to your email field id $new_charge['receipt_email'] = $atts['entry']->metas[ $email_field_id ]; } return $new_charge; }
Note: This will only work for live payments. Read more about using Stripe receipts.
Get customer ID
You can find the Stripe customer ID in the user meta called _frmstrp_customer_id or _frmstrp_customer_id_test. To get the customer ID, use this line of code:
get_user_meta( get_current_user_id(), ' _frmstrp_customer_id' )
Use the Stripe API Key integration
With version 2.04 and later, you will be redirected to connect.stripe.com to integrate your Stripe account. If you are not the account owner and only have developer access, you can use the following code snippet to use the API keys for integration.
add_action( 'plugins_loaded', function() { $options = get_option( 'frm_strp_options' ); if ( false === $options ) { $options = new stdClass(); } $options->test_secret = 'sk_TEST_SECRET'; $options->test_publish = 'pk_TEST_PUBLISH'; $options->live_secret = 'sk_LIVE_SECRET'; $options->live_publish = 'pk_LIVE_PUBLISH'; update_option( 'frm_strp_options', $options ); });
When adding the endpoint, select the latest API version and enable ONLY the following events:
- charge.captured
- charge.refunded
- customer.deleted
- customer.subscription.deleted
- customer.subscription.updated
- invoice.payment_failed
- invoice.payment_succeeded
- payment_intent.payment_failed
- payment_intent.succeeded
Customize the subscription cancel link
If you show subscriptions for the current user, you can customize the cancellation link displayed with the subscription by following the example below.
add_filter('frm_pay_stripe_cancel_link', 'customize_stripe_subscription_cancel_link'); function customize_stripe_subscription_cancel_link( $link, $subscription ) { $link = str_replace( '>Cancel<', '>' . 'Cancel Subscripion ID ' . $subscription->id . '<', $link ); return $link; }, 10, 2 );
Update credit card details
The Stripe customer portal lets users manage their subscriptions and billing details through a Stripe-hosted page. With the no-code Stripe customer portal link, you can configure the following settings:
- Payment Method: Add or delete credit card payments.
- Subscriptions: Upgrade, downgrade, or cancel a subscription.
- Billing information: View and update billing information, such as name, address, and phone number. Note: Users can’t update their email address if they are using the no-code customer portal link.
- Invoice: View the invoice history.
If you want your users to update their payment method, such as credit cards, you can use the Stripe customer portal no-code link to set this up. Follow the instructions to get started.
- Go to Stripe → Settings → Billing → Customer Portal.
- Select your configuration options for payment methods.
- In the Customer Portal link section, click the Activate link button and copy the customer portal link.
- Go back to your site. Create a new page, add a WordPress button block, and paste the customer portal link. (Optional) To show the subscriptions for the current user, you can insert the [frm-subscriptions] shortcode on the same page.
You could also use HTML to create the link.<a href="https://billing.stripe.com/p/login/test_xxxx">Update payment method</a>
- When the user clicks the link, it will redirect them to the Stripe Customer Portal page, where they can add or delete their payment method.