Files
zemailnator/config/services.php
idevakk ad89b84471 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.
2025-11-22 06:19:27 -08:00

103 lines
3.8 KiB
PHP

<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
/*
|--------------------------------------------------------------------------
| Payment Providers
|--------------------------------------------------------------------------
|
| Configuration for various payment providers used in the application.
| Each provider has specific API keys, webhooks, and settings.
|
*/
'stripe' => [
'secret_key' => env('STRIPE_SECRET'),
'publishable_key' => env('STRIPE_PUBLISHABLE_KEY'),
'webhook_secret' => env('STRIPE_WEBHOOK_SECRET'),
'success_url' => env('STRIPE_SUCCESS_URL', '/payment/success'),
'cancel_url' => env('STRIPE_CANCEL_URL', '/payment/cancel'),
],
'lemon_squeezy' => [
'api_key' => env('LEMON_SQUEEZY_API_KEY'),
'store_id' => env('LEMON_SQUEEZY_STORE_ID'),
'webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET'),
'success_url' => env('LEMON_SQUEEZY_SUCCESS_URL', '/payment/success'),
'cancel_url' => env('LEMON_SQUEEZY_CANCEL_URL', '/payment/cancel'),
],
'polar' => [
'api_key' => env('POLAR_API_KEY'),
'webhook_secret' => env('POLAR_WEBHOOK_SECRET'),
'sandbox' => env('POLAR_SANDBOX', false),
'sandbox_api_key' => env('POLAR_SANDBOX_API_KEY'),
'sandbox_webhook_secret' => env('POLAR_SANDBOX_WEBHOOK_SECRET'),
'success_url' => env('POLAR_SUCCESS_URL', '/payment/success'),
'cancel_url' => env('POLAR_CANCEL_URL', '/payment/cancel'),
'access_token' => env('POLAR_ACCESS_TOKEN'),
],
'oxapay' => [
'merchant_api_key' => env('OXAPAY_MERCHANT_API_KEY'),
'payout_api_key' => env('OXAPAY_PAYOUT_API_KEY'),
'webhook_url' => env('OXAPAY_WEBHOOK_URL'),
'success_url' => env('OXAPAY_SUCCESS_URL', '/payment/success'),
'cancel_url' => env('OXAPAY_CANCEL_URL', '/payment/cancel'),
'sandbox' => env('OXAPAY_SANDBOX', false),
],
'crypto' => [
'enabled' => env('CRYPTO_PAYMENTS_ENABLED', false),
'webhook_secret' => env('CRYPTO_WEBHOOK_SECRET'),
'confirmation_timeout_minutes' => env('CRYPTO_CONFIRMATION_TIMEOUT', 30),
'exchange_rate_provider' => env('CRYPTO_EXCHANGE_RATE_PROVIDER', 'coingecko'),
'coingecko_api_key' => env('COINGECKO_API_KEY'),
'blockchair_api_key' => env('BLOCKCHAIR_API_KEY'),
'success_url' => env('CRYPTO_SUCCESS_URL', '/payment/success'),
'cancel_url' => env('CRYPTO_CANCEL_URL', '/payment/cancel'),
],
'activation_key' => [
'key_prefix' => env('ACTIVATION_KEY_PREFIX', 'AK-'),
'key_length' => env('ACTIVATION_KEY_LENGTH', 32),
'expiration_days' => env('ACTIVATION_KEY_EXPIRATION_DAYS'),
'require_email_verification' => env('ACTIVATION_KEY_REQUIRE_EMAIL', true),
'max_keys_per_user' => env('ACTIVATION_KEY_MAX_PER_USER', 5),
],
];