/** * Handle subscription cancel request from the user * * @return WPUF_Subscription */ public function user_subscription_cancel() { if (isset($_POST['wpuf_cancel_subscription'])) { if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'wpuf-sub-cancel')) { wp_die(__('Nonce failure', 'dps')); } $user_id = get_current_user_id(); $current_pack = self::get_user_pack($user_id); if ($current_pack['recurring'] == 'yes') { $wpuf_paypal = new WPUF_Paypal(); $wpuf_paypal->recurring_change_status($user_id, 'Cancel'); } else { WPUF_Subscription::init()->update_user_subscription_meta($user_id, 'Cancel'); } wp_redirect($_SERVER['REQUEST_URI']); } }
/** * Instantiate the classes * * @return void */ function instantiate() { new WPUF_Upload(); WPUF_Frontend_Form_Post::init(); // requires for form preview new WPUF_Frontend_Form_Profile(); new WPUF_Payment(); WPUF_Subscription::init(); if (is_admin()) { WPUF_Settings::init(); new WPUF_Admin_Form(); new WPUF_Admin_Posting(); new WPUF_Admin_Posting_Profile(); new WPUF_Updates(); } else { new WPUF_Frontend_Dashboard(); } }
function update_subscription() { global $wpdb; $table = $wpdb->prefix . 'wpuf_subscription'; $results = $wpdb->get_results("SELECT name, description, count, duration, cost FROM {$table}"); if (!$results) { return; } $post_type = WPUF_Subscription::init()->get_all_post_type(); foreach ($results as $key => $result) { $args = array('post_title' => $result->name, 'post_content' => $result->description, 'post_status' => 'publish', 'post_type' => 'wpuf_subscription'); $post_ID = wp_insert_post($args); if ($post_ID) { foreach ($post_type as $key => $name) { $post_type[$key] = $result->count; } $post = array('cost' => $result->cost, 'duration' => $result->duration, 'recurring_pay' => 'no', 'trial_period' => '', 'post_type_name' => $post_type); WPUF_Subscription::init()->update_user_subscription_meta($post_ID, $post); } } $sql = "DROP TABLE IF_EXISTS {$table}"; $wpdb->query($sql); }
function subscription_dropdown($selected = null) { $subscriptions = WPUF_Subscription::init()->get_subscriptions(); if (!$subscriptions) { printf('<option>%s</option>', '- Select -'); return; } printf('<option>%s</option>', '- Select -'); foreach ($subscriptions as $key => $subscription) { ?> <option value="<?php echo esc_attr($subscription->ID); ?> " <?php selected($selected, $subscription->ID); ?> ><?php echo $subscription->post_title; ?> </option> <?php } }
/** * Send payment handler to the gateway * * This function sends the payment handler mechanism to the selected * gateway. If 'paypal' is selected, then a particular action is being * called. A listener function can be invoked for that gateway to handle * the request and send it to the gateway. * * Need to use `wpuf_gateway_{$gateway_name} */ function send_to_gateway() { if (isset($_POST['wpuf_payment_submit']) && $_POST['action'] == 'wpuf_pay' && wp_verify_nonce($_POST['_wpnonce'], 'wpuf_payment_gateway')) { $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; $pack_id = isset($_REQUEST['pack_id']) ? intval($_REQUEST['pack_id']) : 0; $gateway = $_POST['wpuf_payment_method']; $type = $_POST['type']; if (is_user_logged_in()) { $userdata = wp_get_current_user(); } else { $user_id = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0; if ($user_id) { $userdata = get_userdata($user_id); } else { $userdata = new stdClass(); $userdata->ID = 0; $userdata->user_email = ''; $userdata->first_name = ''; $userdata->last_name = ''; } } switch ($type) { case 'post': $post = get_post($post_id); $amount = wpuf_get_option('cost_per_post', 'wpuf_payment'); $item_number = get_post_meta($post_id, '_wpuf_order_id', true); $item_name = $post->post_title; break; case 'pack': $pack = WPUF_Subscription::init()->get_subscription($pack_id); $custom = $pack->meta_value; $amount = $this->coupon_discount($_POST['coupon_code'], $pack->meta_value['billing_amount'], $pack_id); $item_name = $pack->post_title; $item_number = $pack->ID; break; } $payment_vars = array('currency' => wpuf_get_option('currency', 'wpuf_payment'), 'price' => $amount, 'item_number' => $item_number, 'item_name' => $item_name, 'type' => $type, 'user_info' => array('id' => $userdata->ID, 'email' => $userdata->user_email, 'first_name' => $userdata->first_name, 'last_name' => $userdata->last_name), 'date' => date('Y-m-d H:i:s'), 'post_data' => $_POST, 'custom' => isset($custom) ? $custom : ''); do_action('wpuf_gateway_' . $gateway, $payment_vars); } }
/** * Validate a coupon code * * @param null|float $billing_amount * @param int $coupon_id * @param int $pack_id * @return WP_Error|float */ function coupon_validation($billing_amount = null, $coupon_id, $pack_id) { $coupon_meta = $this->get_coupon_meta($coupon_id); $coupon_amount = intval($coupon_meta['amount']); if (empty($coupon_amount)) { return $billing_amount; } $coupon_usage = get_post_meta($coupon_id, '_coupon_used', true); $start_date = !empty($coupon_meta['start_date']) ? strtotime(date('Y-m-d', strtotime($coupon_meta['start_date']))) : ''; $end_date = !empty($coupon_meta['end_date']) ? strtotime(date('Y-m-d', strtotime($coupon_meta['end_date']))) : ''; $today = time(); $pack = WPUF_Subscription::init()->get_subscription($pack_id); $current_use_email = is_user_logged_in() ? wp_get_current_user()->user_email : ''; if (!in_array('all', $coupon_meta['package']) && !in_array($pack_id, $coupon_meta['package'])) { return new WP_Error('message', __('Coupon is not availiable for this package!', 'wpuf')); } if (!empty($coupon_meta['usage_limit']) && $coupon_meta['usage_limit'] < $coupon_usage) { return new WP_Error('message', __('Coupon usage limit exceeded!', 'wpuf')); } if (!empty($start_date)) { if ($start_date > $today) { return new WP_Error('message', __('Sorry, this coupon is not start!', 'wpuf')); } } if (!empty($end_date)) { if ($end_date < $today) { return new WP_Error('message', __('Sorry, this coupon has been expired!', 'wpuf')); } } if (count($coupon_meta['access']) && !in_array($current_use_email, $coupon_meta['access'])) { return new WP_Error('message', __('You are not allowed to use this coupon!', 'wpuf')); } if (!empty($coupon_amount) && $coupon_meta['type'] == 'amount') { $billing_amount = $pack->meta_value['billing_amount'] - $coupon_amount; } else { if ($coupon_amount && !empty($coupon_amount) && $coupon_meta['type'] == 'percent') { $billing_amount = $pack->meta_value['billing_amount'] * $coupon_amount / 100; $billing_amount = $pack->meta_value['billing_amount'] - $billing_amount; } } if ($billing_amount > 0) { return $billing_amount; } return 0; }
/** * Adds the postlock form in users profile * * @param object $profileuser */ function profile_subscription_details($profileuser) { if (!is_admin() && !current_user_can('edit_users')) { return; } if (wpuf_get_option('charge_posting', 'wpuf_payment') != 'yes') { return; } $userdata = get_userdata($profileuser->ID); //wp 3.3 fix $packs = WPUF_Subscription::init()->get_subscriptions(); $user_sub = WPUF_Subscription::get_user_pack($userdata->ID); $pack_id = isset($user_sub['pack_id']) ? $user_sub['pack_id'] : ''; ?> <div class="wpuf-user-subscription"> <h3><?php _e('WPUF Subscription', 'wpuf'); ?> </h3> <a class="btn button-primary wpuf-assing-pack-btn wpuf-add-pack" href="#"><?php _e('Assign Package', 'wpuf'); ?> </a> <a class="btn button-primary wpuf-assing-pack-btn wpuf-cancel-pack" style="display:none;" href="#"><?php _e('Show Package', 'wpuf'); ?> </a> <table class="form-table wpuf-pack-dropdown" disabled="disabled" style="display: none;"> <tr> <th><label for="wpuf_sub_pack"><?php _e('Pack:', 'wpuf'); ?> </label></th> <td> <select name="pack_id" id="wpuf_sub_pack"> <option value="-1"><?php _e('--Select--', 'wpuf'); ?> </option> <?php $this->packdropdown_without_recurring($packs, $pack_id); //WPUF_Subscription::init()->packdropdown( $packs, $selected = '' ); ?> </select> </td> </tr> </table> <?php if (!isset($user_sub['pack_id'])) { return; } $pack = WPUF_Subscription::get_subscription($user_sub['pack_id']); $details_meta = WPUF_Subscription::init()->get_details_meta_value(); $billing_amount = intval($pack->meta_value['billing_amount']) > 0 ? $details_meta['symbol'] . $pack->meta_value['billing_amount'] : __('Free', 'wpuf'); if ($billing_amount && $pack->meta_value['recurring_pay'] == 'yes') { $recurring_des = sprintf('For each %s %s', $pack->meta_value['billing_cycle_number'], $pack->meta_value['cycle_period'], $pack->meta_value['trial_duration_type']); $recurring_des .= !empty($pack->meta_value['billing_limit']) ? sprintf(', for %s installments', $pack->meta_value['billing_limit']) : ''; $recurring_des = $recurring_des; } else { $recurring_des = ''; } ?> <div class="wpuf-user-sub-info"> <h3><?php _e('Subscription Details', 'wpuf'); ?> </h3> <div class="wpuf-text"> <div><strong><?php _e('Subcription Name: ', 'wpuf'); ?> </strong><?php echo $pack->post_title; ?> </div> <div> <strong><?php _e('Package billing details: '); ?> </strong> <div class="wpuf-pricing-wrap"> <div class="wpuf-sub-amount"> <?php echo $billing_amount; ?> <?php echo $recurring_des; ?> </div> </div> </div> <strong><?php _e('Remaining post: ', 'wpuf'); ?> </strong> <table class="form-table"> <?php foreach ($user_sub['posts'] as $key => $value) { ?> <tr> <th><label><?php echo $key; ?> </label></th> <td><input type="text" value="<?php echo $value; ?> " name="<?php echo $key; ?> " ></td> </tr> <?php } ?> <?php if ($user_sub['recurring'] != 'yes') { if (!empty($user_sub['expire'])) { $expire = $user_sub['expire'] == 'unlimited' ? ucfirst('unlimited') : wpuf_date2mysql($user_sub['expire']); ?> <tr> <th><label><?php echo _e('Expire date:'); ?> </label></th> <td><input type="text" class="wpuf-date-picker" name="expire" value="<?php echo wpuf_get_date($expire); ?> "></td> </tr> <?php } } ?> </table> </div> </div> </div> <?php }
/** * Adds the postlock form in users profile * * @param object $profileuser */ function profile_subscription_details($profileuser) { if (!current_user_can('edit_users')) { return; } if (wpuf_get_option('charge_posting', 'wpuf_payment') != 'yes') { return; } $userdata = get_userdata($profileuser->ID); //wp 3.3 fix $packs = WPUF_Subscription::init()->get_subscriptions(); $user_sub = WPUF_Subscription::get_user_pack($userdata->ID); $pack_id = isset($user_sub['pack_id']) ? $user_sub['pack_id'] : ''; ?> <div class="wpuf-user-subscription"> <h3><?php _e('WPUF Subscription', 'wpuf'); ?> </h3> <?php if (isset($user_sub['pack_id'])) { $pack = WPUF_Subscription::get_subscription($user_sub['pack_id']); $details_meta = WPUF_Subscription::init()->get_details_meta_value(); $billing_amount = intval($pack->meta_value['billing_amount']) > 0 ? $details_meta['symbol'] . $pack->meta_value['billing_amount'] : __('Free', 'wpuf'); if ($billing_amount && $pack->meta_value['recurring_pay'] == 'yes') { $recurring_des = sprintf('For each %s %s', $pack->meta_value['billing_cycle_number'], $pack->meta_value['cycle_period'], $pack->meta_value['trial_duration_type']); $recurring_des .= !empty($pack->meta_value['billing_limit']) ? sprintf(', for %s installments', $pack->meta_value['billing_limit']) : ''; $recurring_des = $recurring_des; } else { $recurring_des = ''; } ?> <div class="wpuf-user-sub-info"> <h3><?php _e('Subscription Details', 'wpuf'); ?> </h3> <?php if (isset($user_sub['recurring']) && $user_sub['recurring'] == 'yes') { ?> <div class="updated"> <p><?php _e('This user is using recurring subscription pack', 'wpuf'); ?> </p> </div> <?php } ?> <div class="wpuf-text"> <div><strong><?php _e('Subcription Name: ', 'wpuf'); ?> </strong><?php echo $pack->post_title; ?> </div> <div> <strong><?php _e('Package billing details: '); ?> </strong> <div class="wpuf-pricing-wrap"> <div class="wpuf-sub-amount"> <?php echo $billing_amount; ?> <?php echo $recurring_des; ?> </div> </div> </div> <strong><?php _e('Remaining post: ', 'wpuf'); ?> </strong> <table class="form-table"> <?php foreach ($user_sub['posts'] as $key => $value) { ?> <tr> <th><label><?php echo $key; ?> </label></th> <td><input type="text" value="<?php echo $value; ?> " name="<?php echo $key; ?> " ></td> </tr> <?php } ?> <?php if ($user_sub['recurring'] != 'yes') { if (!empty($user_sub['expire'])) { $expire = $user_sub['expire'] == 'unlimited' ? ucfirst('unlimited') : wpuf_date2mysql($user_sub['expire']); ?> <tr> <th><label><?php echo _e('Expire date:'); ?> </label></th> <td><input type="text" class="wpuf-date-picker" name="expire" value="<?php echo wpuf_get_date($expire); ?> "></td> </tr> <?php } } ?> <?php $is_post_exp_selected = isset($user_sub['_enable_post_expiration']) ? 'checked' : ''; $_post_expiration_time = explode(' ', isset($user_sub['_post_expiration_time']) ? $user_sub['_post_expiration_time'] : ' '); $time_value = isset($_post_expiration_time[0]) && !empty($_post_expiration_time[0]) ? $_post_expiration_time[0] : '1'; $time_type = isset($_post_expiration_time[1]) && !empty($_post_expiration_time[1]) ? $_post_expiration_time[1] : 'day'; ?> <tr> <th><label><?php echo _e('Post Expiration Enabled'); ?> </label></th> <td><input type="checkbox" name="is_post_expiration_enabled" value="on" <?php echo $is_post_exp_selected; ?> ></td> </tr> <tr> <?php $timeType_array = array('year' => 100, 'month' => 12, 'day' => 30); ?> <th><?php _e('Post Expiration Time', 'wpuf'); ?> </th> <td> <select name="post_expiration_settings[expiration_time_value]" id="wpuf-expiration_time_value"> <?php for ($i = 1; $i <= $timeType_array[$time_type]; $i++) { ?> <option value="<?php echo $i; ?> " <?php echo $i == $time_value ? 'selected' : ''; ?> ><?php echo $i; ?> </option> <?php } ?> </select> <select name="post_expiration_settings[expiration_time_type]" id="wpuf-expiration_time_type"> <?php foreach ($timeType_array as $each_time_type => $each_time_type_val) { ?> <option value="<?php echo $each_time_type; ?> " <?php echo $each_time_type == $time_type ? 'selected' : ''; ?> ><?php echo ucfirst($each_time_type); ?> </option> <?php } ?> </select> </td> </tr> </table> </div> </div> <?php } ?> <?php if (!isset($user_sub['recurring']) || $user_sub['recurring'] != 'yes') { ?> <a class="btn button-primary wpuf-assing-pack-btn wpuf-add-pack" href="#"><?php _e('Assign Package', 'wpuf'); ?> </a> <a class="btn button-primary wpuf-assing-pack-btn wpuf-cancel-pack" style="display:none;" href="#"><?php _e('Show Package', 'wpuf'); ?> </a> <table class="form-table wpuf-pack-dropdown" disabled="disabled" style="display: none;"> <tr> <th><label for="wpuf_sub_pack"><?php _e('Pack:', 'wpuf'); ?> </label></th> <td> <select name="pack_id" id="wpuf_sub_pack"> <option value="-1"><?php _e('--Select--', 'wpuf'); ?> </option> <?php $this->packdropdown_without_recurring($packs, $pack_id); //WPUF_Subscription::init()->packdropdown( $packs, $selected = '' ); ?> </select> </td> </tr> </table> <?php } ?> <?php if (!empty($user_sub)) { ?> <a class="btn button-primary wpuf-delete-pack-btn" href="javascript:" data-userid = "<?php echo $userdata->ID; ?> "><?php _e('Delete Package', 'wpuf'); ?> </a> <?php } ?> </div> <?php }
/** * Prepare the payment form and send to paypal * * @since 0.8 * @param array $data payment info */ function prepare_to_send($data) { $user_id = $data['user_info']['id']; $listener_url = add_query_arg('action', 'wpuf_paypal_success', home_url('/')); $redirect_page_id = wpuf_get_option('payment_success', 'wpuf_payment'); if ($redirect_page_id) { $return_url = add_query_arg('action', 'wpuf_paypal_success', get_permalink($redirect_page_id)); } else { $return_url = add_query_arg('action', 'wpuf_paypal_success', get_permalink(wpuf_get_option('subscription_page', 'wpuf_payment'))); } $billing_amount = empty($data['price']) ? 0 : number_format($data['price'], 2); if (isset($_POST['coupon_id']) && !empty($_POST['coupon_id'])) { $billing_amount = WPUF_Coupons::init()->discount($billing_amount, $_POST['coupon_id'], $data['item_number']); $coupon_id = $_POST['coupon_id']; } else { $coupon_id = ''; } if ($billing_amount == 0) { WPUF_Subscription::init()->new_subscription($user_id, $data['item_number'], $profile_id = null, false, 'free'); wp_redirect($return_url); exit; } if ($data['type'] == 'pack' && $data['custom']['recurring_pay'] == 'yes') { $trial_cost = !empty($data['custom']['trial_cost']) ? number_format($data['custom']['trial_cost']) : '0'; if ($data['custom']['cycle_period'] == "day") { $period = "D"; } elseif ($data['custom']['cycle_period'] == "week") { $period = "W"; } elseif ($data['custom']['cycle_period'] == "month") { $period = "M"; } elseif ($data['custom']['cycle_period'] == "year") { $period = "Y"; } if ($data['custom']['trial_duration_type'] == "day") { $trial_period = "D"; } elseif ($data['custom']['trial_duration_type'] == "week") { $trial_period = "W"; } elseif ($data['custom']['trial_duration_type'] == "month") { $trial_period = "M"; } elseif ($data['custom']['trial_duration_type'] == "year") { $trial_period = "Y"; } $paypal_args = array('cmd' => '_xclick-subscriptions', 'business' => wpuf_get_option('paypal_email', 'wpuf_payment'), 'a3' => $billing_amount, 'p3' => !empty($data['custom']['billing_cycle_number']) ? $data['custom']['billing_cycle_number'] : '0', 't3' => $period, 'item_name' => $data['custom']['post_title'], 'custom' => json_encode(array('billing_amount' => $billing_amount, 'trial_cost' => $trial_cost, 'type' => $data['type'], 'user_id' => $user_id, 'coupon_id' => $coupon_id)), 'no_shipping' => '1', 'shipping' => '0', 'no_note' => '1', 'currency_code' => $data['currency'], 'item_number' => $data['item_number'], 'charset' => 'UTF-8', 'rm' => '2', 'return' => $return_url, 'notify_url' => $listener_url, 'src' => '1', 'sra' => '1', 'srt' => intval($data['custom']['billing_limit'])); if ($data['custom']['trial_status'] == 'yes') { $paypal_args['a1'] = $trial_cost; $paypal_args['p1'] = $data['custom']['trial_duration']; $paypal_args['t1'] = $trial_period; } } else { $paypal_args = array('cmd' => '_xclick', 'business' => wpuf_get_option('paypal_email', 'wpuf_payment'), 'amount' => $billing_amount, 'item_name' => isset($data['custom']['post_title']) ? $data['custom']['post_title'] : $data['item_name'], 'no_shipping' => '1', 'shipping' => '0', 'no_note' => '1', 'currency_code' => $data['currency'], 'item_number' => $data['item_number'], 'charset' => 'UTF-8', 'rm' => '2', 'custom' => json_encode(array('type' => $data['type'], 'user_id' => $user_id, 'coupon_id' => $coupon_id)), 'return' => $return_url, 'notify_url' => $listener_url); } $this->set_mode(); $paypal_url = $this->gateway_url . http_build_query($paypal_args); wp_redirect($paypal_url); exit; }
/** * Instantiate the classes * * @return void */ function instantiate() { // var_dump( get_option( 'wpuf_payment' ) ); new WPUF_Upload(); new WPUF_Frontend_Form_Profile(); new WPUF_Payment(); WPUF_Frontend_Form_Post::init(); // requires for form preview WPUF_Login::init(); WPUF_Subscription::init(); WPUF_Coupons::init(); if (is_admin()) { WPUF_Admin_Settings::init(); new WPUF_Admin_Form(); new WPUF_Admin_Posting(); new WPUF_Admin_Posting_Profile(); new WPUF_Admin_Coupon(); new WPUF_Updates(); new WPUF_Admin_Subscription(); new WPUF_Admin_Installer(); } else { new WPUF_Frontend_Dashboard(); } }
function payment_page($content) { global $post; $pay_page = intval(wpuf_get_option('payment_page', 'wpuf_payment')); if ($post->ID == $pay_page && isset($_REQUEST['action']) && $_REQUEST['action'] == 'wpuf_pay') { if (!is_user_logged_in()) { return __('You are not logged in', 'wpuf'); } $type = $_REQUEST['type'] == 'post' ? 'post' : 'pack'; $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; $pack_id = isset($_REQUEST['pack_id']) ? intval($_REQUEST['pack_id']) : 0; $is_free = false; if ($pack_id) { $pack_detail = WPUF_Subscription::get_subscription($pack_id); if ($pack_detail->cost == '0') { $is_free = true; } } $gateways = $this->get_active_gateways(); if (isset($_REQUEST['wpuf_payment_submit'])) { $selected_gateway = $_REQUEST['wpuf_payment_method']; } else { $selected_gateway = 'paypal'; } ob_start(); if ($pack_id && $is_free) { $current_user = wp_get_current_user(); $wpuf_subscription = WPUF_Subscription::init(); if (!WPUF_Subscription::has_used_free_pack($current_user->ID, $pack_id)) { $wpuf_subscription->new_subscription($current_user->ID, $pack_id); WPUF_Subscription::add_used_free_pack($current_user->ID, $pack_id); $message = apply_filters('wpuf_fp_activated_msg', __('Your free package has been activated. Enjoy!'), 'wpuf'); } else { $message = apply_filters('wpuf_fp_activated_error', __('You already have activated a free package previously.'), 'wpuf'); } ?> <div class="wpuf-info"><?php echo $message; ?> </div> <?php } else { ?> <?php if (count($gateways)) { ?> <form id="wpuf-payment-gateway" action="<?php echo $_SERVER["REQUEST_URI"]; ?> " method="POST"> <?php wp_nonce_field('wpuf_payment_gateway'); ?> <?php do_action('wpuf_before_payment_gateway'); ?> <p> <label for="wpuf-payment-method"><?php _e('Choose Your Payment Method', 'wpuf'); ?> </label><br /> <ul class="wpuf-payment-gateways"> <?php foreach ($gateways as $gateway_id => $gateway) { ?> <li class="wpuf-gateway-<?php echo $gateway_id; ?> "> <label> <input name="wpuf_payment_method" type="radio" value="<?php echo esc_attr($gateway_id); ?> " <?php checked($selected_gateway, $gateway_id); ?> > <?php echo $gateway['label']; if (!empty($gateway['icon'])) { printf(' <img src="%s" alt="image">', $gateway['icon']); } ?> </label> <div class="wpuf-payment-instruction" style="display: none;"> <div class="wpuf-instruction"><?php echo wpuf_get_option('gate_instruct_' . $gateway_id, 'wpuf_payment'); ?> </div> <?php do_action('wpuf_gateway_form_' . $gateway_id, $type, $post_id, $pack_id); ?> </div> </li> <?php } ?> </ul> </p> <?php do_action('wpuf_after_payment_gateway'); ?> <p> <input type="hidden" name="type" value="<?php echo $type; ?> " /> <input type="hidden" name="action" value="wpuf_pay" /> <?php if ($post_id) { ?> <input type="hidden" name="post_id" value="<?php echo $post_id; ?> " /> <?php } ?> <?php if ($pack_id) { ?> <input type="hidden" name="pack_id" value="<?php echo $pack_id; ?> " /> <?php } ?> <input type="submit" name="wpuf_payment_submit" value="<?php _e('Proceed', 'wpuf'); ?> "/> </p> </form> <?php } else { ?> <?php _e('No Payment gateway found', 'wpuf'); ?> <?php } ?> <?php } return ob_get_clean(); } return $content; }