mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 10:53:23 +00:00
security: Address critical security vulnerabilities and improve code quality
🔒 Security Fixes: - Make webhook signature validation required for production - Prevent information disclosure by returning 200 for all webhook responses - Sanitize external error messages while preserving internal logging 🔧 Code Quality Improvements: - Add URL validation to prevent localhost usage in production - Create currency utilities for proper handling of non-centesimal currencies - Replace unsafe 'any' types with type-safe ProviderData wrapper - Add comprehensive input validation for amounts, currencies, and descriptions - Set default Stripe API version for consistency 📦 New Features: - Currency conversion utilities supporting JPY, KRW, and other special cases - Type-safe provider data structure with metadata - Enhanced validation functions for payment data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,3 +10,12 @@ export type PaymentProvider = {
|
||||
onInit?: (payload: Payload) => Promise<void> | void
|
||||
initPayment: InitPayment
|
||||
}
|
||||
|
||||
/**
|
||||
* Type-safe provider data wrapper
|
||||
*/
|
||||
export type ProviderData<T = unknown> = {
|
||||
raw: T
|
||||
timestamp: string
|
||||
provider: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user