ποΈCreating Direct Subscriptions
Connected Account Subscriptions (Using Direct Charges)
This is for creating subscriptions from the end customer to the connected account. Click below to learn more about direct charge subscriptions with connected accounts and understand what the prerequisites are.
Click here to view the prerequisites as outlined by stripe
These are outlined below loosely related into laravel:
A customer model (with ConnectedCustomer trait and created in stripe as above)
A merchant or connected account model (with ConnectBillable trait and onboarded as outlined above)
A connected account product with price
Let's assume you have all 3 you would just run the following function:
The $customer variable would be your eloquent model that is set up on connect with the ConnectCustomer trait. The $price would be the string of your price id from stripe. The $data model would be any additional data or settings you want to apply to the subscription such as quantity or trial options as per the stripe API documentation.
Last updated