Kryptronic Software Wiki : epdquk

Kryptronic Kryptronic Software Wiki

ePDQ Gateway Integration UK/EU


ePDQ Integration.
You need to password protect the {public_directory}/epdqrelay
In ClickCartPro.
In the admin go to Home > ClickCartPro (GBU) > Commerce: Orders and Checkout > Manage Processing Gateways
Update - ePDQ - Payment Form
1. Change Active Status to True.
2. Change Gateway User/Store ID to your epdq client ID
3. Change Transaction Key/Password to your epdq pass phrase.
4. Click submit.

In ePDQ,
Click this link then fill in the following:
https://cpiadmin.epdq.co.uk/cgi-bin/CcxBarclaysEpdqAdminTool.e
1. Passphrase, information type into Transaction Key / Password.
2. Allowed URL, the normal location of the shopping script eg {public URL}/index.php
3. Post Order Results, Yes
4. Post URL, the location of the epdq script eg {public URL}/epdqrelay/gbu0.php
5. Post username and password, the username and password for the epdqrelay directory.
Check your epdqrelay/gbu0.php is up to date:
<?php 

// +------------------------------------------------------------------+
// |                                                            [KHXC]|
// | Copyright 1999-2006 Kryptronic, Inc. All rights reserved.        |
// |                                                                  |
// | All Kryptronic software is copyrighted, trademarked, developed   |
// | and licensed by Kryptronic, Inc. All Kryptronic software is      |
// | distributed under license.                                       |
// |                                                                  |
// | View the license agreement for more information.  Installation   |
// | of this software package indicates acceptance of the license     |
// | agreement.                                                       |
// |                                                                  |
// | Application Information: http://www.kryptronic.com/              |
// |                                                                  |
// | Software Name:     Kryptronic Hybrix X Core (KHXC)               |
// | Software Version:  6.6.0                                         |
// | Package Date:      June 5, 2006                                  |
// | Author:            Nick Hendler, Webmaster, Kryptronic, Inc.     |
// | Author Email:      support@kryptronic.com                        |
// |                                                                  |
// +------------------------------------------------------------------+

// +------------------------------------------------------------------+
// | The purpose of this file is to provide an application relay in   |
// | order to allow for easy non-URL-specific relaying to an          |
// | application and a specific application namespace.                |
// |                                                                  |
// | This file relays to the ClickCartPro application using the       |
// | procgwresp (Process Gateway Response) namespace.                 |
// +------------------------------------------------------------------+

$relay = array();

$relay['app']       = '';
$relay['namespace'] = 'procgwresp';
$relay['robot']     = 'ROBOT_RELAY';

// +--
// | Get our filename and transform it into something we can work with.
// +--

$file = __FILE__;

while (preg_match('/\\\\/',$file)) {$file = preg_replace('/\\\\/','/',$file);}

while (preg_match('/\/\//',$file)) {$file = preg_replace('/\/\//','/',$file);}

$file = preg_replace('/\/$/','',$file);

// +--
// | Figure out our path and application id from our filename.
// +--

$relay['app']  = preg_replace('/^(.*?)\/epdqrelay\/(.*?)\.php$/','\\2',$file);

$path          = preg_replace('/^(.*?)\/epdqrelay\/(.*?)\.php$/','\\1',$file);

// +--
// | Include the config.php file in our public directory so we
// | know the name of the frontend script to redirect to.
// +--

include($path . '/config.php');

// +--
// | Redirect to the frontend script.
// +--

include($path . '/' . $config['khxc.script_frontend']);

// +--
// | Exit.
// +--

exit();

// +------------------------------------------------------------------+
// | End Of File                                                      |
// +------------------------------------------------------------------+

?> 

Also Check your Form Display Code is up to date:
<?php

// +--
// | This processor integration references an external
// | URL for processing.  All external processing gateways
// | work in the same manner.  An order information array
// | is made available globally under the the global name
// | 'ecom.order_summary'.
// |
// | This must set a global variable named 'ecom.olpform'
// | which contains the form information to be posted to
// | the external gateway URL.
// |
// | Anything printed within this code will be printed
// | above the form instructions on the payment information
// | page.
// +--

// +--
// | The username entered for Protx form should be in the
// | vendor name:
// |
// +--

// +--
// | THERE IS NO NEED TO EDIT THE CODE BELOW THIS POINT TO
// | ACTIVATE THIS INTEGRATION.  ONLY EDIT THIS CODE TO MODIFY
// | HOW THIS INTEGRATION WORKS.  BE SURE YOU KNOW WHAT YOU'RE
// | DOING!
// +--

// +--
// | Get a few global variables.
// +--

$app      = $this->globals('khxc.app');
$eol      = $this->globals('khxc.eol');
$order    = $this->globals('ecom.order_summary');

// +--
// | Printable form instructions.
// +--

$instructions = "After verifying your order information and clicking the 'Continue' button, you will be directed to our online processing partner's secure site to enter your payment information. Once your payment information is entered and verified, you will be directed back to this web site for your order confirmation.";

// +--
// | Create our relay URL.
// +--

$url_relay  = $this->globals('khxc.url_ssl') . '/relay/' . $app . '.php';

// +--
// | Set up the olpform array.
// +--

$olpform = array('url'    => 'https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e',
                 'button' => 'Continue',
                 'fields' => array());

// +--
// | Create the Protx Form Hash Field.
// +--
//** Build the crypt string plaintext **
$params='clientid=' . $order['gateway']['userid'];
$params.='&oid=' . $order['order']['id'];
$params.='&password=' . $order['gateway']['transkey'];
$params.='&chargetype=Auth';
$params.='&currencycode=826';
$params.='&total=' . $order['order']['ordertotal'];

// +--
// | Load the Remote class.
// +--

if (!($this->KHXC_Remote)) {

     $this->KHXC_Remote =& $this->quick_object('KHXC_Remote','khxc');

     if ($this->IsError($this->KHXC_Remote)) {return $this->KHXC_Remote;}

} // End of if statement.

// +--
// | Send the data to epdq.
// +--

$result = $this->KHXC_Remote->connect (array('url' => 'secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e',
                                            'type' => 'POST',
                              'mode' => 'HTTPS',
                                            'data' => $params));

if ($this->debug) {$this->debugger("epdqform: Result: '{$result}'.");}
$result = preg_replace('/\<INPUT name\=epdqdata type\=hidden value\=\"/','',$result);
if ($this->debug) {$this->debugger("epdqform: Result1: '{$result}'.");}
$result = preg_replace('/\"\>/','',$result);


// +--
// | Create the HIDDEN fields for the form.
// +--

$olpform['fields']['HIDDEN'][] = array('name'  => 'epdqdata',
                                       'value' => $result);

$olpform['fields']['HIDDEN'][] = array('name'  => 'returnurl',
                                       'value' => $url_relay);

$olpform['fields']['HIDDEN'][] = array('name'  => 'baddr1',
                                       'value' => $order['order']['addone']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'baddr2',
                                       'value' => $order['order']['addtwo']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'bcity',
                                       'value' => $order['order']['city']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'bcountyprovince',
                                       'value' => $order['order']['stateprov']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'bpostalcode',
                                       'value' => $order['order']['postalcode']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'btelephonenumber',
                                       'value' => $order['order']['phone']);

$olpform['fields']['HIDDEN'][] = array('name'  => 'email',
                                       'value' => $this->globals('khxc_user.id'));

$olpform['fields']['HIDDEN'][] = array('name'  => 'merchantdisplayname',
                                       'value' => $this->globals('khxc_settings.' . $app . '.site_name'));

                                  
// +--
// | Create the DISPLAY fields for the form.
// +--

$olpform['fields']['DISPLAY'][] = array('type'   => 'PAYFORMCONTINUE',
                                        'params' => array('name'     => 'ecom_continue',
                                                          'required' => 1,
                                                          'display'  => 'Payment Information',
                                                          'desc'     => $instructions,
                                                          'option'   => 'Enter Payment Information'));

// +--
// | Globalize the $olpform array and return.
// +--

$this->globals('ecom.olpform',$olpform);

?>




ClickCartPro - Administration
Wiki: Getting Started