正在显示
1 个修改的文件
包含
1 行增加
和
4 行删除
| @@ -147,7 +147,6 @@ class PayStripeApi | @@ -147,7 +147,6 @@ class PayStripeApi | ||
| 147 | public static function handleWebhook() | 147 | public static function handleWebhook() |
| 148 | { | 148 | { |
| 149 | try { | 149 | try { |
| 150 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export(11111, true) . PHP_EOL, FILE_APPEND); | ||
| 151 | // Webhook 签名密钥(从 Stripe 仪表盘获取) | 150 | // Webhook 签名密钥(从 Stripe 仪表盘获取) |
| 152 | $endpointSecret = 'whsec_garhW2TrCIrduyM3rve9mFS2sn69B9Yt'; | 151 | $endpointSecret = 'whsec_garhW2TrCIrduyM3rve9mFS2sn69B9Yt'; |
| 153 | // 获取原始请求内容 | 152 | // 获取原始请求内容 |
| @@ -173,14 +172,12 @@ class PayStripeApi | @@ -173,14 +172,12 @@ class PayStripeApi | ||
| 173 | // 根据事件类型处理 | 172 | // 根据事件类型处理 |
| 174 | switch ($eventType) { | 173 | switch ($eventType) { |
| 175 | case 'payment_intent.succeeded': | 174 | case 'payment_intent.succeeded': |
| 176 | - @file_put_contents(storage_path('logs/lyh_3059_error.log'), var_export('success', true) . PHP_EOL, FILE_APPEND); | ||
| 177 | // 处理支付成功逻辑 | 175 | // 处理支付成功逻辑 |
| 178 | $paymentIntentId = $eventData['id']; | 176 | $paymentIntentId = $eventData['id']; |
| 179 | self::getExtensionInfo($paymentIntentId,$eventData); | 177 | self::getExtensionInfo($paymentIntentId,$eventData); |
| 180 | break; | 178 | break; |
| 181 | case 'payment_intent.payment_failed': | 179 | case 'payment_intent.payment_failed': |
| 182 | // 处理支付失败逻辑 | 180 | // 处理支付失败逻辑 |
| 183 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($eventData, true) . PHP_EOL, FILE_APPEND); | ||
| 184 | $error = $eventData['last_payment_error']; | 181 | $error = $eventData['last_payment_error']; |
| 185 | break; | 182 | break; |
| 186 | case 'charge.refunded': | 183 | case 'charge.refunded': |
| @@ -190,7 +187,7 @@ class PayStripeApi | @@ -190,7 +187,7 @@ class PayStripeApi | ||
| 190 | default: | 187 | default: |
| 191 | throw new \Exception('Unhandled event type: ' . $eventType); | 188 | throw new \Exception('Unhandled event type: ' . $eventType); |
| 192 | } | 189 | } |
| 193 | - return $event; | 190 | + return 1; |
| 194 | } catch (Exception $e) { | 191 | } catch (Exception $e) { |
| 195 | throw new \Exception('Webhook Error: ' . $e->getMessage()); | 192 | throw new \Exception('Webhook Error: ' . $e->getMessage()); |
| 196 | } | 193 | } |
-
请 注册 或 登录 后发表评论