function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://pay1.plugnpay.com/payment/pnpremote.cgi", $vars1);
     parse_str($ret, $res);
     global $db;
     $db->log_error("PlugNPay RESPONSE:<br />" . plugnpay_get_dump($res));
     switch ($res['FinalStatus']) {
         case 'success':
             $return['RESULT'] = 'Approved';
             break;
         case 'fraud':
         case 'badcard':
             $return['RESULT'] = 'Declined';
             break;
         case 'problem':
             $return['RESULT'] = 'Problem';
             break;
     }
     $return['RESPMSG'] = $res['MErrMsg'] ? $res['MErrMsg'] : $res['auth-msg'];
     // There is no 'auth-msg' returned
     $return['RESPMSG'] = join("<br />\n", preg_split('/\\|/', $return['RESPMSG']));
     $return['AVS'] = $res['avs-code'];
     $return['PNREF'] = $res['auth-code'];
     $return['CVV_VALID'] = $res['cvvresp'];
     $return['ORDERID'] = $res['orderID'];
     // Unique numeric order id used to identify transaction for any future activity including voids and returns.
     return $return;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     if ($this->config['testing']) {
         $url = "https://test.safecharge.com/processtrans.asp";
     } else {
         $url = "https://process.safecharge.com/processtrans.asp";
     }
     $ret = cc_core_get_url($url, $vars1);
     $res = $this->parse_response($ret);
     global $db;
     $db->log_error("SafeCharge RESPONSE:<br />" . safecharge_get_dump($res));
     $return['RESULT'] = $res['Status'];
     // Approved, Success, Declined, Error, Pending
     $return['RESPMSG'] = preg_match("/Error/i", $res['Status']) ? "[" . $res['ErrCode'] . "][" . $res['ExErrCode'] . "] " . $res['Reason'] : '';
     $return['AVS'] = $res['AVSCode'];
     $return['PNREF'] = $res['AuthCode'];
     $return['CVV_VALID'] = $res['CVV2Reply'];
     $return['TRANSID'] = $res['TransactionID'];
     // A 64-bit unique integer generated by the Gateway in order to identify each transaction.
     return $return;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://4tknox.au.com/cgi-bin/themerchant.au.com/ecom/external2.pl", $vars1);
     $delim = "\n";
     $arr = preg_split("({$delim})", $ret);
     $res["RESULT_CODE"] = strtolower($arr[0]);
     if (@strpos($ret, "{$delim}.{$delim}") === false) {
         $res["RESPONSE_TEXT"] = $arr[1];
     } else {
         $ret = substr($ret, @strpos($ret, "{$delim}.{$delim}"));
         $ret = str_replace($delim, "&", $ret);
         parse_str($ret, $ret);
         $res["RESPONSE_TEXT"] = $ret["response_text"];
         $res["TXN_REF"] = $ret["txn_ref"];
         $res["RESPONSE_CODE"] = $ret["response_code"];
         $res["RESULT"] = $ret["result"];
     }
     //var_dump($res);
     return $res;
 }
Example #4
0
 function run_transaction($vars)
 {
     $request = "<request timestamp=\"" . $vars['timestamp'] . "\" type=\"" . $vars['auth_type'] . "\">\n            <merchantid>" . $vars['merchantid'] . "</merchantid>\n        ";
     if ($vars['account']) {
         $request .= "<account>" . $vars['account'] . "</account>";
     }
     $request .= "\n            <orderid>" . $vars['orderid'] . "</orderid>\n            <amount currency=\"" . $vars['currency'] . "\">" . $vars['amount'] . "</amount>\n            <card>\n                <number>" . $vars['number'] . "</number>\n                <expdate>" . $vars['expdate'] . "</expdate>\n                <chname>" . $vars['chname'] . "</chname>\n                <type>" . $vars['type'] . "</type>\n        ";
     if ($vars['issueno'] && $vars['type'] == 'SWITCH') {
         $request .= "<issueno>" . $vars['issueno'] . "</issueno>";
     }
     if ($vars['cvn']) {
         $request .= "\n                <cvn>\n                    <number>" . $vars['cvn'] . "</number>\n                    <presind>1</presind>\n                </cvn>\n            ";
     }
     $request .= "\n            </card>\n            <autosettle flag=\"1\" />\n            <comments>\n                <comment id=\"1\">" . $vars['comment'] . "</comment>\n            </comments>\n            <tssinfo>\n                <custnum>" . $vars['member_id'] . "</custnum>\n                <prodid>" . $vars['product_id'] . "</prodid>\n                <varref>" . $vars['payment_id'] . "</varref>\n                <custipaddress>" . $vars['ip'] . "</custipaddress>\n                <address type=\"billing\">\n                    <code>" . $vars['zip'] . "</code>\n                    <country>" . $vars['country'] . "</country>\n                </address>\n                <address type=\"shipping\">\n                    <code>" . $vars['zip'] . "</code>\n                    <country>" . $vars['country'] . "</country>\n                </address>\n            <country>" . $vars['country'] . "</country>\n            </tssinfo>\n        ";
     if ($vars['md5hash']) {
         $request .= "<md5hash>" . $vars['md5hash'] . "</md5hash>";
     } else {
         $request .= "<sha1hash>" . $vars['sha1hash'] . "</sha1hash>";
     }
     $request .= "\n        </request>\n        ";
     $url = "https://epage.payandshop.com/epage-remote.cgi";
     $ret = cc_core_get_url($url, $request);
     $res = $this->parse_response($ret);
     global $db;
     $db->log_error("RealEx RESPONSE:<br />" . realex_get_dump($res));
     $hash = $res['timestamp'] . "." . $res['merchantid'] . "." . $res['orderid'] . "." . $res['result'] . "." . $res['message'] . "." . $res['pasref'] . "." . $res['authcode'];
     $response_valid = false;
     if ($res['md5hash']) {
         $hash = md5($hash);
         $hash = $hash . "." . $this_config['secret'];
         $hash = md5($hash);
         if ($res['md5hash'] == $hash) {
             $response_valid = true;
         }
     } else {
         $hash = sha1($hash);
         $hash = $hash . "." . $this_config['secret'];
         $hash = sha1($hash);
         if ($res['sha1hash'] == $hash) {
             $response_valid = true;
         }
     }
     if ($response_valid) {
         if ($res['result'] == '00') {
             $return['RESULT'] = 'Approved';
         } else {
             $return['RESULT'] = 'Declined';
         }
     } else {
         $return['RESULT'] = 'Invalid';
     }
     $return['RESPMSG'] = $res['message'];
     $return['PNREF'] = $res['pasref'];
     $return['CVV_VALID'] = $res['cvnresult'];
     $return['TRANSID'] = $res['authcode'];
     return $return;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://webservice.paymentxp.com/wh/WebHost.aspx", $vars1);
     parse_str($ret, $res);
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://test.merchante-solutions.com/mes-api/tridentApi", $vars1);
     parse_str($ret, $arr);
     return $arr;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://secure.braintreepaymentgateway.com/api/transact.php", $vars1);
     parse_str($ret, $res);
     return $res;
 }
 function run_transaction($vars)
 {
     global $db;
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://migs.mastercard.com.au/vpcdps", $vars1);
     parse_str($ret, $arr);
     $result = -1;
     // undefined
     $response = "";
     switch ($arr['vpc_TxnResponseCode']) {
         case '0':
             $result = 1;
             $response = "Transaction approved";
             break;
         case '1':
             $response = "Transaction could not be processed";
             break;
         case '2':
             $result = 2;
             $response = "Transaction declined - contact issuing bank";
             break;
         case '3':
             $response = "No reply from Processing Host";
             break;
         case '4':
             $response = "Card has expired";
             break;
         case '5':
             $response = "Insufficient credit";
             break;
         case '6':
             $response = "Error Communicating with Bank";
             break;
         case '7':
             $response = "Message Detail Error Invalid PAN, Invalid Expiry Date";
             break;
         case '8':
             $response = "Transaction declined – transaction type not supported";
             break;
         case '9':
             $response = "Bank Declined Transaction – Do Not Contact Bank";
     }
     if ($arr['vpc_TxnResponseCode'] != '0') {
         $db->log_error("MIGS CC Error: payment_id=" . $arr['vpc_OrderInfo'] . ", code=" . $arr['vpc_TxnResponseCode'] . " (" . $response . "), message='" . $arr['vpc_Message'] . "'");
     }
     $res = array('RESULT' => $result, 'RESPMSG' => $response, 'AMOUNT' => $arr['vpc_Amount'], 'INVOICE' => $arr['vpc_OrderInfo'], 'PNREF' => $arr['vpc_TransactionNo']);
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://secure.networkmerchants.com/gw/api/transact.php", $vars1);
     parse_str($ret, $res);
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://www.sagepayments.net/cgi-bin/eftBankcard.dll?transaction", $vars1);
     $res = array('ApprovalIndicator' => @substr($ret, 1, 1), 'Code' => @substr($ret, 2, 6), 'Message' => @substr($ret, 8, 32), 'CVVIndicator' => @substr($ret, 42, 1), 'AVSIndicator' => @substr($ret, 43, 1), 'RiskIndicator' => @substr($ret, 44, 2), 'Reference' => @substr($ret, 46, 10));
     return $res;
 }
Example #11
0
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://secure.epx.com/", $vars1);
     //        $ret = cc_core_get_url("https://secure.epxuap.com/", $vars1);
     $res = array('AUTH_RESP' => $this->from_res("AUTH_RESP", $ret), 'AUTH_GUID' => $this->from_res("AUTH_GUID", $ret), 'AUTH_CODE' => $this->from_res("AUTH_CODE", $ret), 'AUTH_AVS' => $this->from_res("AUTH_AVS", $ret), 'AUTH_CVV2' => $this->from_res("AUTH_CVV2", $ret), 'AUTH_RESP_TEXT' => $this->from_res("AUTH_RESP_TEXT", $ret), 'AUTH_CARD_TYPE' => $this->from_res("AUTH_CARD_TYPE", $ret), 'TRAN_TYPE' => $this->from_res("TRAN_TYPE", $ret));
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("http://trans.atsbank.com/cgi-bin/trans.cgi", $vars1);
     $arr = preg_split('/\\|/', $ret);
     $res = array('RESULT' => $arr[0], 'RESULT_SUB' => $arr[1], 'REASON_CODE' => $arr[2], 'RESPMSG' => $arr[3], 'AVS' => $arr[5], 'PNREF' => $arr[6], 'CVV_VALID' => $arr[48]);
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://secure.authorize.net/gateway/transact.dll", $vars1);
     $ret = str_replace("\"", "", $ret);
     $arr = preg_split('/\\|/', $ret);
     $res = array('RESULT' => $arr[0], 'RESULT_SUB' => $arr[1], 'REASON_CODE' => $arr[2], 'RESPMSG' => $arr[3], 'AVS' => $arr[5], 'PNREF' => $arr[6], 'CVV_VALID' => $arr[48]);
     return $res;
 }
Example #14
0
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://authorize.mscsecure.com/gateway/authorize.asp", $vars1);
     $ret = str_replace("\"", "", $ret);
     $arr = preg_split('/\\|/', $ret);
     $res = array('IsError' => $arr[0], 'ErrorText' => $arr[1], 'ResponseCode' => $arr[2], 'ResponseText' => $arr[3], 'AuthCode' => $arr[4], 'AVSCode' => $arr[5], 'TransactionID' => $arr[6]);
     return $res;
 }
Example #15
0
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     $vars = array("vendor_id" => $this->config['user'], "vendor_password" => $this->config['pass'], 'first_name' => $cc_info['cc_name_f'], 'last_name' => $cc_info['cc_name_l'], 'ccnum' => $cc_info['cc_number'], 'ccmo' => substr($cc_info['cc-expire'], 0, 2), 'ccyr' => '20' . substr($cc_info['cc-expire'], 2, 2), 'email' => $member['email'], 'phone' => $cc_info['cc_phone'], 'address' => $cc_info['cc_street'], 'city' => $cc_info['cc_city'], 'state' => $cc_info['cc_state'], 'zip' => $cc_info['cc_zip'], 'country' => $cc_info['cc_country']);
     if ($cc_info['cc_code']) {
         $vars['cccode'] = $cc_info['cc_code'];
     }
     ////// fill-in products list
     if ($payment['data'][0]['BASKET_PRODUCTS']) {
         $product_ids = (array) $payment['data'][0]['BASKET_PRODUCTS'];
         $prices = $payment['data'][0]['BASKET_PRICES'];
     } else {
         $product_ids = array($payment['product_id']);
         $prices = array($payment['product_id'] => $payment['amount']);
     }
     $products = array();
     foreach ($product_ids as $pid) {
         global $db;
         $pr = $db->get_product($pid);
         $pr['price'] = $prices[$pid];
         $products[] = $pr;
     }
     $vars1 = $this->makeXMLRequest($vars, $products);
     $vars_l = str_replace($cc_info['cc_number'], $cc_info['cc'], $vars1);
     $vars_l = preg_replace("|<CCNum>(.+?)</CCNum>|", "<CCNum>{$cc_info['cc']}</CCNum>", $vars_l);
     $vars_l = str_replace("<CVV2Number>" . $cc_info['cc_code'], '<CVV2Number>***', $vars_l);
     $vars_l = preg_replace("|<VendorPassword>(.+?)</VendorPassword>|", "<VendorPassword>***</VendorPassword>", $vars_l);
     $log[] = array('xml' => nl2br(str_replace('<', '&lt;', $vars_l)));
     $vars1 = urlencode($vars1);
     $ret = cc_core_get_url("https://secure.paymentclearing.com/cgi-bin/rc/xmltrans.cgi", 'xml=' . $vars1);
     $ret = str_replace(" standalone=\"yes\"", "", $ret);
     $res = $this->xml_ParseXML($ret);
     $ret = str_replace('<', '&lt;', $ret);
     $ret = preg_replace('/(&lt;\\/\\w+>)/', "\\1<br />\n", $ret);
     $log[] = array('ret' => $ret);
     $r = $res['SaleResponse'][0]['TransactionData'][0];
     if ($r['Status'][0] == 'OK') {
         return array(CC_RESULT_SUCCESS, "", $r['XID'][0], $log);
     } elseif ($r['Status'][0] == 'FAILED') {
         return array(CC_RESULT_DECLINE_TEMP, $r['ErrorMessage'][0], "", $log);
     } else {
         return array(CC_RESULT_DECLINE_PERM, $r['ErrorMessage'][0], "", $log);
     }
 }
 function run_transaction($vars)
 {
     global $db;
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://www.merchantplanb.com:444/proc/zproc_planb.asp", $vars1);
     $arr = preg_split('/\\|/', $ret);
     $res = array("RESULT" => $arr[0], "RESULT_TEXT" => $arr[1], "PNREF" => $arr[2], "RESPMSG" => $arr[3]);
     $db->log_error("MerchantPlanb RESPONSE:<br />\n" . merchantplanb_get_dump($res));
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://secure.quickpay.dk/api", $vars1);
     $res = array("msgtype", "ordernumber", "amount", "time", "state", "chstat", "qpstat", "qpstatmsg", "merchantemail", "merchant", "transaction", "cardtype", "md5check");
     foreach ($res as $one) {
         $result[$one] = $this->from_res($one, $ret);
     }
     return $result;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://www.firstpay.net/vt/consumer_auth_txt.asp", $vars1);
     if ($ret == "Invalid") {
         return array("RESULT" => "Invalid", "RESPMSG" => "Invalid info", "MESSAGE" => $ret);
     }
     $arr = preg_split('/\\,/', $ret);
     $res = array('RESULT' => $arr[1], 'RESPMSG' => $arr[2], 'RESPONSECODE' => $arr[3], 'PNREF' => $arr[3]);
     return $res;
 }
 function run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://www.myvirtualmerchant.com/VirtualMerchant/process.do", $vars1, true);
     $res = array();
     $pattern = '/([_A-Za-z0-9\\-]+)=(.*)(\\n|$)/';
     preg_match_all($pattern, $ret, $match, PREG_SET_ORDER);
     foreach ($match as $m) {
         $res[$m[1]] = trim($m[2]);
     }
     return $res;
 }
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     $vars = array('vendor_name' => $this->config['account_name'], 'vendor_password' => $this->config['account_pass'], 'card_number' => $cc_info['cc_number'], 'card_type' => 'AUTO', 'card_expiry' => $cc_info['cc-expire'], 'card_holder' => $cc_info['cc_name_f'] . " " . $cc_info['cc_name_l'], 'payment_amount' => round($amount * 100), 'payment_reference' => $payment['payment_id']);
     // prepare log record
     $vars_l = $vars;
     $vars_l['card_number'] = $cc_info['cc'];
     $vars_l['vendor_password'] = preg_replace('/./', '*', $vars_l['vendor_password']);
     $log[] = $vars_l;
     /////
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     if ($this->config['testing']) {
         $ret = cc_core_get_url("https://vault.safepay.com.au/cgi-bin/direct_test.pl?{$vars1}");
     } else {
         $ret = cc_core_get_url("https://vault.safepay.com.au/cgi-bin/direct_process.pl?{$vars1}");
     }
     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 run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url($s = "https://ipayment.de/merchant/" . $this->config["account_id"] . "/processor.php", $vars1);
     if (preg_match('/^Status=(.+)\\s?[\\r\\n]/', $ret, $args)) {
         $status = $args[1];
     }
     $ret = preg_replace("/^Status=.+?Params=/ms", "", $ret);
     parse_str($ret, $res);
     $res['status'] = $status;
     return $res;
 }
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     srand(time());
     $vars = array('MerchantId' => $this->config['merchant_id'], 'CustomerId' => $this->config['customer_id'], 'ZoneId' => $this->config['zone_id'], 'Username' => $this->config['username'], 'InvoiceNumber' => $payment['payment_id'] . '-' . rand(1000, 9999), 'CustomerNumber' => $member['member_id'], 'Amount' => $amount, 'TransactionType' => 'C', 'CardName' => $cc_info['cc_name'], 'CardNumber' => $cc_info['cc_number'], 'ExpiryMM' => substr($cc_info['cc-expire'], 0, 2), 'ExpiryYY' => substr($cc_info['cc-expire'], 2, 2), 'Email' => $member['email'], 'Phone' => $cc_info['cc_phone'], 'Address' => $cc_info['cc_street'], 'City' => $cc_info['cc_city'], 'State' => $cc_info['cc_state'], 'Zip' => $cc_info['cc_zip'], 'Country' => $cc_info['cc_country'], 'AVSON' => 'Y', 'EterminalID' => '');
     if ($cc_info['cc_code']) {
         $vars['CVV'] = $cc_info['cc_code'];
     }
     // prepare log record
     $vars_l = $vars;
     $vars_l['CardNumber'] = $cc_info['cc'];
     if ($vars['CVV']) {
         $vars_l['CVV'] = preg_replace('/./', '*', $vars['trnCardCvd']);
     }
     $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://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 run_transaction($vars)
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $ret = cc_core_get_url("https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp", $vars1);
     foreach (split("&", $ret) as $line) {
         list($k, $v) = split("=", $line);
         $res[$k] = $v;
     }
     $res['RESULT'] = $res[Auth];
     $res['RESPMSG'] = $res[Notes];
     $res['AVS'] = $res[AVSCode];
     $res['PNREF'] = $res[TransID];
     return $res;
 }
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     $vars = array('ePNAccount' => $this->config['account'], 'CardNo' => $cc_info['cc_number'], 'ExpMonth' => substr($cc_info['cc-expire'], 0, 2), 'ExpYear' => substr($cc_info['cc-expire'], 2, 2), 'Total' => $amount, 'Address' => $cc_info['cc_street'], 'Zip' => $cc_info['cc_zip'], 'FirstName' => $cc_info['cc_name_f'], 'LastName' => $cc_info['cc_name_l']);
     if ($this->config['restrictkey']) {
         $vars['RestrictKey'] = $this->config['restrictkey'];
     }
     if ($cc_info['cc_code'] != '') {
         $vars['CVV2Type'] = 1;
         $vars['CVV2'] = $cc_info['cc_code'];
     } else {
         $vars['CVV2Type'] = 0;
         $vars['CVV2'] = '';
     }
     // prepare log record
     $vars_l = $vars;
     $vars_l['CardNo'] = $cc_info['cc'];
     if ($vars['CVV2']) {
         $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 cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "start trial", $log);
     }
     //////////////////////// cc_bill /////////////////////////
     if ($this->config['live']) {
         $url_proc = "https://www.paymentsgateway.net/cgi-bin/postauth.pl";
     } else {
         $url_proc = "https://www.paymentsgateway.net/cgi-bin/posttest.pl";
     }
     $avs_method = '';
     for ($i = 0; $i < 5; $i++) {
         $avs_method .= intval($this->config["avs_method{$i}"]);
     }
     $vars = array("pg_merchant_id" => $this->config['merchant_id'], "pg_password" => $this->config['password'], "pg_transaction_type" => 10, "pg_total_amount" => $amount, "Ecom_BillTo_Postal_Name_First" => $member['name_f'], "Ecom_BillTo_Postal_Name_Last" => $member['name_l'], "Ecom_BillTo_Online_Email" => $member['email'], "Ecom_BillTo_Postal_Street_Line1" => $cc_info['cc_street'] ? $cc_info['cc_street'] : $member['street'], "Ecom_BillTo_Postal_City" => $cc_info['cc_city'], "Ecom_BillTo_Postal_Stateprov" => $cc_info['cc_state'], "Ecom_BillTo_Postal_PostalCode" => $cc_info['cc_zip'] ? $cc_info['cc_zip'] : $member['zip'], "Ecom_BillTo_Postal_CountryCode" => $cc_info['cc_country'], "Ecom_Payment_Card_Name" => $cc_info['cc_name_f'] ? $cc_info['cc_name_f'] . " " . $cc_info['cc_name_l'] : $member['name_f'] . ' ' . $member['name_l'], "Ecom_Payment_Card_Type" => $cc_info['cc_type'], "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), "pg_avs_method" => $avs_method);
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     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 run_transaction($vars, $path = "APC")
 {
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     if ($this->config['testing']) {
         $url = "https://teste.aprovafacil.com/cgi-bin/APFW/{$this->config['login']}/{$path}";
     } else {
         $url = "https://aprovafacil.com/cgi-bin/APFW/{$this->config['login']}/{$path}";
     }
     $ret = cc_core_get_url($url, $vars1);
     //echo htmlentities($ret);
     $res = array('TransacaoAprovada' => $this->from_res("TransacaoAprovada", $ret), 'ResultadoSolicitacaoAprovacao' => $this->from_res("ResultadoSolicitacaoAprovacao", $ret), 'CodigoAutorizacao' => $this->from_res("CodigoAutorizacao", $ret), 'Transacao' => $this->from_res("Transacao", $ret), 'CartaoMascarado' => $this->from_res("CartaoMascarado", $ret), 'NumeroDocumento' => $this->from_res("NumeroDocumento", $ret), 'ComprovanteAdministradora' => $this->from_res("ComprovanteAdministradora", $ret));
     if (!$res['TransacaoAprovada']) {
         $res['html'] = htmlentities($ret);
     }
     return $res;
 }
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     $vars = array("target_app" => "WebCharge_v5.06", "response_mode" => "simple", "response_fmt" => "delimited", "upg_auth" => "zxcvlkjh", "delimited_fmt_field_delimiter" => "=", "delimited_fmt_include_fields" => "true", "delimited_fmt_value_delimiter" => "|", "username" => $this->config['user'], "pw" => $this->config['pass'], "trantype" => 'sale', "reference" => "", "trans_id" => "", 'cardtype' => $cc_info['cc_type'], 'ccname' => $cc_info['cc_name_f'] . " " . $cc_info['cc_name_l'], 'ccnumber' => $cc_info['cc_number'], 'month' => substr($cc_info['cc-expire'], 0, 2), 'year' => substr($cc_info['cc-expire'], 2, 2), 'fulltotal' => $amount, 'email' => $member['email'], 'bphone' => $cc_info['cc_phone'], 'baddress' => $cc_info['cc_street'], 'bcity' => $cc_info['cc_city'], 'bstate' => $cc_info['cc_state'], 'bzip' => $cc_info['cc_zip'], 'bcountry' => $cc_info['cc_country']);
     // prepare log record
     $vars_l = $vars;
     $vars_l['ccnumber'] = $cc_info['cc'];
     $log[] = $vars_l;
     /////
     if ($cc_info['cc_code']) {
         $vars['ccidentifier1'] = $cc_info['cc_code'];
     }
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $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 void_transaction($req, $res, &$log)
 {
     $vars = array("VPSProtocol" => "2.22", "TxType" => "VOID", "Vendor" => $this->config['login'], "VendorTxCode" => $req["VendorTxCode"], "VPSTxId" => $res["VPSTxId"], "SecurityKey" => $res["SecurityKey"], "TxAuthNo" => $res["TxAuthNo"]);
     $log[] = $vars;
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     if ($this->config[testing]) {
         $ret = cc_core_get_url("https://test.sagepay.com/gateway/service/void.vsp", $vars1);
     } else {
         $ret = cc_core_get_url("https://live.sagepay.com/gateway/service/void.vsp", $vars1);
     }
     $res = array();
     foreach (split("\r\n", $ret) as $line) {
         list($k, $v) = split("=", $line);
         $res[$k] = $v;
     }
     $log[] = $res;
 }
Example #29
0
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     if ($charge_type == CC_CHARGE_TYPE_TEST) {
         return array(CC_RESULT_SUCCESS, "", "", array('test transaction' => 'no validation'));
     }
     $vars = array("Method" => "CreditCardCharge", "StoreID" => $this->config['store_id'], "StoreKey" => $this->config['store_key'], "ApplicationID" => 'AMemberPro v1.9.3', "ReferenceNumber" => '19300' . $payment['payment_id'], "TransactionAmount" => $amount, "AccountNumber" => $cc_info['cc_number'], "ExpirationMonth" => substr($cc_info['cc-expire'], 0, 2), "ExpirationYear" => substr($cc_info['cc-expire'], 2, 2), "BillingName" => $cc_info['cc_name_f'] . " " . $cc_info['cc_name_l'], "BillingAddress" => $cc_info['cc_street'], "BillingCity" => $cc_info['cc_city'], "BillingState" => $cc_info['cc_state'], "BillingPostalCode" => $cc_info['cc_zip'], "BillingCountry" => $cc_info['cc_country'], "BillingEmail" => $member['email']);
     if ($cc_info['cc_code']) {
         $vars['CardVerificationValue'] = $cc_info['cc_code'];
     }
     // prepare log record
     $vars_l = $vars;
     $vars_l['AccountNumber'] = $cc_info['cc'];
     if ($vars['CardVerificationValue']) {
         $vars_l['CardVerificationValue'] = preg_replace('/./', '*', $vars['CardVerificationValue']);
     }
     $log[] = $vars_l;
     /////
     foreach ($vars as $kk => $vv) {
         $v = urlencode($vv);
         $k = urlencode($kk);
         $vars1[] = "{$k}={$v}";
     }
     $vars1 = join('&', $vars1);
     $url_proc = $this->config['testing'] ? "https://testefsnet.concordebiz.com/efsnet.dll" : "https://efsnet.concordebiz.com/efsnet.dll";
     $ret = cc_core_get_url($url_proc . "?" . $vars1);
     parse_str($ret, $res);
     $log[] = $res;
     if (!strlen($res['ResponseCode'])) {
         return array(CC_RESULT_INTERNAL_ERROR, "Communication error - please repeat payment attempt later", "", $log);
     } elseif ($res['ResponseCode'] == 0) {
         return array(CC_RESULT_SUCCESS, "", $res['ApprovalNumber'], $log);
     } else {
         return array(CC_RESULT_DECLINE_PERM, $res['ResultMessage'], "", $log);
     }
 }
 function run_transaction($xml)
 {
     global $db;
     $ret = cc_core_get_url("https://www.goemerchant4.com/trans_center/gateway/xmlgateway.cgi", $xml);
     $res = goemerchant_parse_xml($ret);
     $db->log_error("GoEmerchant RESPONSE:<br />\n" . goemerchant_get_dump($res));
     /* XML result to parse:
     <?xml version="1.0" encoding="UTF-8"?>
     <RESPONSE>
       <FIELDS>
         <FIELD KEY="status">0-error 1-success 2-declined</FIELD>
         <FIELD KEY="auth_code">character code sent by the bank </FIELD>
         <FIELD KEY="auth_response">message from the bank </FIELD>
         <FIELD KEY="avs_code">avs code from the bank</FIELD>
         <FIELD KEY="cvv2_code">cvv2 code from the bank</FIELD>
         <FIELD KEY="order_id">echoed back from original post</FIELD>
         <FIELD KEY="reference_number">returned for use with credits/voids/settles</FIELD>
         <FIELD KEY="error">error text</FIELD>
       </FIELDS>
     </RESPONSE>
     */
     return $res;
 }