Trying to get the details of a customer’s chekout session in Laravel. Below is the pertinent code. Cannot find a relevant cause of this error anywhere.
When dd’ing the $checkout_session
variable below, i get the following error:
Invalid string: cs_test_a1...lhMULLaM",; must be at most 66 characters
Code that triggers this:
'success_url' => $YOUR_DOMAIN . '/success?session_id={CHECKOUT_SESSION_ID}",',
'cancel_url' => $YOUR_DOMAIN . 'cancel',
]);
header("HTTP/1.1 303 See Other");
header("Location: " . $checkout_session->url);
}
// Successful payment
public function stripe_checkout_success(Request $request) {
$stripe = new StripeStripeClient(env('STRIPE_API_KEY'));
Stripe::setApiKey(env('STRIPE_API_KEY'));
$session_id = $request->get('session_id');
$checkout_session = StripeCheckoutSession::retrieve($session_id);