$vars['cvd'] = $cc_info['cc_code'];
        }
        // prepare log record
        $vars_l = $vars;
        $vars_l['card'] = $cc_info['cc'];
        if ($vars['cvd']) {
            $vars_l['cvd'] = preg_replace('/./', '*', $vars['cvd']);
        }
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if (preg_match("/Approved/i", $res[RESULT])) {
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif (preg_match("/Declined/i", $res[RESULT])) {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'] ? $res[RESPMSG] : $res[RESULT], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'] ? $res[RESPMSG] : $res[RESULT], "", $log);
        }
    }
}
function firstpay_get_member_links($user)
{
    return cc_core_get_member_links('firstpay', $user);
}
function firstpay_rebill()
{
    return cc_core_rebill('firstpay');
}
cc_core_init('firstpay');
        }
        $log[] = $vars_l;
        #run credit card transaction
        $objSPCharge->SubmitCharge();
        $res = array();
        $res['returnCode'] = $objSPCharge->returnCode;
        $res['approvNum'] = $objSPCharge->approvNum;
        $res['cardResponse'] = $objSPCharge->cardResponse;
        $res['avsResponse'] = $objSPCharge->avsResponse;
        $res['recordNumber'] = $objSPCharge->recordNumber;
        $log[] = $res;
        if ($res['returnCode'] == 'Y') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                //$this->void_transaction($invoice, $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['approvNum'], $log);
        } else {
            return array(CC_RESULT_DECLINE_PERM, $res['cardResponse'], "", $log);
        }
    }
}
function securepay_get_member_links($user)
{
    return cc_core_get_member_links('securepay', $user);
}
function securepay_rebill()
{
    return cc_core_rebill('securepay');
}
cc_core_init('securepay');
        xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
        xml_parse($xml_parser, $xml_response);
        xml_parser_free($xml_parser);
        if (count($pv_arrs)) {
            return $pv_arrs;
        } else {
            return $xml_response;
        }
    }
    function payment_payvision($config)
    {
        parent::payment($config);
        add_member_field('payvision_cardid', '', 'hidden');
        add_member_field('payvision_cardguid', '', 'hidden');
        if ($this->config['testing']) {
            $this->paurl = "https://testprocessor.payvisionservices.com";
        } else {
            $this->paurl = "https://testprocessor.payvisionservices.com";
        }
    }
}
function payvision_get_member_links($user)
{
    return cc_core_get_member_links('payvision', $user);
}
function payvision_rebill()
{
    return cc_core_rebill('payvision');
}
cc_core_init('payvision');
        } catch (Exception $e) {
            return array(CC_RESULT_INTERNAL_ERROR, $e->getCode() . " " . $e->getMessage(), "", $log);
        }
        try {
            $result = $dispatcher->creditcardDataSet($this->config['key'], $this->config['testing'], $customerId, $cc_info['cc_number'], "20" . substr($cc_info['cc-expire'], 2, 2), substr($cc_info['cc-expire'], 0, 2));
            $log[] = $result;
        } catch (Exception $e) {
            return array(CC_RESULT_INTERNAL_ERROR, $e->getCode() . " " . $e->getMessage(), "", $log);
        }
        $member['data']['micropayment_cc_customer_vault_id'] = $customerId;
        $db->update_user($member['member_id'], $member);
        global $log_p;
        $this->log = $log;
    }
    function payment_micropayment_cc($config)
    {
        parent::payment($config);
        add_product_field('micropayment_cc_project', 'Micropayment_cc Project Code', 'text', '');
        add_member_field('micropayment_cc_customer_vault_id', 'Micropayment_cc Customer Vault Id', '', '');
    }
}
function micropayment_cc_get_member_links($user)
{
    return cc_core_get_member_links('micropayment_cc', $user);
}
function micropayment_cc_rebill()
{
    return cc_core_rebill('micropayment_cc');
}
cc_core_init('micropayment_cc');
        // get_visible_cc_number($cc_info['cc_number']);
        if ($vars['vpc_CardSecurityCode']) {
            $vars_l['vpc_CardSecurityCode'] = preg_replace('/./', '*', $vars['vpc_CardSecurityCode']);
        }
        $vars_l['vpc_AccessCode'] = preg_replace('/./', '*', $vars['vpc_AccessCode']);
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['RESULT'] == '1') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($res['PNREF'], $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif ($res['RESULT'] == '2') {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'], "", $log);
        }
    }
}
function migs_cc_get_member_links($user)
{
    return cc_core_get_member_links('migs_cc', $user);
}
function migs_cc_rebill()
{
    return cc_core_rebill('migs_cc');
}
cc_core_init('migs_cc');
        }
        $vars1 = join('&', $vars1);
        $ret = cc_core_get_url("https://secure.logiccommerce.com/services/Payment.asmx/Process", $vars1);
        $log[] = array('' => str_replace('<', '&lt;', $ret));
        $res = array();
        foreach (array('EterminalId', 'AuthCode', 'Response', 'ResponseCode', 'Status', 'System', 'InvoiceNumber') as $k) {
            if (preg_match("/<{$k}>(.+?)<\\/{$k}>/", $ret, $regs)) {
                $res[$k] = $regs[1];
            }
        }
        if ($res['Status'] == 0) {
            return array(CC_RESULT_SUCCESS, "", $res['EterminalId'], $log);
        } else {
            if ($res['System'] == '1') {
                return array(CC_RESULT_INTERNAL_ERROR, $res['Response'], "", $log);
            } else {
                return array(CC_RESULT_DECLINE_PERM, $res['Response'], "", $log);
            }
        }
    }
}
function logiccommerce_get_member_links($user)
{
    return cc_core_get_member_links('logiccommerce', $user);
}
function logiccommerce_rebill()
{
    return cc_core_rebill('logiccommerce');
}
cc_core_init('logiccommerce');
Example #7
0
    function process_postback(&$vars)
    {
        global $db;
        $this->log_debug($vars);
        $err = $db->finish_waiting_payment($vars['orderid'], 'epayeu', $vars['tid'], '', $vars);
        if ($err) {
            return "finish_waiting_payment error: {$err}";
        }
        $p = $db->get_payment($vars['orderid']);
        $p['data']['epayeu_subscription_id'] = $vars['subscriptionid'];
        $db->update_payment($p['payment_id'], $p);
        $vars['member_id'] = $p['member_id'];
        $vars['payment_id'] = $p['payment_id'];
        $vars['product_id'] = $p['product_id'];
    }
    function init()
    {
        parent::init();
        add_payment_field('epayeu_subscription_id', 'Epay.eu subscription ID', 'hidden', '');
    }
}
function epayeu_get_member_links($user)
{
    return;
}
function epayeu_rebill()
{
    return cc_core_rebill('epayeu');
}
cc_core_init('epayeu');
        $vars = array("publisher-name" => $this_config['login'], "publisher-email" => $config['admin_email'], "card-amount" => $amount, "card-name" => $cc_info['cc_name_f'] . " " . $cc_info['cc_name_l'], "card-address1" => $cc_info['cc_street'], "card-city" => $cc_info['cc_city'], "card-state" => str_replace("XX", "", $cc_info['cc_state']), "card-prov" => $cc_info['cc_province'], "card-zip" => preg_replace("/[^0-9a-zA-Z]/i", "", $cc_info['cc_zip']), "card-country" => $cc_info['cc_country'], "card-number" => $cc_info['cc_number'], "card-exp" => $cc_info['cc-expire'], "card-cvv" => $cc_info['cc_code'], "currency" => $this_config['currency'], "cardissuenum" => $cc_info['cc_issuenum'], "cardstartdate" => $cc_info['cc_startdate'], "orderID" => '', "app-level" => $this_config['app_level'], "acct_code" => $member['login'], 'shipping' => 0, 'tax' => 0, 'order-id' => $payment['payment_id'], 'item1' => $product['price_group'] < 0 ? -$product['price_group'] : $product['price_group'], 'price1' => $payment['amount'], 'quantity1' => 1, 'description1' => $product['title']);
        // prepare log record
        $vars_l = $vars;
        $vars_l['card-number'] = $cc_info['cc'];
        if ($vars['card-cvv']) {
            $vars_l['card-cvv'] = preg_replace('/./', '*', $vars['card-cvv']);
        }
        $log[] = $vars_l;
        /////
        $db->log_error("PlugNPay DEBUG:<br />" . plugnpay_get_dump($vars_l));
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if (preg_match("/Approved/i", $res['RESULT'])) {
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif (preg_match("/Declined/i", $res['RESULT'])) {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        }
    }
}
function plugnpay_get_member_links($user)
{
    return cc_core_get_member_links('plugnpay', $user);
}
function plugnpay_rebill()
{
    return cc_core_rebill('plugnpay');
}
cc_core_init('plugnpay');
            $vars_l['CVV2'] = preg_replace('/./', '*', $vars['CVV2']);
        }
        $log[] = $vars_l;
        /////
        foreach ($vars as $kk => $vv) {
            $v = urlencode($vv);
            $k = urlencode($kk);
            $vars1[] = "{$k}={$v}";
        }
        $vars1 = join('&', $vars1);
        $ret = cc_core_get_url("https://www.eProcessingNetwork.Com/cgi-bin/tdbe/transact.pl", $vars1);
        $log[] = $res = array('R' => $ret);
        if (preg_match('/\\>"Y/', $ret)) {
            return array(CC_RESULT_SUCCESS, "", $res['payment_number'], $log);
        } else {
            // ($res['summary_code'] == 1) {
            $err = $res['response_text'] ? $res['response_text'] : "card declined";
            return array(CC_RESULT_DECLINE_PERM, $err, "", $log);
        }
    }
}
function eprocessingnetwork_get_member_links($user)
{
    return cc_core_get_member_links('eprocessingnetwork', $user);
}
function eprocessingnetwork_rebill()
{
    return cc_core_rebill('eprocessingnetwork');
}
cc_core_init('eprocessingnetwork');
        $vars = array("NumeroDocumento" => "amember_cobrebem_plugin", "ValorDocumento" => sprintf("%.2f", $amount), "QuantidadeParcelas" => "01", "NumeroCartao" => $cc_info['cc_number'], "MesValidade" => $cc_info['cc_expire_Month'], "AnoValidade" => $cc_info['cc_expire_Year'], "CodigoSeguranca" => $cc_info['cc_code'], "PreAutorizacao" => "N", "EnderecoIPComprador" => $member['remote_addr'] ? $member['remote_addr'] : $_SERVER['REMOTE_ADDR']);
        // prepare log record
        $vars_l = $vars;
        $vars_l['NumeroCartao'] = preg_replace('/./', '*', $vars['NumeroCartao']);
        $vars_l['CodigoSeguranca'] = preg_replace('/./', '*', $vars['CodigoSeguranca']);
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['TransacaoAprovada'] == 'True') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($res['Transacao'], $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['Transacao'], $log);
        } elseif ($res['TransacaoAprovada'] == 'False') {
            return array(CC_RESULT_DECLINE_PERM, $res['ResultadoSolicitacaoAprovacao'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['ResultadoSolicitacaoAprovacao'], "", $log);
        }
    }
}
function cobrebem_get_member_links($user)
{
    return cc_core_get_member_links('cobrebem', $user);
}
function cobrebem_rebill()
{
    return cc_core_rebill('cobrebem');
}
cc_core_init('cobrebem');
Example #11
0
        $vars_l['card-number'] = $cc_info['cc'];
        if ($vars['card-cvv']) {
            $vars_l['card-cvv'] = preg_replace('/./', '*', $vars['card-cvv']);
        }
        if ($vars['passphrase']) {
            $vars_l['passphrase'] = preg_replace('/./', '*', $vars['passphrase']);
        }
        $log[] = $vars_l;
        /////
        $db->log_error("PSiGate DEBUG:<br />" . psigate_get_dump($vars_l));
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if (preg_match("/Approved/i", $res['RESULT'])) {
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif (preg_match("/Declined/i", $res['RESULT'])) {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        }
    }
}
function psigate_get_member_links($user)
{
    return cc_core_get_member_links('psigate', $user);
}
function psigate_rebill()
{
    return cc_core_rebill('psigate');
}
cc_core_init('psigate');
        }
        if ($cc_info['cc_code'] != '') {
            $vars['ecom_payment_card_verification'] = $cc_info['cc_code'];
        }
        $vars_cc = $vars;
        $vars_cc['pg_merchant_id'] = preg_replace('/./', '*', $vars_cc['pg_merchant_id']);
        $vars_cc['pg_password'] = preg_replace('/./', '*', $vars_cc['pg_password']);
        $vars_cc['ecom_payment_card_verification'] = preg_replace('/./', '*', $vars_cc['ecom_payment_card_verification']);
        $vars_cc['Ecom_Payment_Card_Number'] = $cc_info['cc'];
        $log[] = $vars_cc;
        $buffer = cc_core_get_url($url_proc, join('&', $vars1) . '&endofdata&');
        parse_str($b = preg_replace("/[\n\r]+/", "&", $buffer), $res);
        $log[] = $res;
        //        print_r($log);
        if ($res['pg_response_type'] != 'A') {
            return array(CC_RESULT_DECLINE_PERM, $res['pg_response_description'], $res['pg_trace_number'], $log);
        } else {
            return array(CC_RESULT_SUCCESS, "", $res['pg_trace_number'], $log);
        }
    }
}
function paymentsgateway_get_member_links($user)
{
    return cc_core_get_member_links('paymentsgateway', $user);
}
function paymentsgateway_rebill()
{
    return cc_core_rebill('paymentsgateway');
}
cc_core_init('paymentsgateway');
Example #13
0
        $log["AuthCode"] = $mpgResponse->getAuthCode();
        $log["Complete"] = $mpgResponse->getComplete();
        $log["TransDate"] = $mpgResponse->getTransDate();
        $log["TransTime"] = $mpgResponse->getTransTime();
        $log["Ticket"] = $mpgResponse->getTicket();
        $log["TimedOut"] = $mpgResponse->getTimedOut();
        $log["AVSResponse"] = $mpgResponse->getAvsResultCode();
        $log["CVDResponse"] = $mpgResponse->getCvdResultCode();
        return $log;
    }
    function moneris_get_response_message($ResponseCode)
    {
        $ResponseArray = array('0' => 'Approved, account balances included', '1' => 'Approved, account balances not included', '2' => 'Approved, country club', '3' => 'Approved, maybe more ID', '4' => 'Approved, pending ID (sign paper draft)', '5' => 'Approved, blind', '6' => 'Approved, VIP', '7' => 'Approved, administrative transaction', '8' => 'Approved, national NEG file hit OK', '9' => 'Approved, commercial', '23' => 'Amex - credit approval', '24' => 'Amex 77 - credit approval', '25' => 'Amex - credit approval ', '26' => 'Amex - credit approval ', '27' => 'Credit card approval', '28' => 'VIP Credit Approved', '29' => 'Credit Response Acknowledgement', '50' => 'Decline', '51' => 'Expired Card', '52' => 'PIN retries exceeded', '53' => 'No sharing', '54' => 'No security module', '55' => 'Invalid transaction', '56' => 'No Support', '57' => 'Lost or stolen card', '58' => 'Invalid status', '59' => 'Restricted Card', '60' => 'No Chequing account', '60' => 'No Savings account', '61' => 'No PBF', '62' => 'PBF update error', '63' => 'Invalid authorization type', '64' => 'Bad Track 2', '65' => 'Adjustment not allowed', '66' => 'Invalid credit card advance increment', '67' => 'Invalid transaction date', '68' => 'PTLF error', '69' => 'Bad message error', '70' => 'No IDF', '71' => 'Invalid route authorization', '72' => 'Card on National NEG file ', '73' => 'Invalid route service (destination)', '74' => 'Unable to authorize', '75' => 'Invalid PAN length', '76' => 'Low funds', '77' => 'Pre-auth full', '78' => 'Duplicate transaction', '79' => 'Maximum online refund reached', '80' => 'Maximum offline refund reached', '81' => 'Maximum credit per refund reached', '82' => 'Number of times used exceeded', '83' => 'Maximum refund credit reached', '84' => 'Duplicate transaction - authorization number has already been corrected by host. ', '85' => 'Inquiry not allowed', '86' => 'Over floor limit ', '87' => 'Maximum number of refund credit by retailer', '88' => 'Place call ', '89' => 'CAF status inactive or closed', '90' => 'Referral file full', '91' => 'NEG file problem', '92' => 'Advance less than minimum', '93' => 'Delinquent', '94' => 'Over table limit', '95' => 'Amount over maximum', '96' => 'PIN required', '97' => 'Mod 10 check failure', '98' => 'Force Post', '99' => 'Bad PBF', '100' => 'Unable to process transaction', '101' => 'Place call', '102' => '', '103' => 'NEG file problem', '104' => 'CAF problem', '105' => 'Card not supported', '106' => 'Amount over maximum', '107' => 'Over daily limit', '108' => 'CAF Problem', '109' => 'Advance less than minimum', '110' => 'Number of times used exceeded', '111' => 'Delinquent', '112' => 'Over table limit', '113' => 'Timeout', '115' => 'PTLF error', '121' => 'Administration file problem', '122' => 'Unable to validate PIN: security module down', '150' => 'Merchant not on file', '200' => 'Invalid account', '201' => 'Incorrect PIN', '202' => 'Advance less than minimum', '203' => 'Administrative card needed', '204' => 'Amount over maximum ', '205' => 'Invalid Advance amount', '206' => 'CAF not found', '207' => 'Invalid transaction date', '208' => 'Invalid expiration date', '209' => 'Invalid transaction code', '210' => 'PIN key sync error', '212' => 'Destination not available', '251' => 'Error on cash amount', '252' => 'Debit not supported', '426' => 'AMEX - Denial 12', '427' => 'AMEX - Invalid merchant', '429' => 'AMEX - Account error', '430' => 'AMEX - Expired card', '431' => 'AMEX - Call Amex', '434' => 'AMEX - Call 03', '435' => 'AMEX - System down', '436' => 'AMEX - Call 05', '437' => 'AMEX - Declined', '438' => 'AMEX - Declined', '439' => 'AMEX - Service error', '440' => 'AMEX - Call Amex', '441' => 'AMEX - Amount error', '475' => 'CREDIT CARD - Invalid expiration date', '476' => 'CREDIT CARD - Invalid transaction, rejected', '477' => 'CREDIT CARD - Refer Call', '478' => 'CREDIT CARD - Decline, Pick up card, Call', '479' => 'CREDIT CARD - Decline, Pick up card', '480' => 'CREDIT CARD - Decline, Pick up card', '481' => 'CREDIT CARD - Decline', '482' => 'CREDIT CARD - Expired Card', '483' => 'CREDIT CARD - Refer', '484' => 'CREDIT CARD - Expired card - refer', '485' => 'CREDIT CARD - Not authorized', '486' => 'CREDIT CARD - CVV Cryptographic error', '487' => 'CREDIT CARD - Invalid CVV', '489' => 'CREDIT CARD - Invalid CVV', '490' => 'CREDIT CARD - Invalid CVV', '800' => 'Bad format', '801' => 'Bad data', '802' => 'Invalid Clerk ID', '809' => 'Bad close ', '810' => 'System timeout', '811' => 'System error', '821' => 'Bad response length', '877' => 'Invalid PIN block', '878' => 'PIN length error', '880' => 'Final packet of a multi-packet transaction', '881' => 'Intermediate packet of a multi-packet transaction', '889' => 'MAC key sync error', '898' => 'Bad MAC value', '899' => 'Bad sequence number - resend transaction', '900' => 'Capture - PIN Tries Exceeded', '901' => 'Capture - Expired Card', '902' => 'Capture - NEG Capture', '903' => 'Capture - CAF Status 3', '904' => 'Capture - Advance < Minimum', '905' => 'Capture - Num Times Used', '906' => 'Capture - Delinquent', '907' => 'Capture - Over Limit Table', '908' => 'Capture - Amount Over Maximum', '909' => 'Capture - Capture', '960' => 'Initialization failure - merchant number mismatch', '961' => 'Initialization failure -pinpad  mismatch', '963' => 'No match on Poll code', '964' => 'No match on Concentrator ID', '965' => 'Invalid software version number', '966' => 'Duplicate terminal name');
        if ($ResponseArray[$ResponseCode]) {
            return $ResponseArray[$ResponseCode];
        } else {
            return '';
        }
    }
}
function moneris_get_member_links($user)
{
    return cc_core_get_member_links('moneris', $user);
}
function moneris_rebill()
{
    return cc_core_rebill('moneris');
}
//if($_SERVER['REMOTE_ADDR']=='82.116.39.130')
cc_core_init('moneris');
Example #14
0
    {
        global $config;
        $log = array();
        //////////////////////// cc_bill /////////////////////////
        if ($charge_type == CC_CHARGE_TYPE_TEST) {
            return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
        }
        $vars_l = $vars;
        $vars_l['trnCardNumber'] = $cc_info['cc'];
        /////
        $obj = new electronic_payment($this->config['customer_id'], round($amount * 100, 0), $cc_info['cc_name_f'], $cc_info['cc_name_l'], $member['email'], $cc_info['cc_street'], $cc_info['cc_zip'], $product_description, $payment['payment_id'], $cc_info['cc_type'], $cc_info['cc_number'], substr($cc_info['cc-expire'], 0, 2), substr($cc_info['cc-expire'], 2, 2));
        $obj->xml_request = str_replace($cc_info['cc_number'], $cc_info['cc'], $obj->xml_request);
        $log[] = array('REQUEST' => $obj->xml_request);
        $log[] = array('RESPONSE' => $obj->xml_response);
        if ($obj->trxn_status() == 'True') {
            return array(CC_RESULT_SUCCESS, "", $obj->trxn_number(), $log);
        } else {
            return array(CC_RESULT_DECLINE_PERM, $obj->trxn_error(), "", $log);
        }
    }
}
function eway_get_member_links($user)
{
    return cc_core_get_member_links('eway', $user);
}
function eway_rebill()
{
    return cc_core_rebill('eway');
}
cc_core_init('eway');
        }
        $vars_l['ccnumber'] = $cc_info['cc'];
        if ($vars['ccnumber']) {
            $vars_l['ccnumber'] = preg_replace('/./', '*', $vars['ccnumber']);
        }
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['response'] == '1') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($res['transactionid'], $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['transactionid'], $log);
        } elseif ($res['response'] == '2') {
            return array(CC_RESULT_DECLINE_PERM, $res['responsetext'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['responsetext'], "", $log);
        }
    }
}
function merchantone_get_member_links($user)
{
    return cc_core_get_member_links('merchantone', $user);
}
function merchantone_rebill()
{
    return cc_core_rebill('merchantone');
}
cc_core_init('merchantone');
            $vars1[] = "{$k}={$v}";
        }
        $vars1 = join('&', $vars1);
        $ret = cc_core_get_url("https://transactions.innovativegateway.com/servlet/com.gateway.aai.Aai", $vars1);
        $rArr = explode("|", $ret);
        $res = array();
        for ($i = 0; $i < count($rArr); $i++) {
            $tmp2 = explode("=", $rArr[$i]);
            // YES, we put all returned field names in lowercase
            $tmp2[0] = strtolower($tmp2[0]);
            // YES, we strip out HTML tags.
            $res[$tmp2[0]] = strip_tags($tmp2[1]);
        }
        $log[] = $res;
        if ($res['approval'] && !$res['error']) {
            return array(CC_RESULT_SUCCESS, "", $res['anatransid'], $log);
        } else {
            return array(CC_RESULT_DECLINE_PERM, $res['error'], "", $log);
        }
    }
}
function innovative_get_member_links($user)
{
    return cc_core_get_member_links('innovative', $user);
}
function innovative_rebill()
{
    return cc_core_rebill('innovative');
}
cc_core_init('innovative');
        foreach ($vars as $kk => $vv) {
            $v = urlencode($vv);
            $k = urlencode($kk);
            $vars1[] = "{$k}={$v}";
        }
        $vars1 = join('&', $vars1);
        $ret = cc_core_get_url($this->config["url"] . "cgi/service/report.cgi", $vars1);
        return $ret;
    }
    function payment_adultprocessor($config)
    {
        parent::payment($config);
        add_product_field('adultprocessor_siteid', 'Adultprocessor Site ID', 'text', '', '');
        add_product_field('adultprocessor_scheduleid', 'Adultprocessor Schedule ID', 'text', '', '');
    }
    function get_cancel_link($payment_id)
    {
        global $db;
        return cc_core_get_cancel_link('secpay', $payment_id);
    }
}
function adultprocessor_get_member_links($user)
{
    //return cc_core_get_member_links('adultprocessor', $user);
}
function adultprocessor_rebill()
{
    return cc_core_rebill('adultprocessor');
}
cc_core_init('adultprocessor');
{
    $error = "";
    //check periods
    if ($p->config['is_recurring']) {
        list($period, $period_unit) = google_checkout_get_days($p->config['expire_days']);
        if ($period_unit == 'D' && !in_array($period, array(1, 7))) {
            $error = "Google Checkout allows only Daily and Weekly subscriptions. ";
        }
        if ($period_unit == 'W' && !in_array($period, array(1, 2))) {
            $error = "Google Checkout allows only Weekly and Semi-monthly subscriptions. ";
        }
        if ($period_unit == 'M' && !in_array($period, array(1, 2, 4))) {
            $error = "Google Checkout allows only Monthly, Every two months and Quarterly subscriptions. ";
        }
        if ($period_unit == 'Y' && $period != '1') {
            $error = "Google Checkout allows only Yearly subscriptions. ";
        }
    }
    return $error;
}
//$pl = & instantiate_plugin('payment', 'google_checkout');
function google_checkout_get_member_links($user)
{
    //return cc_core_get_member_links('google_checkout', $user);
}
function google_checkout_rebill()
{
    return cc_core_rebill('google_checkout');
}
cc_core_init('google_checkout');
        if ($cc_info['cc_name_f'] == '') {
            $cc_info['cc_name_f'] = $member['name_f'];
            $cc_info['cc_name_l'] = $member['name_l'];
        }
        $amount *= 100;
        $street = $cc_info['cc_street'] ? $cc_info['cc_street'] : $member['street'];
        $zip = $cc_info['cc_zip'] ? $cc_info['cc_zip'] : $member['zip'];
        $mac = md5($this->config['merchant_id'] . $payment['payment_id'] . $amount . $this->config['secret']);
        $vars = array("Merchant_Number" => $this->config['merchant_id'], "Card_Details_Transmit" => 1, "Device_Category" => 1, "Order_Number" => $payment['payment_id'], "Ecom_Payment_Card_Number" => $cc_info['cc_number'], "Ecom_Payment_Card_ExpDate_Month" => substr($cc_info['cc-expire'], 0, 2), "Ecom_Payment_Card_ExpDate_Year" => '20' . substr($cc_info['cc-expire'], 2, 2), "Amount" => $amount, "Currency_Code" => 978, "Success_Url" => $config[root_url] . "/plugins/payment/luottokunta/ipn.php?pid=" . $payment['payment_id'] . "&amount=" . $amount, "Failure_Url" => $config[root_url] . "/plugins/payment/luottokunta/ipn.php?pid=" . $payment['payment_id'] . "&amount=" . $amount, "Transaction_Type" => 1, "Authentication_Mac" => $mac);
        if ($cc_info['cc_code']) {
            $vars['Ecom_Payment_Card_Verification'] = $cc_info['cc_code'];
        }
        // prepare log record
        $vars_l = $vars;
        if ($vars['Ecom_Payment_Card_Verification']) {
            $vars_l['Ecom_Payment_Card_Verification'] = preg_replace('/./', '*', $vars['CVC']);
        }
        $log[] = $vars_l;
        $res = $this->run_transaction($vars);
    }
}
function luottokunta_get_member_links($user)
{
    return cc_core_get_member_links('luottokunta', $user);
}
function luottokunta_rebill()
{
    exit;
}
cc_core_init('luottokunta');
        preg_match_all('!^(\\w+)\\=(.+?)$!m', $ret, $regs);
        $res = array();
        foreach ($regs[1] as $i => $k) {
            $res[$k] = $regs[2][$i];
        }
        $log[] = $res;
        if ($res['summary_code'] == '0') {
            return array(CC_RESULT_SUCCESS, "", $res['payment_number'], $log);
        } elseif ($res['summary_code'] == 3) {
            $err = $res['response_text'] ? $res['response_text'] : "internal error, please repeat payment later";
            return array(CC_RESULT_INTERNAL_ERROR, $err, "", $log);
        } elseif ($res['summary_code'] == 2) {
            $err = $res['response_text'] ? $res['response_text'] : "card declined";
            return array(CC_RESULT_DECLINE_PERM, $err, "", $log);
        } else {
            // ($res['summary_code'] == 1) {
            $err = $res['response_text'] ? $res['response_text'] : "card declined";
            return array(CC_RESULT_DECLINE_PERM, $err, "", $log);
        }
    }
}
function directone_get_member_links($user)
{
    return cc_core_get_member_links('directone', $user);
}
function directone_rebill()
{
    return cc_core_rebill('directone');
}
cc_core_init('directone');
Example #21
0
        }
        $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");
    }
    function secpay_error($msg)
    {
        global $txn_id, $invoice;
        global $vars;
        fatal_error("Secpay ERROR: {$msg} (Details: transID: {$vars['MD']}, payment_id: {$invoice})");
    }
}
function secpay_get_member_links($user)
{
    return cc_core_get_member_links('secpay', $user);
}
function secpay_rebill()
{
    return cc_core_rebill('secpay');
}
cc_core_init('secpay');
            $t->assign('product', $product);
            $t->assign('user', $member);
            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);
                $subtotal += $v['price'];
                $pr[$product_id] = $v;
            }
            $t->assign('subtotal', $subtotal);
            $t->assign('total', array_sum($prices));
            $t->assign('products', $pr);
            $t->display($config['root_dir'] . "/plugins/payment/manual_cc/thanks.html");
            exit;
        }
        return array(CC_RESULT_IGNORE, "", "", array());
    }
}
function manual_cc_get_member_links($user)
{
    return cc_core_get_member_links('manual_cc', $user);
}
function manual_cc_rebill()
{
    return cc_core_rebill('manual_cc');
}
cc_core_init('manual_cc');
        $vars_l = $vars;
        $vars_l['x_Card_Num'] = $cc_info['cc'];
        if ($vars['x_Card_Code']) {
            $vars_l['x_Card_Code'] = preg_replace('/./', '*', $vars['x_Card_Code']);
        }
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['RESULT'] == '1') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($res['PNREF'], $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif ($res['RESULT'] == '2') {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'], "", $log);
        }
    }
}
function authorize_aim_get_member_links($user)
{
    return cc_core_get_member_links('authorize_aim', $user);
}
function authorize_aim_rebill()
{
    return cc_core_rebill('authorize_aim');
}
cc_core_init('authorize_aim');
        if ($cc_info['cc_code']) {
            $vars['cvv'] = $cc_info['cc_code'];
        }
        $resp = $this->run_transaction($vars);
        if ($resp['response'] == 1 && $resp['customer_vault_id']) {
            $member['data']['inspirepay_customer_vault_id'] = $resp['customer_vault_id'];
            $db->update_user($member['member_id'], $member);
        }
        return $resp;
    }
    function update_customer($member, $cc_info)
    {
        global $db;
        $vars = array('customer_vault' => 'update_customer', 'customer_vault_id' => $member['data']['inspirepay_customer_vault_id'], 'username' => $this->config['login'], 'password' => $this->config['pass'], 'ccnumber' => $cc_info['cc_number'], 'ccexp' => $cc_info['cc-expire'], 'email' => $member['email'], 'firstname' => $cc_info['cc_name_f'], 'lastname' => $cc_info['cc_name_l'], 'address1' => $cc_info['cc_street'], 'city' => $cc_info['cc_city'], 'state' => $cc_info['cc_state'], 'zip' => $cc_info['cc_zip'], 'country' => $cc_info['cc_country'], 'ipaddress' => $member['remote_addr'] ? $member['remote_addr'] : $_SERVER['REMOTE_ADDR'], 'phone' => $cc_info['cc_phone']);
        if ($cc_info['cc_code']) {
            $vars['cvv'] = $cc_info['cc_code'];
        }
        $resp = $this->run_transaction($vars);
        return $resp;
    }
}
function inspirepay_get_member_links($user)
{
    return cc_core_get_member_links('inspirepay', $user);
}
function inspirepay_rebill()
{
    return cc_core_rebill('inspirepay');
}
cc_core_init('inspirepay');
add_member_field("inspirepay_customer_vault_id", "Inspire Pay Customer Vault ID", "text");
            $vars_l['CV2'] = preg_replace('/./', '*', $vars['CV2']);
        }
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['RESULT'] == 'OK') {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($vars, $res, $log);
            }
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif ($res['RESULT'] == 'NOTAUTHED') {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'], "", $log);
        }
    }
    function run_refund($vars)
    {
    }
}
function protxdirect_get_member_links($user)
{
    return cc_core_get_member_links('protxdirect', $user);
}
function protxdirect_rebill()
{
    return cc_core_rebill('protxdirect');
}
cc_core_init('protxdirect');
        $vars = array('account_id' => $this_config['account_id'], 'pay_type' => 'C', 'tran_type' => $auth_type, 'purch_order' => $payment['payment_id'], 'amount' => $amount, 'tax_amount' => 0, 'ship_amount' => 0, 'description' => $product['title'], 'card_number' => $cc_info['cc_number'], 'card_cvv2' => $cc_info['cc_code'], 'card_expire' => $cc_info['cc-expire'], 'bill_name1' => $cc_info['cc_name_f'], 'bill_name2' => $cc_info['cc_name_l'], 'bill_street' => $cc_info['cc_street'], 'bill_city' => $cc_info['cc_city'], 'bill_zip' => $cc_info['cc_zip'], 'bill_country' => $cc_info['cc_country'], 'bill_state' => $cc_info['cc_state'], 'cust_phone' => $cc_info['cc_phone'], 'cust_ip' => $ip, 'cust_host' => gethostbyaddr($ip), 'cust_browser' => $_SERVER['HTTP_USER_AGENT'], 'cust_email' => $member['email']);
        // prepare log record
        $vars_l = $vars;
        $vars_l['card_number'] = $cc_info['cc'];
        if ($vars['card_cvv2']) {
            $vars_l['card_cvv2'] = preg_replace('/./', '*', $vars['card_cvv2']);
        }
        $log[] = $vars_l;
        /////
        $db->log_error("NetBilling DEBUG:<br />" . netbilling_cc_get_dump($vars_l));
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['RESULT'] == '1' || $res['RESULT'] == 'T' && $charge_type == CC_CHARGE_TYPE_TEST) {
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif ($res['RESULT'] == '0') {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        }
    }
}
function netbilling_cc_get_member_links($user)
{
    return cc_core_get_member_links('netbilling_cc', $user);
}
function netbilling_cc_rebill()
{
    return cc_core_rebill('netbilling_cc');
}
cc_core_init('netbilling_cc');
        $log[] = $res;
        if ($res["error_code"] === '000') {
            if (!$member['data']['esolutions_card_id']) {
                $member['data']['esolutions_card_id'] = $res["transaction_id"];
            }
            $member['esolutions_card_id'] = $res["transaction_id"];
            $db->update_user($member['member_id'], $member);
            $this->log = $log;
            return;
        } elseif ($res["error_code"] === '999') {
            return array(CC_RESULT_INTERNAL_ERROR, $res['auth_response_text'], "", $log);
        } else {
            return array(CC_RESULT_DECLINE_PERM, $res["auth_response_text"], "", $log);
        }
    }
    function payment_esolutions($config)
    {
        parent::payment($config);
        add_member_field('esolutions_card_id', 'Esolutions Customer Card Id', '', '');
    }
}
function esolutions_get_member_links($user)
{
    return cc_core_get_member_links('esolutions', $user);
}
function esolutions_rebill()
{
    return cc_core_rebill('esolutions');
}
cc_core_init('esolutions');
Example #28
0
        $vars_l['number'] = $cc_info['cc'];
        if ($vars['cvn']) {
            $vars_l['cvn'] = preg_replace('/./', '*', $vars['cvn']);
        }
        $log[] = $vars_l;
        /////
        $db->log_error("RealEx DEBUG:<br />" . realex_get_dump($vars_l));
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if (preg_match("/Approved/i", $res['RESULT'])) {
            if ($charge_type == CC_CHARGE_TYPE_TEST) {
                $this->void_transaction($res['PNREF'], $log, $res['TRANSID'], $vars, $cc_info['cc']);
            }
            return array(CC_RESULT_SUCCESS, "", $res['PNREF'], $log);
        } elseif (preg_match("/Declined/i", $res['RESULT'])) {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPMSG'] ? $res['RESPMSG'] : $res['RESULT'], "", $log);
        }
    }
}
function realex_get_member_links($user)
{
    return cc_core_get_member_links('realex', $user);
}
function realex_rebill()
{
    return cc_core_rebill('realex');
}
cc_core_init('realex');
        $log = array();
        //////////////////////// cc_bill /////////////////////////
        $cc_info['cc-expire'] = sprintf('%02d/%02d', $cc_info['cc_expire_Month'], substr($cc_info['cc_expire_Year'], 2, 2));
        srand(time());
        $vars = array("LOGIN" => $this->config['login'] . "/" . $this->config['password'], "AMOUNT" => $amount, "CCNUM" => $cc_info['cc_number'], "CCEXP" => $cc_info['cc-expire'], "COMMAND" => "purchase", "COMMENT" => "Invoicenum_" . $payment['payment_id'] . '-' . rand(100, 999) . "__Customerid_" . $member['member_id']);
        // prepare log record
        $vars_l = $vars;
        $vars_l['CCNUM'] = preg_replace('/./', '*', $vars['CCNUM']);
        $log[] = $vars_l;
        /////
        $res = $this->run_transaction($vars);
        $log[] = $res;
        if ($res['RESULT_CODE'] == 'approved') {
            return array(CC_RESULT_SUCCESS, "", $res['TXN_REF'], $log);
        } elseif ($res['RESULT_CODE'] == 'declined') {
            return array(CC_RESULT_DECLINE_PERM, $res['RESPONSE_TEXT'], "", $log);
        } else {
            return array(CC_RESULT_INTERNAL_ERROR, $res['RESPONSE_TEXT'], "", $log);
        }
    }
}
function netregistry_get_member_links($user)
{
    return cc_core_get_member_links('netregistry', $user);
}
function netregistry_rebill()
{
    return cc_core_rebill('netregistry');
}
cc_core_init('netregistry');
Example #30
0
        global $db;
        return cc_core_get_cancel_link('cc_demo', $payment_id);
    }
    function get_plugin_features()
    {
        return array('title' => $config['payment']['cc_demo']['title'] ? $config['payment']['cc_demo']['title'] : _PLUG_PAY_CC_DEMO_TITLE, 'description' => $config['payment']['cc_demo']['description'] ? $config['payment']['cc_demo']['description'] : _PLUG_PAY_CC_DEMO_DESCR, 'phone' => 2, 'code' => 1, 'name' => 2);
    }
    /*************************************************************
         cc_bill - do real cc bill
       ***************************************************************/
    function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
    {
        global $config;
        $log = array();
        if ($cc_info['cc_number'] == '4111111111111111') {
            return array(CC_RESULT_SUCCESS, "", "123456", $log);
        } else {
            return array(CC_RESULT_DECLINE_PERM, _PLUG_PAY_CC_DEMO_CCNUM, "", $log);
        }
    }
}
function cc_demo_get_member_links($user)
{
    return cc_core_get_member_links('cc_demo', $user);
}
function cc_demo_rebill()
{
    return cc_core_rebill('cc_demo');
}
cc_core_init('cc_demo');