← All changes
|
app/Modules/PaymentMethods/StripeGateway/SubscriptionsManager.php
+4
-4
1.6.0
→
1.6.5
View file →
| @@ -77,20 +77,20 @@ | ||
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Check rate limit for SetupIntent creation to prevent card testing fraud. |
| 80 | 80 | * |
| 81 | - * Rate limit: 7 attempts per day per customer by default (for subscription | |
| 81 | + * Rate limit: 5 attempts per day per customer by default (for subscription | |
| 82 | 82 | * card updates), overridable via the |
| 83 | 83 | * fluent_cart/stripe/setup_intent_rate_limit_customer_daily filter. The SAME |
| 84 | 84 | * filter default feeds getRemainingRateLimit(), so enforcement and the |
| 85 | 85 | * displayed remaining count share one contract. |
| 86 | - * | |
| 86 | + * | |
| 87 | 87 | * @param string $customerId Stripe customer ID |
| 88 | 88 | * @return bool|\WP_Error Returns true if allowed, WP_Error if rate limited |
| 89 | 89 | */ |
| 90 | 90 | protected static function checkRateLimit($customerId) |
| 91 | 91 | { |
| 92 | - $customerDailyLimit = apply_filters('fluent_cart/stripe/setup_intent_rate_limit_customer_daily', 7, $customerId); | |
| 92 | + $customerDailyLimit = apply_filters('fluent_cart/stripe/setup_intent_rate_limit_customer_daily', 5, $customerId); | |
| 93 | 93 | |
| 94 | 94 | $customerDailyKey = 'fct_stripe_setup_intent_rate_daily_' . md5($customerId); |
| 95 | 95 | $customerDailyAttempts = get_transient($customerDailyKey) ?: 0; |
| 96 | 96 | |
| @@ -104,9 +104,9 @@ | ||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | public function getRemainingRateLimit($customerId) |
| 107 | 107 | { |
| 108 | - $customerDailyLimit = apply_filters('fluent_cart/stripe/setup_intent_rate_limit_customer_daily', 7, $customerId); | |
| 108 | + $customerDailyLimit = apply_filters('fluent_cart/stripe/setup_intent_rate_limit_customer_daily', 5, $customerId); | |
| 109 | 109 | $customerDailyKey = 'fct_stripe_setup_intent_rate_daily_' . md5($customerId); |
| 110 | 110 | $customerDailyAttempts = get_transient($customerDailyKey) ?: 0; |
| 111 | 111 | return $customerDailyLimit - $customerDailyAttempts; |
| 112 | 112 | } |