/** * * * @update 1.1.1 * */ function do_checkout($order_id) { update_post_meta($order_id, 'status', 'pending'); $order_token = get_post_meta($order_id, 'order_token_code', true); //Destroy cart on success STCart::destroy_cart(); $booking_success = STCart::get_success_link(); do_action('st_email_after_booking', $order_id); do_action('st_booking_submit_form_success', $order_id); if ($order_token) { $array = array('order_token_code' => $order_token); } else { $array = array('order_code' => $order_id); } return array('status' => true, 'redirect' => add_query_arg($array, $booking_success)); }
function do_checkout($order_id) { update_post_meta($order_id, 'status', 'incomplete'); $paypal = new STPaypal(); $pp = $paypal->get_authorize_url($order_id); if (isset($pp['redirect_url']) and $pp['redirect_url']) { $pp_link = $pp['redirect_url']; } do_action('st_before_redirect_paypal'); if (!isset($pp_link)) { return array('status' => false, 'message' => isset($pp['message']) ? $pp['message'] : false, 'data' => isset($pp['data']) ? $pp['data'] : false); } //Destroy cart on success STCart::destroy_cart(); if (!$pp_link) { return array('status' => false, 'message' => __('Can not get Paypal Authorize URL.', ST_TEXTDOMAIN)); } else { return array('status' => true, 'redirect' => $pp_link); } }