Exemplo n.º 1
0
 //Get the payments for this deposit slip
 $sSQL = "SELECT plg_plgID,\n                   plg_amount, \n\t                plg_scanString,\n\t\t\t\t\t\t plg_aut_Cleared,\n\t\t\t\t\t\t plg_aut_ResultID,\n\t\t\t\t\t\t a.aut_FirstName AS firstName,\n\t\t\t\t\t\t a.aut_LastName AS lastName,\n\t\t\t\t\t\t a.aut_Address1 AS address1,\n\t\t\t\t\t\t a.aut_Address2 AS address2,\n\t\t\t\t\t\t a.aut_City AS city,\n\t\t\t\t\t\t a.aut_State AS state,\n\t\t\t\t\t\t a.aut_Zip AS zip,\n\t\t\t\t\t\t a.aut_Country AS country,\n\t\t\t\t\t\t a.aut_Phone AS phone,\n\t\t\t\t\t\t a.aut_Email AS email,\n\t\t\t\t\t\t a.aut_CreditCard AS creditCard,\n\t\t\t\t\t\t a.aut_ExpMonth AS expMonth,\n\t\t\t\t\t\t a.aut_ExpYear AS expYear,\n\t\t\t\t\t\t a.aut_BankName AS bankName,\n\t\t\t\t\t\t a.aut_Route AS route,\n\t\t\t\t\t\t a.aut_Account AS account,\n\t\t\t\t\t\t a.aut_Serial AS serial,\n\t\t\t\t\t\t a.aut_NextPayDate AS authDate,\n\t\t\t\t\t\t a.aut_Interval AS aut_Interval,\n\t\t\t\t\t\t a.aut_ID AS aut_ID\n\t\t\t FROM pledge_plg\n\t\t\t LEFT JOIN autopayment_aut a ON plg_aut_ID = a.aut_ID\n\t\t\t LEFT JOIN donationfund_fun b ON plg_fundID = b.fun_ID\n\t\t\t WHERE plg_depID = " . $iDepositSlipID . " ORDER BY pledge_plg.plg_date";
 $rsTransactions = RunQuery($sSQL);
 include "Include/echophp.class";
 include "Include/EchoConfig.php";
 // Specific account information is in here
 $echoPHP = new EchoPHP();
 while ($aTransaction = mysql_fetch_array($rsTransactions)) {
     extract($aTransaction);
     if ($plg_aut_Cleared) {
         // If this one already cleared do not submit it again.
         continue;
     }
     $echoPHP->set_EchoServer("https://wwws.echo-inc.com/scripts/INR200.EXE");
     $echoPHP->set_merchant_echo_id($EchoAccount);
     $echoPHP->set_merchant_pin($EchoPin);
     $echoPHP->set_grand_total($plg_amount);
     $echoPHP->set_billing_phone($phone);
     $echoPHP->set_billing_address1($address1);
     $echoPHP->set_billing_address2($address2);
     $echoPHP->set_billing_city($city);
     $echoPHP->set_billing_state($state);
     $echoPHP->set_billing_zip($zip);
     $echoPHP->set_billing_country($country);
     $echoPHP->set_billing_email($email);
     $echoPHP->set_billing_ip_address($REMOTE_ADDR);
     $echoPHP->set_order_type("S");
     $echoPHP->set_cnp_recurring("Y");
     if ($dep_Type == "CreditCard") {
         $echoPHP->set_billing_first_name($firstName);
         $echoPHP->set_billing_last_name($lastName);
Exemplo n.º 2
0
 function bill_checkout($amount, $invoice, $currency_iso, $acct_fields, $total_recurring = false, $recurr_bill_arr = false)
 {
     # Validate currency
     if (!$this->validate_currency($currency_iso)) {
         return false;
     }
     $ret = false;
     if (!$this->validate_card_details($ret)) {
         return false;
     }
     # Get the country
     $country = $this->getCountry('three_code', $acct_fields["country_id"]);
     if ($this->cfg['mode'] = "0") {
         $test = "F";
     } else {
         $test = "T";
     }
     include_once PATH_PLUGINS . 'checkout/CLASS_ECHO/echophp.class';
     $echoPHP = new EchoPHP();
     $echoPHP->set_order_type("S");
     $echoPHP->set_debug($test);
     $echoPHP->set_EchoServer($this->host . '' . $this->url);
     $echoPHP->set_transaction_type($this->cfg["type"]);
     $echoPHP->set_merchant_echo_id($this->cfg["id"]);
     $echoPHP->set_merchant_pin($this->cfg["pin"]);
     $echoPHP->set_billing_ip_address(USER_IP);
     $echoPHP->set_billing_first_name($this->account["first_name"]);
     $echoPHP->set_billing_last_name($this->account["last_name"]);
     $echoPHP->set_billing_address1($this->account["address1"] . ' ' . $this->account["address2"]);
     $echoPHP->set_billing_city($this->account["city"]);
     $echoPHP->set_billing_state($this->account["state"]);
     $echoPHP->set_billing_zip($this->account["zip"]);
     $echoPHP->set_billing_country($country);
     $echoPHP->set_billing_email($acct_fields["email"]);
     $echoPHP->set_grand_total($amount);
     $echoPHP->set_ccexp_month($this->billing["exp_month"]);
     $echoPHP->set_ccexp_year($this->billing["exp_year"]);
     $echoPHP->set_cnp_security($this->billing["ccv"]);
     $echoPHP->set_cc_number($this->billing["cc_no"]);
     $echoPHP->set_counter($echoPHP->getRandomCounter());
     # Set the return codes:
     if (!$echoPHP->Submit()) {
         if ($echoPHP->decline_code == "1013") {
             $ret['status'] = 0;
             $ret['msg'] = $echoPHP->avs_result . 'Echo account ' . $echoPHP->merchant_echo_id . ' could not be found, failed!';
         } else {
             $ret['status'] = 0;
             $ret['msg'] = $echoPHP->echotype1;
         }
     } else {
         $ret['status'] = 1;
         $ret['transaction_id'] = $echoPHP->reference;
         $ret['authorization'] = $echoPHP->authorization;
         # AVS Details:
         if ($echoPHP->avs_result == 'A') {
             $ret['avs'] = 'avs_address_only';
         } elseif ($echoPHP->avs_result == 'E') {
             $ret['avs'] = 'avs_error';
         } elseif ($echoPHP->avs_result == 'N') {
             $ret['avs'] = 'avs_no_match';
         } elseif ($echoPHP->avs_result == 'P') {
             $ret['avs'] = 'avs_na';
         } elseif ($echoPHP->avs_result == 'R') {
             $ret['avs'] = 'avs_retry';
         } elseif ($echoPHP->avs_result == 'S' || $echoPHP->avs_result == 'G') {
             $ret['avs'] = 'avs_not_supported';
         } elseif ($echoPHP->avs_result == 'U') {
             $ret['avs'] = 'avs_address_unavail';
         } elseif ($echoPHP->avs_result == 'W') {
             $ret['avs'] = 'avs_fullzip_only';
         } elseif ($echoPHP->avs_result == 'X') {
             $ret['avs'] = 'avs_exact';
         } elseif ($echoPHP->avs_result == 'D' || $echoPHP->avs_result == 'M') {
             $ret['avs'] = 'avs_address_zip';
         } elseif ($echoPHP->avs_result == 'Z') {
             $ret['avs'] = 'avs_partzip_only';
         } else {
             $ret['avs'] = 'avs_na';
         }
     }
     if ($ret['status'] == 1) {
         return $ret;
     } else {
         global $VAR;
         @($VAR['msg'] = $ret["msg"]);
         return false;
     }
 }
Exemplo n.º 3
0
function openecho_capture($params)
{
    $echoPHP = new EchoPHP();
    $echoPHP->set_EchoServer("https://wwws.echo-inc.com/scripts/INR200.EXE");
    $echoPHP->set_transaction_type("EV");
    $echoPHP->set_order_type("S");
    $echoPHP->set_merchant_echo_id($params['merchantechoid']);
    $echoPHP->set_merchant_pin($params['merchantpin']);
    $echoPHP->set_billing_ip_address($_SERVER['REMOTE_ADDR']);
    $echoPHP->set_billing_first_name($params['clientdetails']['firstname']);
    $echoPHP->set_billing_last_name($params['clientdetails']['lastname']);
    $echoPHP->set_billing_address1($params['clientdetails']['address1']);
    $echoPHP->set_billing_city($params['clientdetails']['city']);
    $echoPHP->set_billing_state($params['clientdetails']['state']);
    $echoPHP->set_billing_zip($params['clientdetails']['postcode']);
    $echoPHP->set_billing_country($params['clientdetails']['country']);
    $echoPHP->set_billing_phone($params['clientdetails']['phonenumber']);
    $echoPHP->set_billing_email($params['clientdetails']['email']);
    $echoPHP->set_debug("F");
    $echoPHP->set_cc_number($params['cardnum']);
    $echoPHP->set_grand_total($params['amount']);
    $echoPHP->set_ccexp_month(substr($params['cardexp'], 0, 2));
    $echoPHP->set_ccexp_year("20" . substr($params['cardexp'], 2, 2));
    $echoPHP->set_cnp_security($params['cccvv']);
    $echoPHP->set_counter("1");
    $desc = "Action => Capture\n";
    $desc .= "Client => " . $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'] . "\n";
    $desc .= "Authorization Code => " . $echoPHP->authorization . "\n";
    $desc .= "Order Number => " . $echoPHP->order_number . "\n";
    $desc .= "Reference => " . $echoPHP->reference . "\n";
    $desc .= "Status => " . $echoPHP->status . "\n";
    $desc .= "AVS Result => " . $echoPHP->avs_result . "\n";
    $desc .= "Security Result => " . $echoPHP->security_result . "\n";
    $desc .= "MAC => " . $echoPHP->mac . "\n";
    $desc .= "Decline Code => " . $echoPHP->decline_code . "\n";
    $desc .= "Transaction Date => " . $echoPHP->tran_date . "\n";
    $desc .= "Merchant Name => " . $echoPHP->merchant_name . "\n";
    $desc .= "Version => " . $echoPHP->version . "\n";
    $desc .= "Echo Type 1 => " . $echoPHP->echotype1 . "\n";
    $desc .= "Echo Type 2 => " . $echoPHP->echotype2 . "\n";
    $desc .= "Echo Type 3 => " . $echoPHP->echotype3 . "\n";
    $desc .= "Echo Response => " . $echoPHP->EchoResponse . "\n";
    if (!$echoPHP->Submit()) {
        return array("status" => "declined", "rawdata" => $desc);
    }
    return array("status" => "success", "transid" => $echoPHP->reference, "rawdata" => $desc);
}
Exemplo n.º 4
0
 function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
 {
     global $config;
     $log = array();
     //////////////////////// cc_bill /////////////////////////
     $echoPHP = new EchoPHP();
     $echoPHP->set_EchoServer("https://wwws.echo-inc.com/scripts/INR200.EXE");
     $echoPHP->set_order_type("S");
     $echoPHP->set_merchant_echo_id($this->config['merchant_id']);
     // use your own id here
     $echoPHP->set_merchant_pin($this->config['pin']);
     // use your own pin here
     $echoPHP->set_billing_phone($cc_info['cc_phone']);
     $echoPHP->set_billing_first_name($cc_info['cc_name_f']);
     $echoPHP->set_billing_last_name($cc_info['cc_name_l']);
     $echoPHP->set_billing_address1($cc_info['cc_street']);
     $echoPHP->set_billing_city($cc_info['cc_city']);
     $echoPHP->set_billing_state($cc_info['cc_state']);
     $echoPHP->set_billing_zip($cc_info['cc_zip']);
     $echoPHP->set_billing_country($cc_info['cc_country']);
     $echoPHP->set_billing_phone($cc_info['cc_phone']);
     $echoPHP->set_billing_email($member['email']);
     $echoPHP->set_cc_number($cc_info['cc_number']);
     $echoPHP->set_ccexp_month(substr($cc_info['cc-expire'], 0, 2));
     $echoPHP->set_ccexp_year(substr($cc_info['cc-expire'], 2, 2));
     $echoPHP->set_counter($echoPHP->getRandomCounter());
     switch ($charge_type) {
         case CC_CHARGE_TYPE_TEST:
             $echoPHP->set_transaction_type("AD");
             $echoPHP->set_billing_ip_address($_SERVER['REMOTE_ADDR']);
             $echoPHP->set_cnp_security($cc_info['cc_code']);
             break;
         default:
             $echoPHP->set_transaction_type("EV");
             $echoPHP->set_grand_total($amount);
             if ($charge_type != CC_CHARGE_TYPE_RECURRING) {
                 $echoPHP->set_billing_ip_address($_SERVER['REMOTE_ADDR']);
                 $echoPHP->set_cnp_security($cc_info['cc_code']);
             } else {
                 $echoPHP->set_cnp_recurring('Y');
             }
     }
     $x = $echoPHP->getURLData();
     $x = str_replace($cc_info['cc_number'], $cc_info['cc'], $x);
     $x = str_replace('cnp_security=' . $cc_info['cc_code'], 'cnp_security=' . preg_replace('/./', '*', $cc_info['cc_code']) . '&', $x);
     $x = preg_replace('/(merchant_pin\\=)(\\d+)/', '\\1********', $x);
     parse_str($x, $x);
     $log[] = $x;
     $ECHO_ERROR = !$echoPHP->Submit();
     // find out reply and parse it
     preg_match('/<ECHOTYPE3>(.+?)<\\/ECHOTYPE3>/', $echoPHP->EchoResponse, $regs);
     preg_match_all('/<(.+?)>(.+?)<\\/(.+?)>/', $regs[1], $matches);
     $res = array();
     foreach ($matches[1] as $k => $fname) {
         $res[$fname] = $matches[2][$k];
     }
     $log[] = $res;
     if ($ECHO_ERROR) {
         if ($echoPHP->decline_code == "1013") {
             return array(CC_RESULT_INTERNAL_ERROR, "Configuration error: Your ECHO-ID or PIN is missing from this form, or is not setup correctly. Check if you can login with your ECHO-ID and PIN to <a href=\"https://wwws.echo-inc.com/Review\">Transaction Review</a>.", "", $log);
         } else {
             return array(CC_RESULT_DECLINE_PERM, "Verification of your account FAILED", "", $log);
         }
     } else {
         return array(CC_RESULT_SUCCESS, "", $echoPHP->get_order_number(), $log);
     }
 }