Example #1
0
        $query = "SELECT current_bid FROM " . $DBPrefix . "auctions WHERE user = :user_id AND id = :auc_id";
        $params = array();
        $params[] = array(':auc_id', $_SESSION['auction_id'], 'int');
        $params[] = array(':user_id', $user->user_data['id'], 'int');
        $db->query($query, $params);
        $final_value = $db->result('current_bid');
        $query = "SELECT * FROM " . $DBPrefix . "fees WHERE type = 'endauc_fee' ORDER BY value ASC";
        $db->direct_query($query);
        while ($row = $db->fetch()) {
            if ($final_value > $row['fee_from'] && $final_value < $row['fee_to']) {
                if ($row['fee_type'] == 'flat') {
                    $payvalue = $row['value'];
                } else {
                    $payvalue = $row['value'] / 100 * $final_value;
                }
            }
        }
        $custoncode = $_SESSION['auction_id'] . 'WEBID7';
        $message = sprintf($MSG['776'], $system->print_money($payvalue));
        $title = $system->SETTINGS['sitename'] . ' - ' . $MSG['791'];
        $fees->add_to_account($MSG['791'], 'endauc_fee', $payvalue);
        break;
}
$sequence = rand(1, 1000);
$timestamp = time();
$pay_val = $system->input_money($system->print_money_nosymbol($payvalue));
$template->assign_vars(array('TOP_MESSAGE' => $message, 'B_ENPAYPAL' => $gateway_data['paypal_active'] == 1 && !empty($pp_paytoemail), 'B_ENAUTHNET' => $gateway_data['authnet_active'] == 1 && !empty($an_paytoid) && !empty($an_paytopass), 'B_ENWORLDPAY' => $gateway_data['worldpay_active'] == 1 && !empty($wp_paytoid), 'B_ENTOOCHECK' => $gateway_data['toocheckout_active'] == 1 && !empty($tc_paytoid), 'B_ENMONEYBOOKERS' => $gateway_data['moneybookers_active'] == 1 && !empty($mb_paytoemail), 'PP_PAYTOEMAIL' => $pp_paytoemail, 'PP_SANDBOX' => $system->SETTINGS['paypal_sandbox'], 'AN_PAYTOID' => $an_paytoid, 'AN_PAYTOPASS' => $an_paytopass, 'AN_KEY' => $gateway_data['authnet_active'] == 1 ? $fees->hmac($an_paytopass, $an_paytoid . "^" . $sequence . "^" . $timestamp . "^" . $pay_val . "^" . $system->SETTINGS['currency']) : '', 'AN_SEQUENCE' => $sequence, 'AN_SANDBOX' => $system->SETTINGS['authnet_sandbox'], 'WP_PAYTOID' => $wp_paytoid, 'WP_SANDBOX' => $system->SETTINGS['worldpay_sandbox'], 'TC_PAYTOID' => $tc_paytoid, 'TC_SANDBOX' => $system->SETTINGS['checkout_sandbox'], 'MB_PAYTOEMAIL' => $mb_paytoemail, 'MB_SANDBOX' => $system->SETTINGS['moneybookers_sandbox'], 'PAY_VAL' => $pay_val, 'CURRENCY' => $system->SETTINGS['currency'], 'TITLE' => $title, 'CUSTOM_CODE' => $custoncode, 'TIMESTAMP' => $timestamp, 'TOUSER_STRING' => isset($extrastring) ? $extrastring : '', 'B_TOUSER' => $_GET['a'] == 2));
include 'header.php';
$template->set_filenames(array('body' => 'pay.tpl'));
$template->display('body');
include 'footer.php';
Example #2
0
File: pay.php Project: Nozlaf/WeBid
        while ($row = $db->fetch()) {
            if ($final_value > $row['fee_from'] && $final_value < $row['fee_to']) {
                if ($row['fee_type'] == 'flat') {
                    $payvalue = $row['value'];
                } else {
                    $payvalue = $row['value'] / 100 * $final_value;
                }
            }
        }
        $custoncode = $_SESSION['auction_id'] . 'WEBID7';
        $message = sprintf($MSG['776'], $system->print_money($payvalue));
        $title = $system->SETTINGS['sitename'] . ' - ' . $MSG['791'];
        $fees->add_to_account($MSG['791'], 'endauc_fee', $payvalue);
        break;
}
// load the payment gateways
$query = "SELECT * FROM " . $DBPrefix . "payment_options WHERE is_gateway = 1";
$db->direct_query($query);
$sequence = rand(1, 1000);
$timestamp = time();
$pay_val = $system->input_money($system->print_money_nosymbol($payvalue));
while ($gateway = $db->fetch()) {
    $address = $paying_fee ? $gateway['gateway_admin_address'] : $user_gateways[$gateway['name']]['address'];
    $password = $paying_fee ? $gateway['gateway_admin_password'] : $user_gateways[$gateway['name']]['password'];
    $template->assign_block_vars('gateways', array('B_ACTIVE' => $paying_fee ? $gateway['gateway_active'] : in_array($gateway['name'], $payment) && isset($user_gateways[$gateway['name']]), 'NAME' => $gateway['name'], 'DISPLAY_NAME' => $gateway['displayname'], 'PAY_ADDRESS' => $paying_fee ? $gateway['gateway_admin_address'] : $user_gateways[$gateway['name']]['address'], 'PAY_PASSWORD' => $paying_fee ? $gateway['gateway_admin_password'] : $user_gateways[$gateway['name']]['password'], 'AN_SEQUENCE' => $sequence, 'AN_KEY' => $gateway['name'] == 'authnet' ? $fees->hmac($password, $address . "^" . $sequence . "^" . $timestamp . "^" . $pay_val . "^" . $system->SETTINGS['currency']) : ''));
}
$template->assign_vars(array('TOP_MESSAGE' => $message, 'SANDBOX' => $system->SETTINGS['payment_gateway_sandbox'], 'PAY_VAL' => $pay_val, 'CURRENCY' => $system->SETTINGS['currency'], 'TITLE' => $title, 'CUSTOM_CODE' => $custoncode, 'TIMESTAMP' => $timestamp, 'NO_ONLINE_GATEWAYS' => $db->numrows() < 1, 'TOUSER_STRING' => isset($extrastring) ? $extrastring : '', 'B_TOUSER' => $_GET['a'] == 2));
include 'header.php';
$template->set_filenames(array('body' => 'pay.tpl'));
$template->display('body');
include 'footer.php';