Added additional debugging for Stripe Checkout

This commit is contained in:
Ruben Ramirez 2025-04-04 02:21:02 -05:00
parent 4e09966bba
commit 20fdf3e3b4

View file

@ -225,6 +225,7 @@ add_action( 'wp_ajax_send_job_invite', 'quiztech_ajax_send_job_invite' );
function quiztech_handle_credit_purchase_submission() {
// Only process if our action is set and we are on the frontend
if ( ! isset( $_POST['quiztech_action'] ) || $_POST['quiztech_action'] !== 'initiate_credit_purchase' || is_admin() ) {
log_to_file("Stripe - quiztech_action unset or is_admin");
return;
}
@ -232,6 +233,7 @@ function quiztech_handle_credit_purchase_submission() {
$manage_credits_page = get_page_by_path('manage-credits'); // Assumes page slug is 'manage-credits'
if (!$manage_credits_page) {
// Fallback or error if page doesn't exist
log_to_file("Stripe - manage credits page does not exist");
wp_die(esc_html__('Manage Credits page not found. Cannot process purchase.', 'quiztech'));
exit;
}