// ... (código anterior de la función process_booking hasta la creación del $body) ... if ( ! empty( $stripe_secret ) && $total_price > 0 ) { $amount_cents = round( $total_price * 100 ); $return_url = add_query_arg( [ 'afr_status' => 'complete', 'booking_id' => $booking_id, 'session_id' => '{CHECKOUT_SESSION_ID}' ], $return_url ); // 🔥 EL CAMBIO CLAVE PARA APPLE PAY Y GOOGLE PAY 🔥 $body = [ 'ui_mode' => 'embedded', 'mode' => 'payment', 'return_url' => $return_url, 'automatic_payment_methods[enabled]' => 'true', // <--- Autodetecta tarjetas y billeteras 'line_items[0][price_data][currency]' => 'usd', 'line_items[0][price_data][product_data][name]' => 'Booking #' . $booking_id . ' - ' . (isset($variants_meta[$selected_variant_index]) ? $variants_meta[$selected_variant_index]['name'] : 'Tour'), 'line_items[0][price_data][unit_amount]'=> $amount_cents, 'line_items[0][quantity]' => 1, 'customer_email' => $customer_email, 'metadata[booking_id]' => $booking_id, ]; $response = wp_remote_post( 'https://api.stripe.com/v1/checkout/sessions', [ 'headers' => [ 'Authorization' => 'Bearer ' . $stripe_secret, 'Content-Type' => 'application/x-www-form-urlencoded', ], 'body' => $body, 'timeout' => 30, ]); // ... (el resto del manejo de la respuesta de Stripe sigue igual) ...