This project is not covered by Drupal’s security advisory policy.
This Stripe Customer Portal module provides a simple and efficient way to integrate Stripe's Customer Portal feature into Drupal websites. It adds a new 'stripe_customer_id' field type and a field formatter that creates a new session for the Stripe customer and generates a link to access the Stripe Customer Portal.
Features:
- Easy integration with Stripe's Customer Portal.
- Custom 'stripe_customer_id' field type to store Stripe Customer IDs.
- Field formatter to generate a link to access the Stripe Customer Portal.
The module allows you to seamlessly manage customer subscriptions and billing information using Stripe's powerful platform while ensuring a user-friendly experience for your customers.
For more information on Stripe and the Customer Portal, please refer to the following resources:
- Stripe Customer Portal
- Stripe API Reference
- Stripe PHP Library
Requirements
Stripe module 2.0+
Please note: This module requires the Stripe PHP library, which is a part of the Stripe module, to function. Make sure to install it using Composer.
Installation and usage
- Install this module using composer as usual and enable it.
- Go to the entity that you want to add the field to, "most probably the User entity"
- Add new field of type "Stripe Customer ID"
- Name your field and save it
- Go to the entity "Manage display" page
- Edit your newly created field and fill in the Link Title and the Return URL (both are mandatory)
- The return URL can be internal link "starts with /" or external link "starts with https"
- Save
In most cases, you also need to hide the field from the entity add/edit form or grant access to authorized users only.
- Go to the entity "form display"
- Move the field to the "disabled" section
Otherwise, you need to grant access to the field using any of the content access modules or techniques.
Integration with Webform and Stripe Webform Payment module
Despite the fact that this module is independent of these modules and can work with any other modules, and even when you want to save the customer ID manually, it is designed to work seamlessly with the Webform module and Stripe Webform Payment.
When using Stripe Webform Payment to create a new Stripe customer, the module can pass the Customer ID as a token to your webform. Webform handlers can then save this token in an entity using the custom 'stripe_customer_id' field provided by the Stripe Customer Portal module.
Once the Customer ID is stored, the field formatter generates a link to access the Stripe Customer Portal, enabling customers to manage their subscriptions, billing information, and other related actions. This integration ensures a streamlined user experience and a secure way to manage Stripe customer information within your Drupal website.
For more information on Webform and Stripe Webform Payment, please refer to the following resources:
- Webform module
- Stripe Webform Payment module
This module has been tested with Drupal 9.
Happy coding!
Project information
- Project categories: E-commerce, Integrations, Developer tools
- Ecosystem: Stripe Webform Payment, Stripe
6 sites report using this module
- Created by hodba on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
