|
...
|
...
|
@@ -147,6 +147,7 @@ class PayStripeApi |
|
|
|
public static function handleWebhook()
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(11111, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// Webhook 签名密钥(从 Stripe 仪表盘获取)
|
|
|
|
$endpointSecret = 'whsec_garhW2TrCIrduyM3rve9mFS2sn69B9Yt';
|
|
|
|
// 获取原始请求内容
|
|
...
|
...
|
@@ -169,7 +170,6 @@ class PayStripeApi |
|
|
|
// 获取事件类型
|
|
|
|
$eventType = $event['type'];
|
|
|
|
$eventData = $event['data']['object'];
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($eventType, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// 根据事件类型处理
|
|
|
|
switch ($eventType) {
|
|
|
|
case 'payment_intent.succeeded':
|
...
|
...
|
|