Setting up subscription sales for a SaaS website often turns into a collection of workarounds: plans grow, users report errors, billing breaks at the worst moment. We solve this end-to-end by integrating Stripe Billing, Paddle, or Chargebee—no custom bicycles. Our track record: over 50 successful projects, 5+ years in billing system development. This approach reduces churn rate by 10–15% and saves up to 40 development hours per startup. Losses from unprocessed webhooks can reach $5,000 per month, so automation is critical. Additionally, proper integration saves up to $3,000–$5,000 monthly on manual management.
How to Integrate Billing
Do not implement billing yourself—use Stripe Billing, Paddle, or Chargebee. They handle: recurring payments, failed transactions, dunning mechanics, regional taxes. We set up the full cycle: from customer creation to webhook processing. As noted in Stripe's documentation, trial periods are simple and flexible to configure.
Integration with Stripe Billing
class SubscriptionService
{
public function createSubscription(User $user, string $priceId, array $options = []): Subscription
{
// Create Stripe Customer if not exists
if (!$user->stripe_customer_id) {
$customer = $this->stripe->customers->create([
'email' => $user->email,
'metadata' => ['user_id' => $user->id],
]);
$user->update(['stripe_customer_id' => $customer->id]);
}
$subscriptionData = [
'customer' => $user->stripe_customer_id,
'items' => [['price' => $priceId]],
'trial_period_days' => $options['trial_days'] ?? 0,
'payment_behavior' => 'default_incomplete',
'expand' => ['latest_invoice.payment_intent'],
];
$stripeSubscription = $this->stripe->subscriptions->create($subscriptionData);
return Subscription::create([
'user_id' => $user->id,
'stripe_subscription_id' => $stripeSubscription->id,
'plan' => $options['plan'],
'status' => $stripeSubscription->status,
'trial_ends_at' => $stripeSubscription->trial_end
? Carbon::createFromTimestamp($stripeSubscription->trial_end)
: null,
'current_period_end' => Carbon::createFromTimestamp($stripeSubscription->current_period_end),
]);
}
public function cancel(Subscription $subscription, bool $immediately = false): void
{
if ($immediately) {
$this->stripe->subscriptions->cancel($subscription->stripe_subscription_id);
} else {
// Cancel at end of period
$this->stripe->subscriptions->update($subscription->stripe_subscription_id, [
'cancel_at_period_end' => true,
]);
}
}
}
What Tariff Plans Can Be Configured?
Any limits are supported: number of projects, storage volume, number of API calls. We implement a flexible limit checking system with upgrade and downgrade capabilities. For unlimited plans, we use -1.
class PlanLimits
{
private array $limits = [
'free' => ['projects' => 1, 'storage_gb' => 1, 'api_calls_month' => 1000],
'starter' => ['projects' => 5, 'storage_gb' => 10, 'api_calls_month' => 10000],
'pro' => ['projects' => 20, 'storage_gb' => 50, 'api_calls_month' => 100000],
'enterprise' => ['projects' => -1, 'storage_gb' => -1, 'api_calls_month' => -1],
];
public function check(string $plan, string $feature, mixed $currentUsage): bool
{
$limit = $this->limits[$plan][$feature] ?? 0;
if ($limit === -1) return true;
return $currentUsage < $limit;
}
}
Webhook Handler for Billing Events
Route::post('/webhooks/stripe', function (Request $request) {
$event = \Stripe\Webhook::constructEvent(
$request->getContent(),
$request->header('Stripe-Signature'),
config('services.stripe.webhook_secret')
);
match($event->type) {
'customer.subscription.created' =>
HandleSubscriptionCreated::dispatch($event->data->object),
'customer.subscription.updated' =>
HandleSubscriptionUpdated::dispatch($event->data->object),
'customer.subscription.deleted' =>
HandleSubscriptionCancelled::dispatch($event->data->object),
'invoice.payment_failed' =>
HandlePaymentFailed::dispatch($event->data->object),
'invoice.payment_succeeded' =>
HandlePaymentSucceeded::dispatch($event->data->object),
default => null,
};
return response('ok');
});
Comparison of Billing Systems
| System | Pricing Model | Dunning | Taxes | Trial Period |
|---|---|---|---|---|
| Stripe Billing | 2.9% + 30¢ per successful charge | Built-in | Automatic | Yes |
| Paddle | 5% + 50¢ per transaction | Built-in | Automatic (includes VAT) | Yes |
| Chargebee | from $49/month + fee | Built-in | Automatic (add-on modules) | Yes |
Stripe Billing is best for startups—low fee, flexible setup. Paddle is convenient for global sales—it calculates taxes automatically. Chargebee suits complex billing logic with multiple providers.
Why Entrust Billing to Professionals?
Professional billing integration guarantees handling of all edge cases: mid-trial cancellation, partial refunds, switching to a plan with trial period. Self-implementation often leads to data leaks or incorrect tax calculation. We cover all webhook events and test scenarios with anomalous data.
What to Do When Payment Processing Fails?
On failures like card error or limit exceeded, Stripe Billing automatically launches a dunning process with retries. We additionally implement user notifications via email and interface, suspend access until successful payment. In case of unsuccessful payouts, the system sends an alert to the admin to manually contact the customer.
Typical Integration Mistakes and Their Solutions
| Problem | Solution |
|---|---|
| Webhooks not processed on plan change | Configure customer.subscription.updated and invoice.payment_succeeded events |
| Trial period not synced with access | Check trial_ends_at and block access after expiry |
| Limits not updated after upgrade | Implement real-time limit checking via middleware |
| Errors when canceling subscription | Use cancel_at_period_end for soft cancellation |
What Is Included in the SaaS Access Setup
- Integration with the chosen billing system (Stripe, Paddle, Chargebee).
- Configuration of tariff plans with any limits.
- Implementation of trial periods, upgrade, downgrade, and subscription cancellation.
- Webhook processing and synchronization with your database.
- API and code documentation.
- Access to test and production environments.
- Training for your team (up to 2 hours).
- Support for 3 months after launch.
- Setup of subscription status monitoring and failure alerts.
Work Process
- Analysis — we study your monetization model, tariff requirements, audit current infrastructure.
- Design — we develop billing architecture, choose system, design database schema.
- Implementation — we write integration code, set up webhooks, test critical scenarios.
- Testing — we check payment, cancellations, trial periods, error handling.
- Deployment — we deploy to production, set up payment monitoring.
Timelines and How to Start
SaaS billing with Stripe, tariff plans, and subscription management: 14–20 working days. Timeline may vary depending on tariff grid complexity and need for integration with other services.
To discuss your project, contact us — we will assess tasks and propose a solution within 1 day. We guarantee transparency and fixed cost after approval of technical specification. Request a consultation — get a commercial proposal. We are always happy to help you with billing setup.







