ilateral\SilverStripe\StripeForms\Forms\StripePaymentSubscriptionForm
Custom version of the payment details form that also sets up a subscription that is then assigned to the user.
The end user enters their credit card details and when the
form is submitted, they are pushed to Stripe via the API.
The form is then pre-populated with summary details of the
saved payment details.
This form expects a Stripe Plan ID (that the user will be added to).
If this is not set, the form will be disabled and an error shown.
By default this form uses the default Stripe JS, if you wish
to overwrite this functionality (to perform custom operations)
then make sure you disable the use_custom_js config variable.
- Author: Mo <morven@ilateral.co.uk>
Synopsis
class StripePaymentSubscriptionForm
extends StripePaymentDetailsForm
{
- // members
- protected $plan_id;
- // methods
- public void setPlanID()
- public void getPlanID()
- public void __construct()
- public SS_HTTPResponse doSavePaymentDetails()
- // Inherited methods from StripePaymentDetailsForm
- public void __construct()
- protected ArrayData get_card_details()
- public SS_HTTPResponse doSavePaymentDetails()
Hierarchy
Members
protected
- $plan_id
—
string
The Stripe plan ID (this is used to assign the customer to a plan)
Methods
public
- __construct() — Create this form object
- doSavePaymentDetails() — Save stripe payment details against a customer using the stripe API
- getPlanID()
- setPlanID()
Inherited from ilateral\SilverStripe\StripeForms\Forms\StripePaymentDetailsForm
protected
- get_card_details() — Get the card details from stripe for the current user
public
- doSavePaymentDetails() — Save stripe payment details against a customer