示例#1
1
 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;
     }
     # Linkpoint Class
     include_once PATH_PLUGINS . 'checkout/CLASS_LINKPOINT/lphp.php';
     $mylphp = new lphp();
     $myorder["host"] = "secure.linkpt.net";
     $myorder["port"] = "1129";
     $myorder["keyfile"] = PATH_PLUGINS . 'checkout/CLASS_LINKPOINT/' . $this->cfg["cert"];
     $myorder["configfile"] = $this->cfg["account"];
     $myorder["ordertype"] = "SALE";
     $myorder["cardnumber"] = $this->billing["cc_no"];
     $myorder["cardexpmonth"] = $this->billing["exp_month"];
     $myorder["cardexpyear"] = $this->billing["exp_year"];
     $myorder["cvmindicator"] = "provided";
     $myorder["cvmvalue"] = $this->billing["ccv"];
     $myorder["addrnum"] = $this->account["address1"];
     $myorder["zip"] = $this->account["zip"];
     $myorder["chargetotal"] = $amount;
     $myorder["name"] = $this->account['first_name'] . ' ' . $this->account['last_name'];
     $myorder["company"] = $this->account['company'];
     $myorder["address1"] = $this->account['address1'];
     $myorder["address2"] = $this->account['address2'];
     $myorder["city"] = $this->account['city'];
     $myorder["state"] = $this->account['state'];
     $myorder["email"] = $acct_fields['email'];
     $myorderp["ip"] = USER_IP;
     $myorder["comments"] = "Invoice {$invoice}";
     #if($this->cfg['mode'] 	== "1")
     #$myorder["result"]   	= "GOOD"; 	# For a test, set result to GOOD, DECLINE, or DUPLICATE
     #if($this->cfg['mode'] 	== "1")
     #$myorder["debugging"]	= true;
     #$myorder["cbin"]		= false; // use binary curl?
     # Send transaction. Use one of two possible methods  #
     $result = $mylphp->process($myorder);
     # use shared library model
     #$result = $mylphp->curl_process($myorder);    # use curl methods
     if ($result["r_approved"] != "APPROVED") {
         $ret['status'] = 0;
         $ret['msg'] = 'The information provided is invalid or has declined';
     } else {
         $ret['status'] = 1;
         $ret['avs'] = $result['r_code'];
         $ret['transaction_id'] = $result['r_ordernum'];
     }
     if ($ret['status'] == 1) {
         return $ret;
     } else {
         global $VAR;
         @($VAR['msg'] = $ret["msg"]);
         return false;
     }
 }
示例#2
0
            $oa2 = $aval;
            # CONSTANTS
            $txn["host"] = $myorder["host"];
            $txn["port"] = $myorder["port"];
            $txn["keyfile"] = $myorder["keyfile"];
            $txn["configfile"] = $myorder["configfile"];
            $txn["debugging"] = $myorder["debugging"];
            # INDIVIDUAL ORDER ELEMENTS
            $txn["chargetotal"] = $oa2[chargetotal];
            $txn["cardnumber"] = $oa2[cardnumber];
            $txn["cardexpmonth"] = $oa2[cardexpmonth];
            $txn["cardexpyear"] = $oa2[cardexpyear];
            $txn["addrnum"] = $oa2[addrnum];
            $txn["zip"] = $oa2[zip];
            $txn["oid"] = $oa2[oid];
            # Send transaction. Use one of two possible methods  #
            $result = $mylphp->process($txn);
            # use shared library model
            //	$result = $mylphp->curl_process($txn);  # use curl methods
            if ($result["r_approved"] != "APPROVED") {
                print "Status: {$result['r_approved']}\n";
                print "Error: {$result['r_error']}\n";
            } else {
                // success
                print "Status: {$result['r_approved']}\n";
                print "Code: {$result['r_code']}\n";
                print "OID: {$result['r_ordernum']}\n";
            }
        }
    }
}