function run_transaction($vars) { $bp = new BluePayment($this->config[account_id], $this->config[secret], $this->config[test] ? "TEST" : LIVE); $bp->sale($vars[amount]); $bp->payType = 'CREDIT'; $bp->setCustInfo($vars[cc], $vars[cvv2], $vars[expire], $vars[name1], $vars[name2], $vars[street], $vars[city], $vars[state], $vars[zip], $vars[country]); $bp->process(); $res = array('STATUS' => $bp->getStatus(), 'AVS' => $bp->getAvsResp(), 'PNREF' => $bp->getTransId(), 'CVV_VALID' => $bp->getCvv2Resp(), 'AUTH_CODE' => $bp->getAuthCode(), 'RESPMSG' => $bp->getMessage()); return $res; }
public function blueTransaction($param) { $bp = new BluePayment(); $bp->sale('25.00'); $bp->setCustInfo('4111111111111111', '123', '1111', 'Chris', 'Jansen', '123 Bluepay Ln', 'Bluesville', 'IL', '60563', 'USA', '123-456-7890', '*****@*****.**'); $bp->process(); $output = $bp->getresponse(); //echo 'Response: '. $bp->getResponse() .'<br />'. // 'TransId: '. $bp->getTransId() .'<br />'. // 'Status: '. $bp->getStatus() .'<br />'. // 'AVS Resp: '. $bp->getAvsResp() .'<br />'. // 'CVV2 Resp: '. $bp->getCvv2Resp() .'<br />'. // 'Auth Code: '. $bp->getAuthCode() .'<br />'. // 'Message: '. $bp->getMessage() .'<br />'. // 'Rebid: '. $bp->getRebid(); $outarray = array('response' => '12or3', 'responsetext' => $bp->getResponse(), 'authcode' => $bp->getAuthCode(), 'transactionid' => $bp->getTransId(), 'avsresponse' => $bp->getAvsResp(), 'cvvresponse' => $bp->getCvv2Resp(), 'orderid' => $bp->getMessage(), 'response_code' => $bp->getResponse()); $response = array_merge_recursive($outarray, $charged); return $response; }
function bluepay_refund($params) { if ($params['testmode'] == "on") { $gateway_testmode = "TEST"; } else { $gateway_testmode = "LIVE"; } define("MODE", $gateway_testmode); define("POST_URL", "https://secure.bluepay.com/interfaces/bp20post"); define("ACCOUNT_ID", $params['accountid']); define("SECRET_KEY", $params['secretkey']); define("STATUS_DECLINE", "0"); define("STATUS_APPROVED", "1"); define("STATUS_ERROR", "2"); $bp = new BluePayment(); $bp->refund($params['transid']); $bp->setCustInfo($params['cardnum'], "", $params['cardexp'], $params['clientdetails']['firstname'], $params['clientdetails']['lastname'], $params['clientdetails']['address1'], $params['clientdetails']['city'], $params['clientdetails']['state'], $params['clientdetails']['postcode'], $params['clientdetails']['country']); $bp->process(); $desc = "Action => Refund\nClient => " . $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'] . "\n"; $desc .= "TransId => " . $bp->getTransId() . "\n" . "Status => " . $bp->getStatus() . "\n" . "AVS Resp => " . $bp->getAvsResp() . "\n" . "CVV2 Resp => " . $bp->getCvv2Resp() . "\n" . "Auth Code => " . $bp->getAuthCode() . "\n" . "Message => " . $bp->getMessage() . "\n"; switch ($bp->getStatus()) { case "1": array("status" => "success", "transid" => $bp->getTransId(), "rawdata" => $desc); } return; }