Skip to main content

FastSpring

FastSpring is a Merchant of Record (MoR) that handles global tax compliance, VAT/GST, and local payment methods. Subscribd integrates with the FastSpring API.

Configuration

// config/subscribd.php
'gateways' => [
    'fastspring' => [
        'driver'         => \Pixelworxio\Subscribd\Gateways\FastSpringGateway::class,
        'username'       => env('FASTSPRING_USERNAME'),
        'password'       => env('FASTSPRING_PASSWORD'),
        'webhook_secret' => env('FASTSPRING_WEBHOOK_SECRET'),
        'storefront'     => env('FASTSPRING_STOREFRONT_URL'),
        'success_url'    => env('FASTSPRING_SUCCESS_URL'),
        'cancel_url'     => env('FASTSPRING_CANCEL_URL'),
    ],
],

Environment variables

FASTSPRING_USERNAME=...
FASTSPRING_PASSWORD=...
FASTSPRING_WEBHOOK_SECRET=...
FASTSPRING_STOREFRONT_URL=https://yourstore.onfastspring.com
FASTSPRING_SUCCESS_URL=https://yourapp.com/billing/success
FASTSPRING_CANCEL_URL=https://yourapp.com/billing/cancel

Checkout flow

FastSpring uses a hosted storefront for checkout. CreateSubscription returns an Incomplete subscription with a checkout_url in meta. Redirect the user to complete payment:
$subscription = app(CreateSubscription::class)->execute($user, $plan, ['gateway' => 'fastspring']);

if ($subscription->status->value === 'incomplete') {
    return redirect($subscription->meta['checkout_url']);
}
SubscriptionCreated fires from the webhook handler after FastSpring confirms the order.

Webhooks

Configure a webhook endpoint at https://yourapp.com/subscribd/webhook/fastspring in your FastSpring Dashboard under Developer > Webhooks. Enable:
  • subscription.activated
  • subscription.updated
  • subscription.canceled
  • subscription.deactivated
  • order.completed
  • order.failed
Set the HMAC Secret in FastSpring and add it as FASTSPRING_WEBHOOK_SECRET.

Limitations

  • Proration is handled by Subscribd’s built-in ProrationEngine.
  • Trial extension is not supported natively. ExtendTrial updates the local trial_ends_at only.
  • Pausing is not supported natively. Subscribd updates the local status only.

Next steps

  • Square — Card-present and online payments
  • Webhooks — Full webhook reference