条纹webhook handle_checkout_session未定义

时间:2019-12-17 13:23:22

标签: php stripe-payments

我正在尝试为条纹支付设置一个Webhook,并在进行Webhook测试时返回以下内容:

<br />
<b>Fatal error</b>: Uncaught Error: Call to undefined function handle_checkout_session() in C:\webhook.php:38
Stack trace:
#0 {main}
thrown in <b>C:\webhook.php</b> on line <b>38</b><br />

我不确定是否是因为我没有包括正确的文件或因为此功能已过时,但是现在我包括了这些文件:

vendor/autoload.php
vendor/stripe/stripe-php/init.php

这是发生错误的地方:

switch ($event->type){
  case 'checkout.session.completed':
    $session = $event->data->object;

    // Fulfill the purchase...
    handle_checkout_session($session); // error occurs here (ln 38)
  break;
  default:
    // Unexpected event type
    http_response_code(400);
    exit();
}

0 个答案:

没有答案