feat(payments): enhance Polar.sh provider with official API compliance
- Add comprehensive rate limiting (300 req/min) with automatic throttling - Implement centralized API request method for consistent authentication - Add support for Polar-specific webhook events (order.created, order.paid, subscription.active, customer.state_changed, benefit_grant.created) - Update API endpoints to match Polar's official structure (remove /v1 prefix) - Add external_id support for reliable customer-user mapping - Implement sandbox mode with separate credentials configuration - Add discount code support in checkout flow - Add credential validation method for API connectivity testing - Update webhook signature validation and event handling - Enhance error handling and logging throughout provider - Add proper metadata structure with user and plan information - Update services configuration and environment variables for sandbox support BREAKING CHANGE: Updated API endpoint structure and webhook event handling to comply with Polar.sh official API specification.
This commit is contained in:
@@ -40,6 +40,14 @@ class Subscription extends Model
|
||||
'migration_date',
|
||||
'migration_reason',
|
||||
'created_at',
|
||||
'activated_at',
|
||||
'checkout_id',
|
||||
'customer_id',
|
||||
'polar_checkout',
|
||||
'order_id',
|
||||
'polar_order',
|
||||
'order_created_at',
|
||||
'order_paid_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
Reference in New Issue
Block a user