How we can use strip webhook in drupal. I want to update transaction detail of an order and strip suggest me use webhook. Below the webhook code. I already have installed commerce_strip module
// Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeStripe::setApiKey('sk_test_5BnGdnyXCjwGzvKpKUAEGbkS'); $payload = @file_get_contents('php://input'); $event = null; try { $event = StripeEvent::constructFrom( json_decode($payload, true) ); } catch(\UnexpectedValueException $e) { // Invalid payload http_response_code(400); exit(); } // Handle the event switch ($event->type) { case 'payment_intent.succeeded': $paymentIntent = $event->data->object; // contains a StripePaymentIntent handlePaymentIntentSucceeded($paymentIntent); break; case 'payment_method.attached': $paymentMethod = $event->data->object; // contains a StripePaymentMethod handlePaymentMethodAttached($paymentMethod); break; // ... handle other event types default: echo 'Received unknown event type ' . $event->type; } http_response_code(200);