* @package AgileBill * @version 1.4.93 */ if(defined('PATH_MODULES')) include_once(PATH_MODULES.'checkout/base_checkout_plugin.class.php'); else include_once('../../modules/checkout/base_checkout_plugin.class.php'); class plg_chout_EPDQ extends base_checkout_plugin { function plg_chout_EPDQ($checkout_id=false) { $this->name = 'EPDQ'; $this->type = 'redirect'; $this->recurr_only = false; $this->return_url = SSL_URL . 'plugins/checkout/'. $this->name .'.php'; $this->success_url = URL . '?_page=invoice:thankyou&_next_page=invoice:user_view&id='; $this->decline_url = URL . '?_page=invoice:user_view&id='; $this->support_cur = Array ('GBP'); $this->getDetails($checkout_id); } # Validate the user submitted billing details at checkout: function validate($VAR) { return true; } # Perform the checkout transaction (new purchase): function bill_checkout( $amount, $invoice, $currency_iso, $acct_fields, $total_recurring=false, $recurr_bill_arr=false) { # Validate the currency: if(!$this->validate_currency($currency_iso)) return false; $currencycode=826; /************ start ePDQ encryption ***************/ $server="secure2.epdq.co.uk"; $url="/cgi-bin/CcxBarclaysEpdqEncTool.e"; #the following parameters have been obtained earlier in the merchant's webstore clientid, passphrase, oid, currencycode, total $params="clientid={$this->cfg['clientid']}"; /* ePDQ administrative service ClientID (also Store ID) */ $params.="&password={$this->cfg['passphrase']}"; /* ePDQ administrative service passphrase */ $params.="&oid=$invoice"; $params.="&chargetype={$this->cfg['chargetype']}"; /* Auth (immediate shipment) , PreAuth (delayed shipment) */ $params.="¤cycode=$currencycode"; $params.="&total=1.00"; #perform the HTTP Post $response = epdqPullpage( $server,$url,$params ); #split the response into separate lines $response_lines=explode("\n",$response); print_r($response_lines); #exit; #for each line in the response check for the presence of the string 'epdqdata' this line contains the encrypted string $response_line_count=count($response_lines); for ($i=0;$i<$response_line_count;$i++){ if (preg_match('/epdqdata/',$response_lines[$i])){ $strEPDQ=$response_lines[$i]; } } /************** end ePDQ encryption ***************/ $this->redirect = '