static function _init()
 {
     //load abstract class
     st()->load_libs(array('abstract/class-abstract-payment-gateway'));
     //Load default gateways
     self::_load_default_gateways();
     self::$_payment_gateways = array('st_submit_form' => new STGatewaySubmitform(), 'st_paypal' => new STGatewayPaypal());
     add_action('init', array(__CLASS__, '_do_add_gateway_options'));
 }
示例#2
0
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Room Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('hotel_room'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Hotel', ST_TEXTDOMAIN), 'id' => 'room_parent', 'type' => 'post_select_ajax', 'desc' => __('Choose the hotel that the room belongs to', ST_TEXTDOMAIN), 'post_type' => 'st_hotel', 'placeholder' => __('Search for a Hotel', ST_TEXTDOMAIN)), array('label' => __('Number of Rooms', ST_TEXTDOMAIN), 'id' => 'number_room', 'type' => 'text', 'desc' => __('Number of rooms available for booking', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('hotel_room')), array('label' => __('Room Price', ST_TEXTDOMAIN), 'id' => 'room_price_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Per night', ST_TEXTDOMAIN)), array('label' => __('Extra Price', ST_TEXTDOMAIN), 'id' => 'extra_price', 'type' => 'list-item', 'settings' => array(array('id' => 'extra_name', 'type' => 'text', 'std' => 'extra_', 'label' => __('Name of Item', ST_TEXTDOMAIN)), array('id' => 'extra_max_number', 'type' => 'text', 'std' => '', 'label' => __('Max of Number', ST_TEXTDOMAIN)), array('id' => 'extra_price', 'type' => 'text', 'std' => '', 'label' => __('Price', ST_TEXTDOMAIN), 'desc' => __('per 1 Item', ST_TEXTDOMAIN)))), array('label' => __('Discount Rate', ST_TEXTDOMAIN), 'id' => 'discount_rate', 'type' => 'text', 'desc' => __('Discount by %', ST_TEXTDOMAIN)), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Room Facility', ST_TEXTDOMAIN), 'id' => 'room_detail_tab', 'type' => 'tab'), array('label' => __('No. adults', ST_TEXTDOMAIN), 'id' => 'adult_number', 'type' => 'text', 'desc' => __('Number of Adults in room', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('No. children', ST_TEXTDOMAIN), 'id' => 'children_number', 'type' => 'text', 'desc' => __('Number of Children in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('No. beds', ST_TEXTDOMAIN), 'id' => 'bed_number', 'type' => 'text', 'desc' => __('Number of Beds in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'desc' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'id' => 'room_footage', 'type' => 'text'), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_room_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('label' => __('Other facility', ST_TEXTDOMAIN), 'id' => 'other_facility', 'type' => 'tab'), array('label' => __('Add a facility', ST_TEXTDOMAIN), 'id' => 'add_new_facility', 'type' => 'list-item', 'settings' => array(array('id' => 'facility_value', 'type' => 'text', 'std' => '', 'label' => __('Value', ST_TEXTDOMAIN)), array('id' => 'facility_icon', 'type' => 'text', 'std' => '', 'label' => __('Icon', ST_TEXTDOMAIN), 'desc' => __('Support: fonticon <code>(eg: fa-facebook)</code>', ST_TEXTDOMAIN)))), array('label' => __('Description', ST_TEXTDOMAIN), 'id' => 'room_description', 'type' => 'textarea', 'std' => ''), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __("Default State", ST_TEXTDOMAIN), 'id' => 'default_state', 'type' => 'select', 'choices' => array(array('value' => "available", 'label' => __("Available", ST_TEXTDOMAIN)), array('value' => "not_available", 'label' => __("Not Available", ST_TEXTDOMAIN)))), array('label' => __('Hotel Calendar', ST_TEXTDOMAIN), 'id' => 'st_hotel_calendar', 'type' => 'st_hotel_calendar')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     parent::register_metabox($this->metabox);
 }
        echo TravelHelper::format_money_raw($price, $currency);
        ?>
                            </td>
                            <td class="post-title page-title column-title">
                                <?php 
        echo date(get_option('date_format'), strtotime($value->post_date));
        ?>
                            </td>
                            <td class="post-title page-title column-title">
                                <?php 
        echo get_post_meta($order_id, 'status', true);
        ?>
                            </td>
                            <td class="post-title page-title column-title">
                                <?php 
        echo STPaymentGateways::get_gatewayname(get_post_meta($order_id, 'payment_method', true));
        ?>
                            </td>
                        </tr>
                    <?php 
    }
}
?>
        </tbody>
    </table>
    <div class="tablenav bottom">
        <div class="tablenav-pages">
            <span class="displaying-num"><?php 
echo sprintf(_n('%s item', '%s items', $data['total']), $data['total'], ST_TEXTDOMAIN);
?>
</span>
 /**
  *
  * @since 1.0.9
  * */
 function _add_metabox()
 {
     $this->metabox[] = array('id' => 'st_location', 'title' => __('Rental Details', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_rental'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Rental Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Rental Address ', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Rental Information', ST_TEXTDOMAIN), 'id' => 'detail_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('id' => 'rental_number', 'label' => __('Numbers', ST_TEXTDOMAIN), 'desc' => __('Number of rental available for booking', ST_TEXTDOMAIN), 'type' => 'text', 'std' => '1'), array('id' => 'rental_max_adult', 'label' => __('Max Adults', ST_TEXTDOMAIN), 'desc' => __('Max Adults', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'std' => 1), array('id' => 'rental_max_children', 'label' => __('Max Children', ST_TEXTDOMAIN), 'desc' => __('Max Children', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'std' => 1), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'custom_layout', 'post_type' => 'st_layouts', 'type' => 'select', 'choices' => st_get_layout('st_rental')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery', 'desc' => __('Rental Gallery', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Youtube or Video url', ST_TEXTDOMAIN)), array('label' => __('Agent Information', ST_TEXTDOMAIN), 'id' => 'agent_tab', 'type' => 'tab'), array('label' => __('Agent Email', ST_TEXTDOMAIN), 'id' => 'agent_email', 'type' => 'text', 'desc' => __('Agent Email. This email will receive emails notifying new booking', ST_TEXTDOMAIN)), array('label' => __('Agent Website', ST_TEXTDOMAIN), 'id' => 'agent_website', 'type' => 'text', 'desc' => __('Agent Website', ST_TEXTDOMAIN)), array('label' => __('Agent Phone', ST_TEXTDOMAIN), 'id' => 'agent_phone', 'type' => 'text', 'desc' => __('Agent Phone', ST_TEXTDOMAIN)), array('label' => __('Rental Price', ST_TEXTDOMAIN), 'id' => 'price_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Regular Price', ST_TEXTDOMAIN)), array('label' => __('Extra Price', ST_TEXTDOMAIN), 'id' => 'extra_price', 'type' => 'list-item', 'settings' => array(array('id' => 'extra_name', 'type' => 'text', 'std' => 'extra_', 'label' => __('Name of Item', ST_TEXTDOMAIN)), array('id' => 'extra_max_number', 'type' => 'text', 'std' => '', 'label' => __('Max of Number', ST_TEXTDOMAIN)), array('id' => 'extra_price', 'type' => 'text', 'std' => '', 'label' => __('Price', ST_TEXTDOMAIN), 'desc' => __('per 1 Item', ST_TEXTDOMAIN)))), array('label' => __('Discount Rate', ST_TEXTDOMAIN), 'id' => 'discount_rate', 'type' => 'text', 'desc' => __('Discount Rate By %', ST_TEXTDOMAIN)), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __('Rental Calendar', ST_TEXTDOMAIN), 'id' => 'st_rental_calendar', 'type' => 'st_rental_calendar'), array('label' => __('Rental Option', ST_TEXTDOMAIN), 'id' => 'rental_options', 'type' => 'tab'), array('label' => __('Minimum days to book before arrival', ST_TEXTDOMAIN), 'id' => 'rentals_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), array('label' => __('Rental external booking', ST_TEXTDOMAIN), 'id' => 'st_rental_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Rental external booking link', ST_TEXTDOMAIN), 'id' => 'st_rental_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_rental_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>")));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = self::get_custom_fields();
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
        static function gateway_success_page_validate($id = false)
        {
            $all = self::get_payment_gateways();
            if (isset($all[$id])) {
                $value = $all[$id];
                if (method_exists($value, 'get_name')) {
                    return $value->success_page_validate();
                }
            } else {
                STTemplate::set_message(__('Sorry! Your Payment Gateway is not valid', ST_TEXTDOMAIN), 'danger');
            }
        }
        static function _load_default_gateways()
        {
            $path = STTraveler::dir('gateways');
            $results = scandir($path);
            foreach ($results as $result) {
                if ($result === '.' or $result === '..') {
                    continue;
                }
                if (is_dir($path . '/' . $result)) {
                    $file = $path . '/' . $result . '/' . $result . '.php';
                    if (file_exists($file)) {
                        include_once $file;
                    }
                }
            }
        }
    }
    STPaymentGateways::_init();
}
示例#6
0
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     $this->metabox[] = array('id' => 'cars_metabox', 'title' => __('Cars Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_cars'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Car Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'cars_address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Car Details', ST_TEXTDOMAIN), 'id' => 'room_car_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Detail Car Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Car Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_cars')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Equipment Price List', ST_TEXTDOMAIN), 'desc' => __('Equipment Price List', ST_TEXTDOMAIN), 'id' => 'cars_equipment_list', 'type' => 'list-item', 'settings' => array(array('id' => 'cars_equipment_list_price', 'label' => __('Price', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'price_unit', 'label' => __('Price Unit', ST_TEXTDOMAIN), 'desc' => __('You can choose <code>Fixed Price</code>, <code>Price per Hour</code>, <code>Price per Day</code>', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Fixed Price', ST_TEXTDOMAIN)), array('value' => 'per_hour', 'label' => __('Price per Hour', ST_TEXTDOMAIN)), array('value' => 'per_day', 'label' => __('Price per Day', ST_TEXTDOMAIN)))), array('id' => 'cars_equipment_list_price_max', 'label' => __('Price Max', ST_TEXTDOMAIN), 'type' => 'text', 'condition' => 'price_unit:not()'))), array('label' => __('Features', ST_TEXTDOMAIN), 'desc' => __('Features', ST_TEXTDOMAIN), 'id' => 'cars_equipment_info', 'type' => 'list-item', 'settings' => array(array('id' => 'cars_equipment_taxonomy_id', 'label' => __('Taxonomy', ST_TEXTDOMAIN), 'type' => 'select', 'operator' => 'and', 'choices' => self::$data_term), array('id' => 'cars_equipment_taxonomy_info', 'label' => __('Taxonomy Info', ST_TEXTDOMAIN), 'type' => 'text'))), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Contact Details', ST_TEXTDOMAIN), 'id' => 'room_contact_tab', 'type' => 'tab'), array('label' => __('Logo', ST_TEXTDOMAIN), 'id' => 'cars_logo', 'type' => 'upload', 'desc' => __('Logo', ST_TEXTDOMAIN)), array('label' => __('Car manufacturer name', ST_TEXTDOMAIN), 'id' => 'cars_name', 'type' => 'text', 'desc' => __('Car manufacturer name', ST_TEXTDOMAIN)), array('label' => __('Email', ST_TEXTDOMAIN), 'id' => 'cars_email', 'type' => 'text', 'desc' => __('E-mail Car Agent, this address will received email when have new booking', ST_TEXTDOMAIN)), array('label' => __('Phone', ST_TEXTDOMAIN), 'id' => 'cars_phone', 'type' => 'text', 'desc' => __('Phone', ST_TEXTDOMAIN)), array('label' => __('About', ST_TEXTDOMAIN), 'desc' => __('About', ST_TEXTDOMAIN), 'id' => 'cars_about', 'type' => 'textarea'), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => '_price_car_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'cars_price', 'type' => 'text', 'desc' => __('Price', ST_TEXTDOMAIN)), array('label' => __('Custom Price', ST_TEXTDOMAIN), 'id' => 'is_custom_price', 'std' => 'off', 'type' => 'select', 'choices' => array(array('value' => 'price_by_number', 'label' => __('Price by number of day|hour', ST_TEXTDOMAIN)), array('value' => 'price_by_date', 'label' => __('Price by Date', ST_TEXTDOMAIN)))), array('label' => __("Price by Date", ST_TEXTDOMAIN), 'id' => 'st_custom_price_by_date', 'type' => 'st_custom_price', 'desc' => __('Price by Date', ST_TEXTDOMAIN), 'condition' => 'is_custom_price:is(price_by_date)'), array('label' => __("Price by number of day/hour", ST_TEXTDOMAIN), 'id' => 'price_by_number_of_day_hour', 'desc' => __('Price by number of day/hour', ST_TEXTDOMAIN), 'type' => 'list-item', 'condition' => 'is_custom_price:is(price_by_number)', 'settings' => array(array('id' => 'number_start', 'label' => __('Number Start', ST_TEXTDOMAIN), 'type' => 'text', 'operator' => 'and'), array('id' => 'number_end', 'label' => __('Number End', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'price', 'label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'type' => 'text'))), array('label' => __('Discount', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'text', 'desc' => __('%', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Number of car for Rent', ST_TEXTDOMAIN), 'desc' => __('Number of car for Rent', ST_TEXTDOMAIN), 'id' => 'number_car', 'type' => 'text', 'std' => 1), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Car Options', ST_TEXTDOMAIN), 'id' => 'cars_options', 'type' => 'tab'), array('label' => __('Minimum days to book before rental', ST_TEXTDOMAIN), 'id' => 'cars_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), st()->get_option('cars_price_unit', 'day') == 'day' ? array('label' => __('Minimum days to book', ST_TEXTDOMAIN), 'id' => 'cars_booking_min_day', 'type' => 'numeric-slider', 'min_max_step' => '0,7,1', 'std' => 0, 'desc' => __('Minimum days to book', ST_TEXTDOMAIN)) : array('label' => __('Minimum hours to book', ST_TEXTDOMAIN), 'id' => 'cars_booking_min_hour', 'type' => 'numeric-slider', 'min_max_step' => '0,168,1', 'std' => 0, 'desc' => __('Minimum hours to book', ST_TEXTDOMAIN)), array('label' => __('Car external booking', ST_TEXTDOMAIN), 'id' => 'st_car_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Car external booking link', ST_TEXTDOMAIN), 'id' => 'st_car_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_car_external_booking:is(on)', 'desc' => "<i>" . __("Must be http://") . "</i>")));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('st_cars_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *
  *
  * @since 1.1.1
  * @update 1.1.2
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Holiday Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_holidays'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Holiday Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Holiday Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_holidays')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'desc' => __('Select images for holiday', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Contact email addresses', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email addresses', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Adult', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,0.5'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Children', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,0.5'))), array('label' => __('Infant Price', ST_TEXTDOMAIN), 'id' => 'infant_price', 'type' => 'text', 'desc' => __('Price per Infant', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Discount by percent', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'desc' => __('Discount of this holiday, by percent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Start Date', ST_TEXTDOMAIN), 'desc' => __('Sale Start Date', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale End Date', ST_TEXTDOMAIN), 'desc' => __('Sale End Date', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Information', ST_TEXTDOMAIN), 'id' => 'st_info_holidays_tab', 'type' => 'tab'), array('label' => __('Holiday Type', ST_TEXTDOMAIN), 'id' => 'type_holiday', 'type' => 'select', 'desc' => __('Holiday Type', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'daily_holiday', 'label' => __('Daily Holiday', ST_TEXTDOMAIN)), array('value' => 'specific_date', 'label' => __('Specific Date', ST_TEXTDOMAIN)))), array('label' => __('Duration', ST_TEXTDOMAIN), 'id' => 'duration_day', 'type' => 'text', 'desc' => __('Duration', ST_TEXTDOMAIN), 'std' => '1', 'condition' => 'type_holiday:is(daily_holiday)'), array('label' => __('Duration unit', ST_TEXTDOMAIN), 'id' => 'duration_unit', 'type' => 'select', 'desc' => __('Select your duration unit', ST_TEXTDOMAIN), 'std' => __('day', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'day', 'label' => __('Days', ST_TEXTDOMAIN)), array('value' => 'hour', 'label' => __('Hours', ST_TEXTDOMAIN)), array('value' => 'week', 'label' => __('Weeks', ST_TEXTDOMAIN)), array('value' => 'month', 'label' => __('Months', ST_TEXTDOMAIN))), 'condition' => 'type_holiday:is(daily_holiday)'), array('label' => __('Minimum days to book before departure', ST_TEXTDOMAIN), 'desc' => __('Minimum days to book before departure', ST_TEXTDOMAIN), 'id' => 'holidays_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0), array('label' => __('Holiday external booking', ST_TEXTDOMAIN), 'id' => 'st_holiday_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Holiday external booking link ', ST_TEXTDOMAIN), 'id' => 'st_holiday_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_holiday_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('label' => __('Max No. People', ST_TEXTDOMAIN), 'id' => 'max_people', 'type' => 'text', 'desc' => __('Max No. People', ST_TEXTDOMAIN), 'std' => '1'), array('id' => 'holidays_program', 'label' => __("Holiday program", ST_TEXTDOMAIN), 'type' => 'list-item', 'settings' => array(array('id' => 'desc', 'label' => __('Description', ST_TEXTDOMAIN), 'type' => 'textarea', 'rows' => '5'))), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __('Holiday Calendar', ST_TEXTDOMAIN), 'id' => 'st_holiday_calendar', 'type' => 'st_holiday_calendar')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('holidays_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
示例#8
0
?>
 <small><?php 
st_the_language('password_will_be_send_to_your_email');
?>
</small>
        </label>
    </div>
    <div class="checkbox">
        <label>
            <input class="i-check" value="1" name="term_condition" type="checkbox" <?php 
if (STInput::post('term_condition') == 1) {
    echo 'checked';
}
?>
/><?php 
echo st_get_language('i_have_read_and_accept_the') . '<a target="_blank" href="' . get_the_permalink(st()->get_option('page_terms_conditions')) . '"> ' . st_get_language('terms_and_conditions') . '</a>';
?>
        </label>
    </div>
    <div class="alert form_alert hidden"></div>
    <div class="payment_gateways">
        <input type="hidden" name="st_payment_gateway" value="1"/>
        <?php 
if (!isset($post_id)) {
    $post_id = false;
}
STPaymentGateways::get_payment_gateways_html($post_id);
?>
    </div>
    
示例#9
0
    echo 'checked';
}
?>
/><?php 
printf(__('Create %s account ', ST_TEXTDOMAIN), get_bloginfo('title'));
?>
 <small><?php 
st_the_language('password_will_be_send_to_your_email');
?>
</small>
        </label>
    </div>
    <div class="checkbox">
        <label>
            <input class="i-check" value="1" name="term_condition" type="checkbox" <?php 
if (STInput::post('term_condition') == 1) {
    echo 'checked';
}
?>
/><?php 
echo st_get_language('i_have_read_and_accept_the') . '<a target="_blank" href="' . get_the_permalink(st()->get_option('page_terms_conditions')) . '"> ' . st_get_language('terms_and_conditions') . '</a>';
?>
        </label>
    </div>
    <div class="alert form_alert hidden"></div>
    <div class="payment_gateways">
        <?php 
STPaymentGateways::get_payment_gateways_html();
?>
    </div>
示例#10
0
 static function booking_form_submit($item_id = '')
 {
     if (STInput::post('st_payment_gateway') and wp_verify_nonce(STInput::post('travel_order'), 'submit_form_order')) {
         $first_item_id = self::get_booking_id();
         // All gateway available
         $gateways = STPaymentGateways::get_payment_gateways();
         if (empty($gateways)) {
             return array('status' => false, 'message' => __('Sorry! No payment gateway available', ST_TEXTDOMAIN));
         }
         $payment_gateway_used = false;
         $payment_gateway_id = false;
         if (!empty($gateways)) {
             foreach ($gateways as $key => $value) {
                 if (STInput::post('st_payment_gateway_' . $key)) {
                     $payment_gateway_id = $key;
                     $payment_gateway_used = STPaymentGateways::get_gateway($payment_gateway_id, $first_item_id);
                 }
             }
         }
         if (!$payment_gateway_id or !$payment_gateway_used) {
             $payment_gateway_name = apply_filters('st_payment_gateway_' . $payment_gateway_id . '_name', $payment_gateway_id);
             return array('status' => false, 'message' => sprintf(__('Sorry! Payment Gateway: <code>%s</code> is not available for this item!', ST_TEXTDOMAIN), $payment_gateway_name));
         }
         // Action before submit form
         do_action('st_before_form_submit_run');
         $form_validate = true;
         if (!self::check_cart()) {
             return array('status' => false, 'message' => __('Your cart is currently empty.', ST_TEXTDOMAIN), 'code' => '1');
         }
         if ($coupon_code = STInput::request('coupon_code')) {
             $status = self::do_apply_coupon($coupon_code);
             if (!$status['status']) {
                 return array('status' => false, 'message' => $status['message']);
             }
         }
         if (st()->get_option('booking_enable_captcha', 'on') == 'on') {
             $st_security_key = STInput::request('st_security_key');
             $allow_captcha = STInput::request('allow_capcha', 'off');
             if ($allow_captcha == 'off') {
                 if (!$st_security_key) {
                     return array('status' => false, 'message' => __('You dose not enter the captcha', ST_TEXTDOMAIN));
                 }
                 $valid = STCoolCaptcha::validate_captcha($st_security_key);
                 if (!$valid) {
                     return array('status' => false, 'message' => __('Captcha is not correct', ST_TEXTDOMAIN), 'error_code' => 'invalid_captcha');
                 }
             }
         }
         $default = array('st_note' => '', 'term_condition' => '', 'create_account' => false, 'paypal_checkout' => false);
         extract(wp_parse_args($_POST, $default));
         //Term and condition
         if (!$term_condition) {
             return array('status' => false, 'message' => __('Please accept our terms and conditions', ST_TEXTDOMAIN));
         }
         $form_validate = self::validate_checkout_fields();
         if ($form_validate) {
             $form_validate = $payment_gateway_used->_pre_checkout_validate();
         }
         if (!$form_validate) {
             $message = array('status' => false, 'message' => STTemplate::get_message_content(), 'form_validate' => 'false');
             STTemplate::clear();
             return $message;
         }
         $post = array('post_title' => __('Order', ST_TEXTDOMAIN) . ' - ' . date(get_option('date_format')) . ' @ ' . date(get_option('time_format')), 'post_type' => 'st_order', 'post_status' => 'publish');
         $data_price = STPrice::getDataPrice();
         //save the order
         $insert_post = wp_insert_post($post);
         if ($insert_post) {
             $cart = self::get_items();
             $fields = self::get_checkout_fields();
             if (!empty($fields)) {
                 foreach ($fields as $key => $value) {
                     update_post_meta($insert_post, $key, STInput::post($key));
                 }
             }
             update_post_meta($insert_post, 'st_tax', STPrice::getTax());
             update_post_meta($insert_post, 'st_tax_percent', STPrice::getTax());
             update_post_meta($insert_post, 'st_is_tax_included_listing_page', STCart::is_tax_included_listing_page() ? 'on' : 'off');
             update_post_meta($insert_post, 'currency', TravelHelper::get_current_currency('symbol'));
             update_post_meta($insert_post, 'currency_rate', TravelHelper::get_current_currency('rate'));
             update_post_meta($insert_post, 'coupon_code', STCart::get_coupon_code());
             update_post_meta($insert_post, 'coupon_amount', STCart::get_coupon_amount());
             update_post_meta($insert_post, 'status', 'pending');
             update_post_meta($insert_post, 'st_cart_info', $cart);
             update_post_meta($insert_post, 'total_price', STPrice::getTotal());
             update_post_meta($insert_post, 'ip_address', STInput::ip_address());
             update_post_meta($insert_post, 'order_token_code', wp_hash($insert_post));
             update_post_meta($insert_post, 'data_prices', $data_price);
             update_post_meta($insert_post, 'booking_by', STInput::post('booking_by', ''));
             self::saveOrderItems($insert_post);
             if (!is_user_logged_in()) {
                 $user_name = STInput::post('st_email');
                 $user_id = username_exists($user_name);
                 //Now Create Account if user agree
                 if ($create_account) {
                     if (!$user_id and email_exists($user_name) == false) {
                         $random_password = wp_generate_password($length = 12, $include_standard_special_chars = false);
                         $userdata = array('user_login' => $user_name, 'user_pass' => $random_password, 'user_email' => $user_name, 'first_name' => STInput::post('st_first_name'), 'last_name' => STInput::post('st_last_name'));
                         $user_id = wp_insert_user($userdata);
                         //Create User Success, send the nofitication
                         wp_new_user_notification($user_id);
                     }
                 }
             } else {
                 $user_id = get_current_user_id();
             }
             if ($user_id) {
                 //Now Update the Post Meta
                 update_post_meta($insert_post, 'id_user', $user_id);
                 //Update User Meta
                 update_user_meta($user_id, 'st_phone', STInput::post('st_phone'));
                 update_user_meta($user_id, 'first_name', STInput::post('st_first_name'));
                 update_user_meta($user_id, 'last_name', STInput::post('st_last_name'));
                 update_user_meta($user_id, 'st_address', STInput::post('st_address'));
                 update_user_meta($user_id, 'st_address2', STInput::post('st_address2'));
                 update_user_meta($user_id, 'st_city', STInput::post('st_city'));
                 update_user_meta($user_id, 'st_province', STInput::post('st_province'));
                 update_user_meta($user_id, 'st_zip_code', STInput::post('st_zip_code'));
                 update_user_meta($user_id, 'st_country', STInput::post('st_country'));
             }
             update_post_meta($insert_post, 'payment_method', $payment_gateway_id);
             do_action('st_booking_success', $insert_post);
             // Now gateway do the rest
             return $payment_gateway_used->do_checkout($insert_post);
         } else {
             return array('status' => false, 'message' => __('Can not save order.', ST_TEXTDOMAIN));
         }
     }
 }
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Activity Setting', ST_TEXTDOMAIN), 'pages' => array('st_activity'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Tour Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text'), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Tour Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_activity')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Contact email address', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email address', ST_TEXTDOMAIN)), array('label' => __('Website', ST_TEXTDOMAIN), 'id' => 'contact_web', 'type' => 'text', 'desc' => __('Website', ST_TEXTDOMAIN)), array('label' => __('Phone', ST_TEXTDOMAIN), 'id' => 'contact_phone', 'type' => 'text', 'desc' => __('Phone', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Info setting', ST_TEXTDOMAIN), 'id' => 'activity_time_number_tab', 'type' => 'tab'), array('label' => __('Activity Type', ST_TEXTDOMAIN), 'id' => 'type_activity', 'type' => 'select', 'desc' => __('Activity Type', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'specific_date', 'label' => __('Specific Date', ST_TEXTDOMAIN)), array('value' => 'daily_activity', 'label' => __('Daily Activity', ST_TEXTDOMAIN)))), array('label' => __('Check In', ST_TEXTDOMAIN), 'id' => 'check_in', 'type' => 'date_picker', 'condition' => 'type_activity:is(specific_date)', 'desc' => __('Check In', ST_TEXTDOMAIN)), array('label' => __('Check Out', ST_TEXTDOMAIN), 'id' => 'check_out', 'type' => 'date_picker', 'condition' => 'type_activity:is(specific_date)', 'desc' => __('Check Out', ST_TEXTDOMAIN)), array('label' => __('Duration', ST_TEXTDOMAIN), 'id' => 'duration', 'type' => 'text', 'condition' => 'type_activity:is(daily_activity)', 'desc' => __('The total time to take each activity package', ST_TEXTDOMAIN)), array('label' => __('Booking Period', ST_TEXTDOMAIN), 'id' => 'activity_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'condition' => 'type_activity:is(daily_activity)', 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), array('label' => __('Activity Time', ST_TEXTDOMAIN), 'id' => 'activity-time', 'type' => 'text', 'desc' => __('The departure time of an activity', ST_TEXTDOMAIN)), array('label' => __('Max number of people', ST_TEXTDOMAIN), 'id' => 'max_people', 'type' => 'text', 'desc' => __('Max number of people', ST_TEXTDOMAIN), 'std' => '1'), array('label' => __('Venue Facilities', ST_TEXTDOMAIN), 'id' => 'venue-facilities', 'type' => 'text', 'desc' => __('The facilities that customer may experience during activities', ST_TEXTDOMAIN)), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Adult', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Children', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Infant Price', ST_TEXTDOMAIN), 'id' => 'infant_price', 'type' => 'text', 'desc' => __('Price per Infant', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Discount', ST_TEXTDOMAIN), 'desc' => __('Discount', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Best Price Guarantee', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Best Price Guarantee Text', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee-text', 'type' => 'textarea', 'rows' => '2', 'condition' => 'best-price-guarantee:is(on)'), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_activity_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('st_activity_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 */
$order_code = STInput::get('order_code');
$order_token_code = STInput::get('order_token_code');
if ($order_token_code) {
    $order_code = STOrder::get_order_id_by_token($order_token_code);
}
$user_id = get_current_user_id();
if (!$order_code or get_post_type($order_code) != 'st_order') {
    wp_redirect(home_url('/'));
    exit;
}
$gateway = get_post_meta($order_code, 'payment_method', true);
get_header();
?>
    <div class="gap"></div>
    <div class="container">

<?php 
// Booking Content
$is_show_infomation_allow = STPaymentGateways::gateway_success_page_validate($gateway);
if ($is_show_infomation_allow) {
    echo STTemplate::message();
    echo st()->load_template('booking_infomation', null, array('order_code' => $order_code));
} else {
    echo STTemplate::message();
}
?>

    </div>
<?php 
get_footer();