calculateOrderAmount($json_obj->items), 'currency' => 'usd', ]); $output = [ 'clientSecret' => $paymentIntent->client_secret, ]; echo json_encode($output); } catch (Error $e) { http_response_code(500); echo json_encode(['error' => $e->getMessage()]); }