示例#1
0
        $payment = $db->get_payment($vars['payment_id']);
        $t->assign('member_id', $member['member_id']);
        $t->assign('payment_id', $payment['payment_id']);
        $t->assign('error', $errors);
        $t->assign('phone_number', $member['cc_phone']);
        $t->display('cc/cc_telephone_verification.html');
        exit;
    } else {
        $vars = $_SESSION['stored_vars'];
        $_SESSION['stored_vars'] = '';
        $_SESSION['ccfd_verify_code'] = '';
        $phone_verified = true;
    }
}
$member = $db->get_user($vars['member_id']);
if (get_cc_info_hash($member, $vars['action']) != $vars['v']) {
    fatal_error(_PLUG_PAY_CC_CORE_FERROR1);
}
/// member is verified, lets continue
switch ($vars['action']) {
    case 'mfp':
        // make first payment
        settype($vars['payment_id'], 'integer');
        if (!$vars['payment_id']) {
            fatal_error(_PLUG_PAY_CC_CORE_FERROR3);
        }
        $payment = $db->get_payment($vars['payment_id']);
        if ($payment['member_id'] != $vars['member_id']) {
            fatal_error(_PLUG_PAY_CC_CORE_FERROR4);
        }
        if ($payment['completed']) {
示例#2
0
function cc_core_get_member_links($plugin, $user)
{
    global $config;
    $action = "renew_cc";
    $v = get_cc_info_hash($user, $action);
    if ($user['data']['cc']) {
        return array("{$config['root_surl']}/plugins/payment/cc_core/cc.php?action={$action}&paysys_id={$plugin}&member_id={$user[member_id]}&v={$v}" => 'Update CC info');
    }
}
 function process_postback($vars)
 {
     global $db;
     $this->config['disable_postback_log'] = 1;
     $vars['PaRes'] = urlencode($vars['PaRes']);
     $vars['MD'] = urlencode($vars['MD']);
     $log = array();
     $log[] = $vars;
     $s = cc_core_get_url("https://www.beanstream.com/scripts/process_transaction_auth.asp" . "?PaRes={$vars['PaRes']}&MD={$vars['MD']}");
     parse_str($s, $ret);
     $log[] = $ret;
     if ($ret['trnApproved']) {
         $x = array(CC_RESULT_SUCCESS, "", $ret['trnId'], $log);
     } else {
         if ($ret['errorType'] == 'S') {
             $x = array(CC_RESULT_INTERNAL_ERROR, $ret['messageText'], "", $log);
         } else {
             $x = array(CC_RESULT_DECLINE_PERM, $ret['messageText'], "", $log);
         }
     }
     list($res, $err_msg, $receipt_id, $log) = $x;
     $payment = $db->get_payment($ret['trnOrderNumber']);
     $member = $db->get_user($payment['member_id']);
     foreach ($log as $v) {
         $payment['data'][] = $v;
     }
     $db->update_payment($payment['payment_id'], $payment);
     if ($res == CC_RESULT_SUCCESS) {
         $cc_info = array('cc_number' => amember_decrypt($member['cc-hidden']));
         $err = $db->finish_waiting_payment($payment['payment_id'], $payment['paysys_id'], $receipt_id, $payment['amount'], '', cc_core_get_payer_id($cc_info, $member));
         if ($err) {
             fatal_error($err . ": payment_id = {$payment['payment_id']}");
         }
         /// save cc info to db
         //            if ($charge_type != CC_CHARGE_TYPE_REGULAR){
         //                save_cc_info($cc_info, $member, $payment['paysys_id']);
         //            }
         /// display thanks page
         $product = $db->get_product($payment['product_id']);
         $t =& new_smarty();
         $t->assign('payment', $payment);
         if ($payment) {
             $t->assign('product', $db->get_product($payment['product_id']));
             $t->assign('member', $db->get_user($payment['member_id']));
         }
         if (!($prices = $payment['data'][0]['BASKET_PRICES'])) {
             $prices = array($payment['product_id'] => $payment['amount']);
         }
         $pr = array();
         $subtotal = 0;
         foreach ($prices as $product_id => $price) {
             $v = $db->get_product($product_id);
             //		        $v['price'] = $price;
             $subtotal += $v['price'];
             $pr[$product_id] = $v;
         }
         $t->assign('subtotal', $subtotal);
         $t->assign('total', array_sum($prices));
         $t->assign('products', $pr);
         $t->display("thanks.html");
     } else {
         $member = $db->get_user($payment['member_id']);
         $v = get_cc_info_hash($member, $action = "mfp");
         $_GET = $_POST = $vars = array('action' => 'mfp', 'payment_id' => $payment['payment_id'], 'paysys_id' => $payment['paysys_id'], 'member_id' => $member_id, 'v' => $v);
         global $t;
         $t = new_smarty();
         foreach ($vars as $k => $v) {
             $t->_smarty_vars['request'][$k] = $v;
         }
         ask_cc_info($member, $payment, $vars, 0, array(_PLUG_PAY_BEANSTREAM_PFAILED . $err_msg));
     }
 }