intval($balance_to_pay * 100), // Times by 100 as Stripe expects values in cents 'currency' => $invoice_currency_code, 'description' => $pi_description, 'metadata' => [ 'itflow_client_id' => $client_id, 'itflow_client_name' => $client_name, 'itflow_invoice_number' => $invoice_prefix . $invoice_number, 'itflow_invoice_id' => $invoice_id, ], 'automatic_payment_methods' => [ 'enabled' => true, ], ]); $output = [ 'clientSecret' => $paymentIntent->client_secret, ]; echo json_encode($output); } catch (Error $e) { http_response_code(500); echo json_encode(['error' => $e->getMessage()]); } } if (isset($_GET['get_totp_token'])) { $otp = TokenAuth6238::getTokenCode(strtoupper($_GET['totp_secret'])); echo json_encode($otp); }