VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: Rob on September 09, 2004, 18:44:00 PM

Title: ProtX
Post by: Rob on September 09, 2004, 18:44:00 PM
I'd like to see a PSP for protx.

http://www.protx.com

I'm currently looking into PSP's and protX seems to be the best (i.e cheapest!) for low volume shops, like mine.

I'm happy to help develop one.  i just need to look into it a bit more.

Thanks.
Title: Re:ProtX
Post by: Danny Locksmith on October 19, 2004, 18:37:09 PM
According to Protx
QuoteVSP Form is the ideal system for your website. It operates in a similar manner to the other Payment Service Providers, sending transaction registration information in hidden HTML fields through the customers browser

This means you can adapt the Paypal method....
1) New payment method
2) Put the appropriate code into \"Payment Extra Info\"
3) Write a script to deal with the response from Protx

This is not a detailed explanation, I have not read the details at protx and I am still learning myself.
Protx encrypt the details before they are submitted, This may cause extra difficulties.

It took me a week or so to get my Worldpay integration working.
And as a result I am far more aware of how MAMBO and PHP-shop works.
Title: Re:ProtX
Post by: mitch_a on October 26, 2004, 01:01:46 AM
Any joy with the Protx intergration ?

Grateful if you could update re progress / steps taken etc.

Thanks
Title: Re:ProtX
Post by: anij on December 02, 2004, 15:00:27 PM
I too am interested in a protx module.
I have used the one in OScommerce & it wirks fine.
You can easily look @ the code for that.
Title: Re:ProtX
Post by: chris on December 09, 2004, 00:18:59 AM
dlocksmith wrote:

This means you can adapt the Paypal method....
1) New payment method
2) Put the appropriate code into \"Payment Extra Info\"
3) Write a script to deal with the response from Protx

Hi dlocksmith

Have you had a chance to look at the Protx issue in more detail?

I would be very grateful for some more detail on your method of converting the Paypal to Protx.

Thank you for any help you can give.......and Merry Xmas!!!
Title: Re:ProtX
Post by: Kevin Igoe on January 14, 2005, 14:00:01 PM
Hi Folks

it seems ProtX is a pretty popular payment gateway. I'm also trying to integrate ProtX with my site, but all I've got so far is their VSP form. I'm trying to extact the necessary info out of that, as I believe that the process they use is similar to that used by authorize.net (who I can't use without a US$ account).

If anybody makes any more progress on this, or has any ideas, I'd appreciate it if you could get in touch. If you're interested in the PHPFormKit that they have, I have a cope and have it installed on http://www.tnc.k1z.com/PHPFormKit if you want to check it out.

Hope someone has more luck than I've had.
Ciao for niao
Title: Re:ProtX
Post by: anbujawahar R on February 03, 2005, 12:52:41 PM
:(  hello anyone got it right  on protx integration on mambo phpshop?  i have to add this to our site asap. pls reply to me.
Title: Re: ProtX
Post by: jema on March 26, 2005, 11:06:07 AM
Did this get done? I have just looked at the kit instructions and frankly it does not look very hard to do.
Title: Re: ProtX
Post by: chris on May 16, 2005, 13:33:14 PM
Hi

Another vote here for Protx integration....I won't hold my breath though, I've been waiting for nearly a year so far for some kind person to develop it ;)

Would be nice though as Protx are really cheap and reliable.
Title: Re: ProtX
Post by: xtencilate on May 24, 2005, 10:32:39 AM
Same here, would rely love some help with Protx.
Title: Re: ProtX
Post by: Maxbuyer on June 08, 2005, 21:59:24 PM
Another vote for Protx. Please consider adding this.
Title: Re: ProtX
Post by: Xirium on August 12, 2005, 10:54:45 AM
I have mambo-phpShop and ProTX integration working on http://www.pogoboxes.com/ (http://www.pogoboxes.com/). If anyone would like help with this matter then its quickest to contact me by telephone on +44 7867 774360.

Quote from: Danny LocksmithProtx encrypt the details before they are submitted, This may cause extra difficulties.

Y, that is a pain. Your shared secret, nonce, or whatever you want to call it, is not used to to generate a hash or checksum, like on most other systems. Instead, the majority of the fields are encoded within an encrypted payload. This means you get minimal feedback if you're using the wrong secret value. This wouldn't be too bad except ProTX insist that you demonstrate competence with ProTX's admin interface before you go live. This requires changing your configuration at least twice.

Persevere because it can be done.
Title: Re: ProtX
Post by: nickweavers on August 16, 2005, 10:17:07 AM
Hi Xirium, your ps_protx_cpi worked well for me last night. The bit that needs a little more work is the feedback of data about the transaction from protx.

I was trying to code up a page in the com_phpshop/html folder I called checkout.protx_cpi_result.php that will be the URL used by ProTx for both the SUCCESS and FAILURE cases. Since ProTx send this URL a crypt string that contains all you need to know about the outcome of the transaction, you can handle all of the different cases in this php file. Most importantly what I would like to do is take the authorisation code they send back for a successful transaction and store it in the database against the order.

Oh yeah, and because checkout.protx_cpi_result.php page is under the com_phpshop umbrella the Itemid for the URI will be the same as it is for the main pages and you don't have to create any new content pages up front as you do with your existing scheme  ;)

The message codes that are handed back are OK, NOTAUTHED, ERROR and ABORT. 

Thanks for the great work you have done and for the kind and generous support you gave a fellow mambo_phpshop'er  :)

 
Title: Adding the Protx vspForm payment method - Part 1
Post by: nickweavers on September 07, 2005, 23:18:38 PM
With the help of Xirium here is what you need to get Protx working in mambo-phpshop. I'll post the solution in parts as it exceeds the 2000 chars max allowed per post.

You need to place this php into a file called ps_protx_cpi.php under your httpdocs/CMS/administrator/components/com_phpshop/classes/payment directory:


<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* @version $Id: ps_protx_cpi.php,v 1.0 2005/07/26 17:00:00 gandalf Exp $
* @package mambo-phpShop
* @subpackage Payment
* @copyright (C) 2004-2005 Soeren Eberhardt
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*
*/

class ps_protx_cpi {

    var 
$classname "ps_protx_cpi";
    var 
$payment_code "PROTXCPI";

    
/**
    * Show all configuration parameters for this payment method
    * @returns boolean False when the Payment method has no configration
    */
    
function show_configuration() {
        global 
$PHPSHOP_LANG;
        
        
/** Read current Configuration ***/
        
require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");
        
?>

        <strong>ProtX Configuration</strong>
        <table>
          <tr><td><input type="text" name="PROTX_CPI_STORE_ID" class="inputbox" value="<? echo PROTX_CPI_STORE_ID ?>" Size=32 /></td>
  <td>The name of your store. Usually the same as your organisation.</td></tr>
          <tr><td><input type="text" name="PROTX_CPI_SECRET" class="inputbox" value="<? echo PROTX_CPI_SECRET ?>" Size=32 /></td>
  <td>The "Encryption Password" you get from ProTX.</td></tr>
  <tr><td><input type="text" name="PROTX_CPI_ApplyAVSCV2" class="inputbox" value="<? echo PROTX_CPI_ApplyAVSCV2 ?>" Size=32 /></td>
  <td>Activate the ProTX "Address and Security Code Verification (AVSCV2) Service". 0 for NO, 1 for YES</td></tr>
  <tr><td><input type="text" name="PROTX_CPI_Apply3DSecure" class="inputbox" value="<? echo PROTX_CPI_Apply3DSecure ?>" Size=32 /></td>
  <td>Activate the ProTX "3DSecure Service". 0 for NO, 1 for YES</td></tr>  
          <tr><td><input type="text" name="PROTX_CPI_REMOTE_HOST" class="inputbox" value="<? echo PROTX_CPI_REMOTE_HOST ?>" Size=32 /></td>
  <td>The hostname of the secure URL for the payment gateway. Given as "API Post URL" not "CPI Post URL". Ends with ".com".</td>
  </tr>
          <tr><td><input type="text" name="PROTX_CPI_REMOTE_PATH" class="inputbox" value="<? echo PROTX_CPI_REMOTE_PATH ?>" Size=32 /></td>
  <td>The path of the secure URL for the payment gateway. Given as "API Post URL" not "CPI Post URL". Everything after ".com" including a slash ("/").</td></tr>
          <tr><td><input type="text" name="PROTX_CPI_SUCCESS_URL" class="inputbox" value="<? echo PROTX_CPI_SUCCESS_URL ?>" Size=32 /></td>
  <td>The success URL. This should be 'http://www.yourdomain/CMS/index.php?&option=com_phpshop&page=checkout.protx_cpi_result' </td></tr>
          <tr><td><input type="text" name="PROTX_CPI_FAIL_URL" class="inputbox" value="<? echo PROTX_CPI_FAIL_URL ?>" Size=32 /></td>
  <td>The failure URL. This should be 'http://www.yourdomain/CMS/index.php?&option=com_phpshop&page=checkout.protx_cpi_result' </td></tr>
        </table>
        <?php
    
}
    
    function 
has_configuration() {
      
// return false if there's no configuration
      
return true;
    }
   
  
/**
* Returns the "is_writeable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
   
function configfile_writeable() {
      return 
is_writeableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }
   
  
/**
* Returns the "is_readable" status of the configuration file
* @param void
* @returns boolean True when the configuration file is writeable, false when not
*/
   
function configfile_readable() {
      return 
is_readableCLASSPATH."payment/".$this->classname.".cfg.php" );
   }
   
  
/**
* Writes the configuration file for this payment method
* @param array An array of objects
* @returns boolean True when writing was successful
*/
   
function write_configuration( &$d ) {
      
      
$my_config_array = array(
        
"PROTX_CPI_STORE_ID" => $d['PROTX_CPI_STORE_ID'],
        
"PROTX_CPI_SECRET" => $d['PROTX_CPI_SECRET'],
        
"PROTX_CPI_ApplyAVSCV2" => $d['PROTX_CPI_ApplyAVSCV2'],
        
"PROTX_CPI_Apply3DSecure" => $d['PROTX_CPI_Apply3DSecure'],
        
"PROTX_CPI_REMOTE_HOST" => $d['PROTX_CPI_REMOTE_HOST'],
        
"PROTX_CPI_REMOTE_PATH" => $d['PROTX_CPI_REMOTE_PATH'],
        
"PROTX_CPI_SUCCESS_URL" => $d['PROTX_CPI_SUCCESS_URL'],
        
"PROTX_CPI_FAIL_URL" => $d['PROTX_CPI_FAIL_URL']
      );
      
$config '<?php\n';
      
$config .= "defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); \n\n";
      foreach( 
$my_config_array as $key => $value ) {
        
$config .= "define ('$key', '$value');\n";
      }
      
      
$config .= '?>
';
 
      if ($fp = fopen(CLASSPATH ."payment/".$this->classname.".cfg.php", "w")) {
          fputs($fp, $config, strlen($config));
          fclose ($fp);
          return true;
     }
     else
        return false;
   }

// simplexor taken from protx.com php-form-kit.zip:

/*  The SimpleXor encryption algorithm                                                                                **
**  NOTE: This is a placeholder really.  Future releases of VSP Form will use AES or TwoFish.  Proper encryption      **
**      This simple function and the Base64 will deter script kiddies and prevent the "View Source" type tampering    **
**      It won't stop a half decent hacker though, but the most they could do is change the amount field to something **
**      else, so provided the vendor checks the reports and compares amounts, there is no harm done.  It's still      **
**      more secure than the other PSPs who don't both encrypting their forms at all                                  */

function simpleXor($InString, $Key) {
  // Initialise key array
  $KeyList = array();
  // Initialise out variable
  $output = "";
 
  // Convert $Key into array of ASCII values
  for($i = 0; $i < strlen($Key); $i++){
    $KeyList[$i] = ord(substr($Key, $i, 1));
  }

  // Step through string a character at a time
  for($i = 0; $i < strlen($InString); $i++) {
    // Get ASCII code from string, get ASCII code from key (loop through with MOD), XOR the two, get the character from the result
    // % is MOD (modulus), ^ is XOR
    $output.= chr(ord(substr($InString, $i, 1)) ^ ($KeyList[$i % strlen($Key)]));
  }

  // Return the result
  return $output;
}

/* The getToken function.                                                                                         **
** NOTE: A function of convenience that extracts the value from the "name=value&name2=value2..." VSP reply string **
**     Works even if one of the values is a URL containing the & or = signs.                                      */

function getToken($thisString) {

  // List the possible tokens
  $Tokens = array(
    "Status",
    "StatusDetail",
    "VendorTxCode",
    "VPSTxId",
    "TxAuthNo",
    "Amount",
    "AVSCV2",
    "AddressResult",
    "PostCodeResult",
    "CV2Result",
    "GiftAid",
    "3DSecureStatus",
    "CAVV" );

  // Initialise arrays
  $output = array();
  $resultArray = array();
 
  // Get the next token in the sequence
  for ($i = count($Tokens)-1; $i >= 0 ; $i--){
    // Find the position in the string
    $start = strpos($thisString, $Tokens[$i]);
    // If it's present
    if ($start !== false){
      // Record position and token name
      $resultArray[$i]->start = $start;
      $resultArray[$i]->token = $Tokens[$i];
    }
  }
 
  // Sort in order of position
  sort($resultArray);

  // Go through the result array, getting the token values
  for ($i = 0; $i<count($resultArray); $i++){
    // Get the start point of the value
    $valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;
    // Get the length of the value
    if ($i==(count($resultArray)-1)) {
      $output[$resultArray[$i]->token] = substr($thisString, $valueStart);
    } else {
      $valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;
      $output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);
    }     

  }

  // Return the ouput array
  return $output;

}

  /**************************************************************************
  ** name: process_payment()
  ** created by: gandalf
  ** description: process transaction through ProtX
  ** parameters: $order_number, the number of the order, we're processing here
  **             $order_total, the total cost of the order
  **             $d, transaction state
  ** returns: bool, true on successful transaction
  ***************************************************************************/
   function process_payment($order_number, $order_total, &$d) {

global $vendor_mail, $vendor_currency, $PHPSHOP_LANG, $database;

        require_once(CLASSPATH."payment/".$this->classname.".cfg.php");
        $auth = $_SESSION['auth'];

        // Get user billing information
        $dbbt = new ps_DB;
        $qt = "SELECT * FROM #__users WHERE id='".$auth["user_id"]."' AND address_type='BT'";
        $dbbt->query($qt);
        $dbbt->next_record();
        $user_info_id = $dbbt->f("user_info_id");
        if( $user_info_id != $d["ship_to_info_id"]) {
            // Get user billing information
            $dbst =& new ps_DB;
            $qt = "SELECT * FROM #__pshop_user_info WHERE user_info_id='".$d["ship_to_info_id"]."' AND address_type='ST'";
            $dbst->query($qt);
            $dbst->next_record();
        }
        else {
            $dbst = $dbbt;
        }

// system fields
$nl=chr(13).chr(10);
$temp="";
$temp.='VendorTxCode='.$order_number;
$temp.='&';
$temp.='Amount='.number_format($order_total,2,'.','');
$temp.='&';
$temp.='Currency='.$vendor_currency;
$temp.='&';
$temp.='Description=Your Order';
if(PROTX_CPI_SUCCESS_URL!='')
{
$temp.='&';
$temp.='SuccessURL='.PROTX_CPI_SUCCESS_URL;
}
if(PROTX_CPI_FAIL_URL!='')
{
$temp.='&';
$temp.='FailureURL='.PROTX_CPI_FAIL_URL;
}
$temp.='&';
$temp.='CustomerEmail='.substr($dbbt->f('email'),0,50);
$temp.='&';
$temp.='CustomerName='.substr($dbbt->f('first_name').' '.$dbbt->f('last_name'),0,30);
$temp.='&';
$temp.='VendorEmail='.substr($vendor_mail,0,2000);
$temp.='&';
$temp.='DeliveryAddress='.$dbbt->f('address_1').$nl.$dbbt->f('address_2').$nl.$dbbt->f('city').$nl.$dbbt->f('state').$nl.$dbbt->f('country');
$temp.='&';
$temp.='DeliveryPostCode='.substr($dbbt->f('zip'),0,20);
$temp.='&';
$temp.='BillingAddress='.$dbbt->f('address_1').$nl.$dbbt->f('address_2').$nl.$dbbt->f('city').$nl.$dbbt->f('state').$nl.$dbbt->f('country');
$temp.='&';
$temp.='BillingPostCode='.substr($dbbt->f('zip'),0,20);
$temp.='&';
$temp.='ContactNumber='.substr($dbbt->f('phone_1'),0,20);
$temp.='&';
$temp.='ContactFax='.substr($dbbt->f('fax'),0,20);
$temp.='&';
$temp.='AllowGiftAid=0';
$temp.='&';
$temp.='ApplyAVSCV2='.PROTX_CPI_ApplyAVSCV2;
$temp.='&';
$temp.='Apply3DSecure='.PROTX_CPI_Apply3DSecure;
$_SESSION['ProTX0_Post']="https://".PROTX_CPI_REMOTE_HOST.PROTX_CPI_REMOTE_PATH;
$_SESSION['ProTX1_VPSProtocol']='2.22';
$_SESSION['ProTX1_TxType']='PAYMENT';
$_SESSION['ProTX1_Vendor']=PROTX_CPI_STORE_ID;
$_SESSION['ProTX1_Crypt']=base64_encode($this->simpleXor($temp,PROTX_CPI_SECRET));
    return true;
   }
   
}


Title: Adding the Protx vspForm payment method - Part 2
Post by: nickweavers on September 07, 2005, 23:22:03 PM
Then paste this into a file called ps_protx_cpi.cfg.php in the same directory:



<?php
defined
('_VALID_MOS') or die('Direct Access to this location is not allowed.'); 
define ('PROTX_CPI_STORE_ID''yourProtxAccountName'); 
define ('PROTX_CPI_SECRET''stageOneEncryptionKey'); // stage 1
//define ('PROTX_CPI_SECRET', 'stageTwoEncryptionKey'); // stage 2
//define ('PROTX_CPI_SECRET', 'stageThreeEncryptionKey'); // stage 3
define ('PROTX_CPI_REMOTE_HOST''ukvpstest.protx.com'); // stage 1 & 2
//define ('PROTX_CPI_REMOTE_HOST', 'ukvps.protx.com'); // stage 3
define ('PROTX_CPI_REMOTE_PATH','/VSPSimulator/VSPFormGateway.asp'); // stage 1
//define ('PROTX_CPI_REMOTE_PATH', '/vps2Form/submit.asp'); // stage 2
//define ('PROTX_CPI_REMOTE_PATH', '/vps2Form/submit.asp'); // stage 3
define ('PROTX_CPI_ApplyAVSCV2''0'); //set this as desired
define ('PROTX_CPI_Apply3DSecure''0'); //set this as desired
define ('PROTX_CPI_SUCCESS_URL''http://www.yourdomain/CMS/index.php?&option=com_phpshop&page=checkout.protx_cpi_result');
define ('PROTX_CPI_FAIL_URL''http://www.yourdomain/CMS/index.php?&option=com_phpshop&page=checkout.protx_cpi_result');
?>



Replace the strings yourProtxAccountName, stageOneEncryptionKey and yourdomain with the appropriate values for your site and your Protx account.

Next paste the following code into a file called checkout.protx_cpi_result.php in directory httpdocs/CMS/administrator/components/com_phpshop/classes/html


<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
/*
* @version $Id: checkout.protx_cpi_result.php,v 1.13 2005/08/16 01:19:55 SiteWeavers Exp $
* @package Mambo_4.5.1
* @subpackage mambo-phpShop
* Contains code from PHPShop(tm):
@copyright (C) 2000 - 2004 Edikon Corporation (www.edikon.com)
* Community: www.phpshop.org, forums.phpshop.org
* Conversion to Mambo and the rest:
@copyright (C) 2004 Soeren Eberhardt
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*
* Protx VSPForm returns a buyer to this page at the end of a transaction. The URI must be 
* inspected to see whether the transaction was successful or not. 
* A successful transaction is signalled by an "OK" message. If successful it will also 
* contain an authorisation code which should be stored in the database against the order.
* Unsuccessful message codes are as follows:
* NOTAUTHED
* ERROR
* ABORT 
*/
if ($_GET) {

    
define('_VALID_MOS''1');

    global 
$database$mainframe$mosConfig_absolute_path$mosConfig_live_site$mosConfig_lang;

    
$database = new database$mosConfig_host$mosConfig_user$mosConfig_password$mosConfig_db$mosConfig_dbprefix );

    
// load Mambo Language File
    
if (file_exists$mosConfig_absolute_path'/language/'.$mosConfig_lang.'.php' )){
      require_once( 
$mosConfig_absolute_path'/language/'.$mosConfig_lang.'.php' );
    } else {
      require_once( 
$mosConfig_absolute_path'/language/english.php' );
    }

    
define('PHPSHOPPATH'$mosConfig_absolute_path.'/administrator/components/com_phpshop/');
    require_once(
PHPSHOPPATH."phpshop.cfg.php");

    
//Set up the mailer to infor Warehouse of validated order
    //require_once( $mosConfig_absolute_path . '/includes/phpmailer/class.phpmailer.php');
    //$mail = new mosPHPMailer();
    //$mail->PluginDir = $mosConfig_absolute_path . '/includes/phpmailer/';
    //$mail->SetLanguage("en", $mosConfig_absolute_path . '/includes/phpmailer/language/');

    // load the mambo-phpShop Language File 
    
if (file_existsADMINPATH'languages/'.$mosConfig_lang.'.php' )) {
      require_once( 
ADMINPATH'languages/'.$mosConfig_lang.'.php' );
    } else {
      require_once( 
ADMINPATH'languages/english.php' );
    }
    require_once( 
CLASSPATH'payment/ps_protx_cpi.cfg.php' );
    require_once( 
CLASSPATH'payment/ps_protx_cpi.php' );
    
// Load the mambo-phpShop database class
    
require_once( CLASSPATH'ps_database.php' );
    
// At this point we can access the simpleXOR function again and decode the crypt string
$message_from_protx ps_protx_cpi::simpleXor(base64_decode($_GET['crypt']),PROTX_CPI_SECRET);
$notification ps_protx_cpi::getToken($message_from_protx);
    require_once ( 
CLASSPATH 'ps_order.php' );
$ps_order = new ps_order;
$d['order_number'] = $notification['VendorTxCode'];

// Do it yourself method

$q "SELECT * FROM #__pshop_orders WHERE ".
         
"#__pshop_orders.user_id='".$auth['user_id']."' AND ".
 "#__pshop_orders.order_number='".$d['order_number']."';"
 ;
 
$database->setQuery($q);
    
$order_list $database->loadObjectList();
    if (
$database -> getErrorNum()) {
          echo 
$database -> stderr();
    }

$d['order_id'] = trim($order_list[0]->order_id);
switch ($notification['Status']) {
  case "OK":
    // The OK response is sent when a transaction is successfully authorised. The customer will be redirected 
// to the SuccessURL page (this page) which should store the TxAuthNo field against the transaction details in your database, 
// along with any other details you wish to store, before presenting the customer with successful completion details.
    $d['order_status'] = 'C';  //set the new value for the database field: X for cancelled, C for confirmed
    echo "Thankyou for your order.<br>";
    echo "You should receive confirmation of your order by email in a few minutes.<br>";
  break;
  case "MALFORMED":
    // The MALFORMED message is only sent if the Transaction Registration POST is poorly formatted. 
// This should not occur in a live environment (in fact, because you have reached this stage your 
// code is already sending correct messages). You should code your FailureURL (this page) to be able to handle 
// messages of this type, however.
  case "INVALID":
    // The INVALID message is only sent if the Transaction Registration POST contains illegal data. 
// Like the MALFORMED message, this should not occur in a live environment, but you should also code 
// your FailureURL (this page) to be able to handle messages of this type.   
   $d['order_status'] = 'X';  //set the new value for the database field: X for cancelled, C for confirmed
    echo "There was a technical problem problem processing this transaction. <br>";
    // Add code to send an email to Tony giving the order number and the username so he can investigate 
  break;
  case "NOTAUTHED":
    // The NOTAUTHED response is sent if the bank has declined the transaction three times. 
// The user has had mutliple chances to enter a valid card but none have been authorised.
  case "REJECTED":
    // The REJECTED message is sent if the banks authorised the payment but the AVS, CV2 or 3D-Secure rulebases 
// you have set up caused the VSP System to automatically cancel that authorisation because those security 
// criteria were not met.   
   $d['order_status'] = 'X';  //set the new value for the database field: X for cancelled, C for confirmed
    echo "Unfortunately your payment request has been declined by your bank. Please contact them for details.<br>";
  break;
  case "ABORT":
    // The ABORT message is sent when the user clicks the Cancel button on the payment page, 
// or if they close their browser, or after 15 minutes of inactivity.
    $d['order_status'] = 'X';  //set the new value for the database field: X for cancelled, C for confirmed
    echo "The order was cancelled.<br>";
  break;
  case "ERROR":
    // The ERROR message is only sent if something has gone wrong at PROTX. You'll receive this message very rarely 
// (occasionally during schedule dmaintenance) but your FailureURL code should be written to handle it.
    $d['order_status'] = 'X';  //set the new value for the database field: X for cancelled, C for confirmed
    echo "We are very sorry but ProTx is not processing payments at the moment. Please try again later.<br>";
  break;     
}

    
$ps_order->order_status_update($d);

}

?>



In the mambo-phpshop component admin, set up a payment method called ProTx CPI. Tick the "active" checkbox. Set the Code to PROTXCPI. Set the payment class name to ps_protx_cpi.


Finally you need to past this code into your mambo database. It goes in a column called payment_extrainfo in a table called mos_pshop_payment_method.

<?php
// This code goes into the database and is eval'ed
print "<Form Action=\\"".$_SESSION['ProTX0_Post']."\\" Method=\\"POST\\" Name=\\"protx\\">\\n";
foreach(
$_SESSION as $name=>$value)
 {
 if(
substr($name,0,7)=='ProTX1_')
  {
  
$name=substr($name,7);
  
$name=str_replace("<","&lt;",$name);
  
$name=str_replace(">","&gt;",$name);
  
$name=str_replace("\\"","&quot;",$name);
  
$name=str_replace("&","&amp;",$name);
  
$value=str_replace("<","&lt;",$value);
  
$value=str_replace(">","&gt;",$value);
  
$value=str_replace("\\"","&quot;",$value);
  
$value=str_replace("&","&amp;",$value);
  print 
"<Input Type=\\"hidden\\" Name=\\"$name\\" Value=\\"$value\\">\\n";
  }
 }
print 
"<Input Type=\\"submit\\" Value=\\"Make Payment\\">\\n";
print 
"</Form>\\n";
print 
"<Script Language=\\"JavaScript\\">\\n";
print 
"document.protx.submit();\\n";
print 
"</Script>\\n";
?>


NB: be careful not to editing this code in the payment method form (under the configuration tab) as you will lose backslashes and the code will cease to work. If you have to change the code, do it in the database using something like phpMyAdmin.

I did find a problem with another mambo-phpshop class method when the line

$ps_order->order_status_update($d);

is executed in checkout.protx_cpi_result.php.

In the file ps_order.php in directory httpdocs/CMS/administrator/components/com_phpshop/classes there is a function called mail_download_id.  In here you need to change this:

   } elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
      $q = "DELETE FROM #__pshop_product_download WHERE order_id='".$d['order_id']."'";
      $result = $db->query($q); 
      $db->next_record();

   }

to this:

   } elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
      $db = new ps_DB; // 27Aug2005 - NHW:  This line was missing and is required for the subsequent ps_DB method calls to work
      $q = "DELETE FROM #__pshop_product_download WHERE order_id='".$d['order_id']."'";
      $result = $db->query($q); 
      $db->next_record();

   }


Hope this helps a few folks...

Cheers,
Nick.
Title: Re: ProtX
Post by: ssm on October 24, 2005, 15:57:46 PM
ProtX seems very reasonable, having problems following the code, is there any chance that somebody could provide it as a module?

Thanks
Title: Re: ProtX
Post by: jmccann on December 01, 2005, 13:37:55 PM
I'd also like to add my voice to this request.

Protx should certainly be considered as a  choice for  Small Businesses  as charges  are very resonable.

jim mccann
Title: Re: ProtX
Post by: clintanderson on December 01, 2005, 16:45:44 PM
IS ProtX available for the U.S.A.?

Thanks,
Clint
Title: Re: ProtX
Post by: Ginger6 on December 05, 2005, 10:34:07 AM
Does anyone know how to amend the above so it works with Virtuemart?
Title: Re: ProtX
Post by: Chris Stead on December 22, 2005, 11:18:48 AM
Attached are files to implement protx v.2.22 as a payment provider for VirtueMart v1.0.1 running on Joomla 1.0.4. Many thanks to nickweavers for posting the original code that these mods are based on.

Note that I've added the extension .txt to the attached files as this forum doesn't allow .php extensions to be uploaded as attachments. The .txt extension needs to be removed before you use the attached files.

Installation
Put the attached files (without the .txt extension) in the following locations:
/administrator/components/com_virtuemart/classes/html/checkout.protx_cpi_result.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.cfg.php

In the Joomla-Virtuemart component admin, set up a payment method called protx Secure Payment (note that this name is visible to the shopper, so it needs to be meaningful). Tick the "Active" checkbox. Set the "Code" to PROTXCPI. Set the "Payment class name" to ps_protx_cpi. On the "configuration" tab set up appropriate values for your site and your protx account.

Modify the following file:
/administrator/components/com_virtuemart/classes/ps_order.php
Change the following code:
   } elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
      $q = "DELETE FROM #__pshop_product_download WHERE order_id='".$d['order_id']."'";
      $result = $db->query($q);
      $db->next_record();

   }

to this:
   } elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
      $db = new ps_DB; // 27Aug2005 - NHW:  This line was missing and is required for the subsequent ps_DB method calls to work
      $q = "DELETE FROM #__pshop_product_download WHERE order_id='".$d['order_id']."'";
      $result = $db->query($q);
      $db->next_record();

   }


Enjoy  ;)

[attachment cleanup by admin]
Title: Re: ProtX
Post by: doughammond on January 05, 2006, 23:41:41 PM
Hi all,

I've just had a stab at implementing this on mambo 4.5.2.3 and phpshop 1.2 (which i installed together as a bundle), and have encountered a few problems.

I thought that this solution may save me a day or two of coding - i'm not so sure anymore.

Firstly, i realise that possibly upgrading the whole system to joomla+virtuemart may help the situation - however it could also make it a lot worse.... i've spent the best part of 5 months getting my site to the state it's now in (almost comlplete, bar the payment handling bit). Upgrading isn't an option at this stage.

so, on to the problems:

i've used the code as listed by nickweavers, however i notice that there's a few details missing.
when entering the protx info into the 'payment methods' in the phpshop admin interface, which type should i use?
i've tried the first three but none work.
the first two both give "invalid card type" or something similar then checking out - probably because it doesn't actually list any types in the checkout process. so not surprising.

"bank debit" would be what i'd expect to use, but the checkout process goes through without ever asking me for any card details!! it's like the protx code simply does nothing at all.

BTW - I'm expecting to use VSP Forms here, and be directed to the protx site at some point. This doesn't happen.

Also, the bug regarding updating the config via the admin interface is somewhat annoying... i have to manually insert the PHP to be eval()'d into the DB and re-upload my .cfg.php file after cliccking Save. is this right? if i don't the admin interface brings up errors when i next go into the protx config, and the site gives errors when trying to checkout.

any further info or suggestions would be appreciated.

cheers,

Doug.


EDIT: Update - I'm now going through the precess of upgrading to joomla 1.0.4 and VM 1.0.1, in an attempt to get the above code to work...i figured i may as well upgrade now while we're still in testing.

edit edit: update - OK, panic over. turns out my template had removed a link to a JS functions file, which removed the ability to choose a card type.
for the record then, yes this works - it was my fault it didn't. thanks for providing the support here, it would have taken me much much longer than this to implement it on my own!
Title: Re: ProtX
Post by: dbooth on January 16, 2006, 12:25:19 PM
First off, thanks for posting the files for getting protx to work.

When setting up the payment method, is 'Use Payment Processor' the correct payment method type?

Have followed instructions as posted, but am getting the following error message on the select payment type screen;

Notice: Use of undefined constant PROTXCPI_CHECK_CARD_CODE - assumed 'PROTXCPI_CHECK_CARD_CODE' in /var/www/html/administrator/components/com_virtuemart/html/checkout.paymentradio.php(100) : eval()'d code on line 1

This only happens if Protx is the ONLY credit card payment method available - publish another payment method and no error message.

Also, can protx be used to accept Switch/Maestro payments?

<modify>OK, I get it now - Payment method type: should be set to PayPal (or related) which answers my first question and also solves the error message problem.

However, I am now seeing this error;

Notice: Constant _VALID_MOS already defined in /var/www/html/administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php on line 29

on the confirmation page.  Is this simply php error reporting level too high, or does checkout.protx_cpi_result.php need an amendment?</modify>
Title: Re: ProtX
Post by: David Preston on January 21, 2006, 21:26:57 PM
I am in the process of trying to implement nickweavers' protx solution for php-shop, but I am coming across several issues that I would greatly appreciate some help with...


Many thanks to those who have already put in a great deal of work on this payment module, but there is a danger it will not be fully worthwhile if there are too many obstacles to its implementation by less experienced users.
Title: Re: ProtX
Post by: David Preston on February 04, 2006, 21:17:44 PM
Update

We went live with Protx on Mambo/phpShop a couple of days ago, after making just a few changes to nickweavers' code from above.

If anyone else is struggling with this, I will give the details here.
Title: Re: ProtX
Post by: ramo on February 20, 2006, 19:25:49 PM
Hi David, can you please post information on how you successfully intergrated protx with virtuemart.  I am currently trying to do it.

Thanks
Title: Re: ProtX
Post by: David Preston on February 20, 2006, 20:56:42 PM
Not Virtuemart - phpShop. We haven't upgraded to Virtuemart yet.

Anyway, here's what changes we found necessary from nickweavers otherwise excellent post...

checkout.protx_cpi_result.php goes in /public_html/administrator/components/com_phpshop/html/

Comment out or delete this line
$database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix );
in that file.

We couldn't get nickweavers' version of payment_extrainfo to work, so we changed it to
<?php
echo '<form action="';
echo 
$_SESSION['ProTX0_Post'];
echo 
'" method="POST" name="protx">';

foreach(
$_SESSION as $name=>$value)
{
if(
substr($name,0,7)=='ProTX1_')
  {
  
$name=substr($name,7);
  
$name=str_replace('<','&lt;',$name);
  
$name=str_replace('>','&gt;',$name);
  
$name=str_replace('"','&quot;',$name);
  
$name=str_replace('&','&amp;',$name);
  
$value=str_replace('<','&lt;',$value);
  
$value=str_replace('>','&gt;',$value);
  
$value=str_replace('"','&quot;',$value);
  
$value=str_replace('&','&amp;',$value);
  echo 
'<input type="hidden" name="'.$name.'" value="'.$value.'">';
  }
}
echo 
'<input type= "submit" value="Make Payment">';
echo 
'</Form>';
echo 
'<script language="JavaScript">';
echo 
'document.protx.submit();';
echo 
'</script>';
?>


And remember you can't save the protx payment method in mambo - you do have to insert the payment_extrainfo code in the database through phpmyadmin or whatever, or the editor mangles it.

It's fiddly, but it does work eventually!
Title: Re: ProtX
Post by: playpal on February 21, 2006, 16:28:48 PM
Hi,

I am trying to get this to work, I have followed the instructions as used by Chris Stead files which say it works for implement protx v.2.22 as a payment provider for VirtueMart v1.0.1 running on Joomla 1.0.4

I have VirtueMart v1.0.2 and get the following error when trying to add the payment process in the Payment Admin page

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE in /CMS/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php on line 124

Will it work on v1.0.2?

Thank you for anyone who can confirm they have it working with virtuemart and joomla

Title: Re: ProtX
Post by: ssm on February 22, 2006, 20:34:31 PM
Hi all,

I requested protx on the old mambo-phpshop about a year ago, glad that there are others you have requested it. I have not tried the above method yet, can anyone else confirm if it works.

I have a site in Joomla 1.0.7 that I would like to set up wih VirtueMart and Protx as the payment method.

Hope somebody can help, maybe somebody could add it as a downloadable payment method addon.

Thanks.
Title: Re: ProtX
Post by: gamma911 on March 22, 2006, 17:57:41 PM
Hi

could anyone clarify how this is implemented - there seems to be some confusion as to where the files should go and where the code needs editing- I did try the original method with the files in the appropriate places but PROTX does not show up as a payment method- What have I done wrong any idea?
Title: Re: ProtX
Post by: David Preston on March 22, 2006, 20:11:25 PM
Are you on Mambo/phpShop or Joomla/VirtueMart?
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 10:18:31 AM
Im on Joomla / VirtueMart
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 11:07:31 AM
Hi everyone.

Its been a while since I looked in on this forum, and it seems some folk have been unable to implement ProtX using the code I posted. In particular playpal has been getting the following error:

QuoteParse error: parse error, unexpected T_STRING, expecting T_VARIABLE in /CMS/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php on line 124

I seem to remember coming across this error after I posted the my code here, and I did fix it - I just can't remember how :(

I've also noticed a more serious cock-up on my original posting  :-[. I said to put the file checkout.protx_cpi_result.php in the follwing directory /administrator/components/com_virtuemart/classes/html/
This was incorrect, and the file should in fact go here: /administrator/components/com_virtuemart/html/

I can't really remember all that I did to get this all sorted out, so the best I can offer is to post my current (working) versions of the ProtX files, which are running quite happily on my clients site (www.CountryFudge.com) under Joomla 1.0.7 and VirtueMart 1.0.2 (I'll get around to upgrading some time soon - honest!).

So, the instructions are now as follows:
(Note that I've added the extension .txt to the attached files as this forum doesn't allow .php extensions to be uploaded as attachments. The .txt extension needs to be removed before you use the attached files)

Installation
Put the attached files (without the .txt extension) in the following locations:
/administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.cfg.php

In the Joomla-Virtuemart component admin, set up a payment method called protx Secure Payment (note that this name is visible to the shopper, so it needs to be meaningful). Tick the "Active" checkbox. Set the "Code" to PROTXCPI. Set the "Payment class name" to ps_protx_cpi. On the "configuration" tab set up appropriate values for your site and your protx account.

Modify the following file:
/administrator/components/com_virtuemart/classes/ps_order.php
Find the following code:

elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
    ...
}

and make sure it looks like this:

elseif ($d["order_status"]==DISABLE_DOWNLOAD_STATUS) {
  $q = "DELETE FROM #__{vm}_product_download WHERE order_id=" . $d["order_id"];
  $db->query($q);
  $db->next_record();
}


Give it a go, and fingers crossed it'll all work happily ;)

[attachment cleanup by admin]
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 11:48:12 AM
Thanks for that , I have now implemented the files and when I get to PROTX side on the VSP SIMULATOR there are a few errors with the VENDORTXCODE containing illegal chars and the success URL contains the same...

Any idea how to correct this? presumably when there are no errors it will take me to the correct payment test page?
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 11:54:43 AM
Have you set up all the config values for your ProtX account correctly in configuration tab of the ProtX Payment Method definition in the VirtueMart administrator? (The ps_protx_cpi.cfg.php file I provided for download doesn't have 'real' values for the VENDORTXCODE or success URL)
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 12:00:58 PM
yes I have set the correct values including the vendor name and also the success url and hash password but does this also need to be set in the actual file? or just the admin back end?
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 12:03:11 PM
Setting it in the admin backend should set it in the file - its worth checking the content of the file to make sure it isn't full of rubbish though.
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 12:04:41 PM
Ill do that now and report back
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 12:12:05 PM
Right I've checked the file and the backend(admin side) both report the same and no illegal chars - The success URL and failure URL is exactly the same but yet one reports illegal chars?

There are some chars that look like boxes don't know what that is - this is the code for the vendor TX 2f67fefa6604dc4221a34b40c889fe
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 12:21:41 PM
Is this the value of Vendor TX in your ps_protx_cpi.cfg.php file? I'm confused; my  ps_protx_cpi.cfg.php file doesn't have a vendor TX in it.
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 12:28:25 PM
I have invited you for a chat in gmail if ur on - mine doesnt have a vendor TX this looks like the encrypted vendor id is being decrypted incorrectly - no i dont have a vendor tx in it but i do hava a Store ID and I presume this is the same thing? thats why I cant understand why there is a problem with illegal chars?

this is mine -
<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
define ('PROTX_CPI_VPSProtocol', '2.22');
define ('PROTX_CPI_STORE_ID', 'thisismyid');
define ('PROTX_CPI_TxType', 'PAYMENT');
define ('PROTX_CPI_SECRET', 'MyHaShPassWORD');
define ('PROTX_CPI_ApplyAVSCV2', '0');
define ('PROTX_CPI_CHECK_CARD_CODE', '1');
define ('PROTX_CPI_Apply3DSecure', '0');
define ('PROTX_CPI_REMOTE_HOST', 'ukvpstest.protx.com');
define ('PROTX_CPI_REMOTE_PATH', '/VSPSimulator/VSPFormGateway.asp');
define ('PROTX_CPI_SUCCESS_URL', 'http://s154408966.websitehome.co.uk/arranbanner/index.php?option=com_virtuemart&page=checkout.protx_cpi_result');
define ('PROTX_CPI_FAIL_URL', 'http://s154408966.websitehome.co.uk/arranbanner/index.php?option=com_virtuemart&page=checkout.protx_cpi_result');
?>
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 12:46:41 PM
Haven't noticed any GMail chat invite popping up.

Your config file looks good to me. I can't think of any reason why its not working. Sounds like ProtX isn't decrypting your data properly.
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 12:48:56 PM
Sent you a mail , Thanks for the help BTW - Yes it looks like that is whats happening its not decrypting the data properly - hmmmmm weird. Do you think I should contact PROTX? could it be anything todo with the code?
Title: Re: ProtX
Post by: moonbeaver on March 23, 2006, 13:09:29 PM
Helo Gamma/Chris

I'm following this thread carefully, I'm at exactly the same stage as Gamma - my urls also appear not to be decrypting correctly... any solutions, do share!

Thanks
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 13:17:35 PM
Yes Well my vedor ID decrypted properly when I tried it in INTERNET EXPLORER but the URL still doesnt decrypt properly.. now I wonder if this is a FIREFOX issue? ,,

Moonbeaver - does your vendor ID decrypt correctly?
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 13:24:29 PM
Right for some reason now it works?

Well this time anyway!!(in IE) - I changed the
// system fields
    $nl=chr(13).chr(10);
    $temp="";
    $temp.='VendorTxCode='.$order_number;

to

// system fields
    $nl=chr(13).chr(10);
    $temp="";
    $temp.='VendorTxCode='.$order;

Tried that and it did not worked (asked if the Has password was correct) (it was)
so I changed it back and now all decrypted properly!

This is too weird!
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 13:29:23 PM
Well looks like Firefox also decrypts properly now?! OFFICIALLY STUMPED!

OK next now that all decrypts properly I presume that I have to change the Secure Simulater URL to the testvendor URL ? Anyone know what that is? to accept test card details, and then after that real details?
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 13:31:54 PM
As a random stab in the dark, maybe the encoding of the PHP file is screwy, and the simple act of opening it and saving it has made a difference - dunno, I'm getting out of my depth here  ::).
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 13:34:45 PM
Yes so am I! busy drowning actually! but anyway now for the next step to actually get to a testvendor page...Ideas?
Title: Re: ProtX
Post by: Chris Stead on March 23, 2006, 13:40:49 PM
Its all in the VSP Form Protocol and Integration Guidelines document available from ProtX (VSPFormProtocolandIntegrationGuideline.pdf):

Quote
Stage 2
Once your site is able to talk to VSP Simulator and process all possible outcomes,
an account will be created for you on the VSP Test Server. This is an exact copy of
the live site but without the banks attached. Authorisations on the test server are
only simulated, but the user experience is identical to Live, and a version of the
VSP Administration pages also runs here so you can familiarise yourself with the
features available to you.
The VSP Admin system for viewing your Test transactions is at:
https://ukvpstest.protx.com/VSPAdmin
Transactions from your scripts should be sent to the Test Site VSP Form at:
https://ukvpstest.protx.com/vps2Form/submit.asp
Title: Re: ProtX
Post by: moonbeaver on March 23, 2006, 13:41:20 PM
Testvendor url is entered like this I think:

define ('PROTX_CPI_REMOTE_HOST', 'ukvpstest.protx.com');
define ('PROTX_CPI_REMOTE_PATH', '/vps2form/submit.asp');
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 13:45:12 PM
Yes that worked - excellent! Thanks for that
Title: Re: ProtX
Post by: moonbeaver on March 23, 2006, 14:17:53 PM
My redirect after a transaction still isn't working - I just get a blank page...
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 15:02:35 PM
what is ur URL for the redirect and does your decrypted links now decrypt correctly?
Title: Re: ProtX
Post by: moonbeaver on March 23, 2006, 15:18:55 PM
redirect url is htp://www.mysite.com/index.php?&option=com_virtuemart&page=checkout.protx_cpi_result



Before switching over to ('PROTX_CPI_REMOTE_HOST', 'ukvpstest.protx.com'), decryption appeared to be fine

- my real encryption password is correct, so maybe there's a problem with the checkout.Protx_cpi_result.php


this is tricky...
Title: Re: ProtX
Post by: moonbeaver on March 23, 2006, 15:35:30 PM
after successfully completing the test transaction at Protx, I'm redirected to the following

www.mysite.com/index.php?option=com_virtuemart&page=checkout.protx_cpi_result&crypt=Bw5TLREUCDsbHm4NGwAIJwACcTYAAggVYQAPUU0HVWQ3TwZtBQNRRWMJDQxAVlQ3NRgGaQJUBlIGaGs8DS0DaC9KAmlUVwU1ZBUJLjFdSmVkSgN0VFcFRH18AVg0VVNgZzsEYVEaEyAoeU0cHSoIaGdLA2pTVQBSEVVXHRsQWm1nXHMPNyRjRm15dCRVKSYBFzIUGAADRxEjS2oNBhELIWk3cw0nL3AwdmhXGwEnCDExKFcqEQtBSR15bCs9ISNzFywACwEUQBgkBXUpIScvEBBcdTACE3QdNAUITkYgNDA3D0A8NxNUACVLBU42JTEDaQ==

that can't be right...
Title: Re: ProtX
Post by: gamma911 on March 23, 2006, 16:37:46 PM
Thats what mine does too and its a blank page (within my site) so I just need to figure out how to make that page not blank .

Will try and create a static page that says - Payment Successful and a link to go home. Will see if that works>
Title: Re: ProtX
Post by: moonbeaver on March 26, 2006, 14:24:26 PM
did you get anywhere with that gamma? I'm stuck at the blank page...
Title: Re: ProtX
Post by: gamma911 on March 27, 2006, 10:19:08 AM
Well mine takes me to a blank page in my site (with the CSS and so on loading) but the page is blank nevertheless.


Need to figure out how to just put a link to the home page and something to the likes of thank you for your order it is being processed.

Any ideas?
Title: Re: ProtX
Post by: ssm on April 03, 2006, 10:32:28 AM
Hi people,

I have a couple of general questions regarding the protx integration:

1. I believe that there are two ways to process orders using protx, one processes the order on the protx site, the other on your own. Which one is this guide reffering to, or can it use either?

2. I tried to integrate the barclays payment processor with VM, one of the problems is that the invoice gets sent to the individual, even if they do not finalise payment on the barclays site, would this be the same with Protx?

Thanks.
Title: Re: ProtX
Post by: gamma911 on April 03, 2006, 10:47:16 AM
This method works with processing the payment on the PROTX server. Not sure how its done on your own? Can anyone shed light on this?

Not sure about the invoice issue, will look into this.... Im still having a major hurdle with my integration and that is after payment has been processed the status of the item does not get updated to Processed it still stays on PENDING, therefore the link (I sell downloadable content) does not get sent out.

ANYONE have any light on this ?
Title: Re: ProtX
Post by: ssm on April 03, 2006, 10:51:40 AM
Sorry to hear that you are having problems. I have not yet tried to get it working myself.

Just on a separate note, if you still need to get on online merchant account, how can protx be cheap? For instance, Barclays online merchant account comes with a payment gateway, all for £25 p/m plus 2% per transaction. Now, if I I take out protx, I will be paying the above plus Protx charges, is this correct? Or will Barclays have a cheaper tariff if I am using a separate payment processor?

Thanks.
Title: Re: ProtX
Post by: gamma911 on April 03, 2006, 11:08:32 AM
Not sure what your individual bank charges are - or if there is a discount if you use another payment processor (probably will be) I work for a company so I don't know what the costs are involved for a merchant account.
Title: Re: ProtX
Post by: micinter on April 10, 2006, 19:46:17 PM
Hi, i am affraid that i am finding this quite confusing. I have a Protx testing account, and i have set up the payment module, and from the configuration values i have added i get a response from Protx. However, it keeps coming back saying the following:

QuoteVPSProtocol=2.22
Status=MALFORMED
StatusDetail=The VendorTxCode field is missing from the POST

So, my questions:
Is this payment module designed to work with Protx Direct or am i completely wrong there?
What is the encryption password i get from Protx?
and why is my VendorTxCode field missing (what is supposed to be in this field, i have no idea what it is)?

Thanks very much, i very gratefull to everyone working on this module.

Mike
Title: Re: ProtX
Post by: Bobberuk on April 18, 2006, 16:43:34 PM
I too would be very keen to see a Protx payment module. I have a client who is a Protx customer. I have built his site in Joomla, now we have Virtuemart installed and wish to use this for his shop.

I would be happy to pay someone who can successfully add a Protx gateway to the site for me.

Anyone?

Bob
Title: Re: ProtX
Post by: dj_mystic82 on April 20, 2006, 11:15:20 AM
Hi all,
I'm also trying to implement protx into Virtuemart (1.0.4) - I have uploaded the files, modified ps_order.php and added my protx details etc. I get the following error when trying to place an order:

Not Acceptable
An appropriate representation of the requested resource /~lowtherp/index.php could not be found on this server.

The site is currently on a testing domain name (www.hydrant1.co.uk/~lowtherp), when the site goes live it will resolve to www.lowtherparkfarms.co.uk. Could this be the cause of this, or is it something else?
Title: Re: ProtX
Post by: ssm on April 20, 2006, 11:18:33 AM
I seem to remember that I had a similar error message. I will check it now.

Thanks.
Title: Re: ProtX
Post by: dj_mystic82 on April 20, 2006, 14:26:12 PM
Quote from: dj_mystic82 on April 20, 2006, 11:15:20 AM
Hi all,
I'm also trying to implement protx into Virtuemart (1.0.4) - I have uploaded the files, modified ps_order.php and added my protx details etc. I get the following error when trying to place an order:

Not Acceptable
An appropriate representation of the requested resource /~lowtherp/index.php could not be found on this server.

The site is currently on a testing domain name (www.hydrant1.co.uk/~lowtherp), when the site goes live it will resolve to www.lowtherparkfarms.co.uk. Could this be the cause of this, or is it something else?

I found that turning on a second payment method (ie cash on delivery) stopped this error from appearing.

Is it possible to only have one payment method though?
Title: Re: ProtX
Post by: Bobberuk on April 20, 2006, 14:36:58 PM
Im following this thread with interest. Can someone tell me if this is actually working yet? There doesnt appear to be any definitive answer as to whether Protx can be fully implemented without any issues with Virtuemart or not.

If it can be done, how about a 'how to' for all of us?

Thanks :)

Bob
Title: Re: ProtX
Post by: dj_mystic82 on April 20, 2006, 14:51:47 PM
I managed to get ProtX working (but only in Testing mode at the moment) , I'm using Joomla 1.0.7 and Virtuemart 1.0.4.

Here's what I did:
Upload the three files supplied by Chris Stead in reply 32 of this thread.
Changed the code in ps_order.php also mentioned in reply 32.
I couldn't put in my ProtX password and id in the administration, so I put it in the ps_protx_cpi.cfg.php

These are the variables I changed:
PROTX_CPI_STORE_ID  - I used my ProtX vendor name here, but I think it can be anything you choose.
PROTX_CPI_SECRET  - your encryption password
PROTX_CPI_SUCCESS_URL  - Added the site url to the start of the string before index.php....
PROTX_CPI_FAIL_URL  - Added the site url to the start of the string before index.php....

I set up a new payment method with these settings:
Method Name: Secure Credit/Debit Payment with ProtX
Code: PROTXCPI
Class Name: ps_protx_cpi
Method: Paypal (or related)

With this payment method acivated on its own I got an error when placing an order. With the cash on delivery activated as a second payment method, ProtX works fine.

This is of course all in ProtX testing mode so I'm unsure if it will all work just as smoothly once it is totally live.
Title: Re: ProtX
Post by: Bobberuk on April 20, 2006, 18:36:03 PM
So it seems that there is light at the end of the tunnel.

What steps need to be taken in order to have Protx recognise Virtuemart as an approved shopping cart? Who actually makes a payment interface official? Surely with the right kind of pressure applied in the right places, and the availability of code that appears to work, someone can publish a working solution?

Anyone?

Bob :)
Title: Re: ProtX
Post by: Bobberuk on April 22, 2006, 09:59:59 AM
Anyone?
Title: Re: ProtX
Post by: gamma911 on May 01, 2006, 12:47:23 PM
Im still also waiting Seems there is no developer support for this anymore?? Does this mean we will have to abandon Virtuamart?

My BIGGEST problem with this is that when PROTX sends back the OK the vurtuamart order status DOES NOT update from pending to completed.

Why?
Title: Re: ProtX
Post by: ssm on May 02, 2006, 16:09:22 PM
Which version of protx gateway is this guide reffering to? I notice that Prtox has several, I.E. VSP Form, VSP Server, VSP Direct etc.

Thanks for any help
Title: Re: ProtX
Post by: nickweavers on May 04, 2006, 17:26:51 PM
Hi, the method I originally published was to integrate the VSP Form version which hands over control of the actual payment transaction to Protx's own secure payment servers. When they are done taking the card details and doing the verification they return you to your site using the URL you pass them. They also supply an encoded string which you decode to get information about the success of the transaction. Based on this you can decide to "ship the goods" or "enable the download" or not.

I must give credit for a lot of the work to Xirium (aka Danny Locksmith). The bit I worked on was mainly to do with the post processing of the transaction (ie the process the returned string and "ship the goods" or not bit).

Danny did go on to get Protx working with mambo/phpshop in its integrated version (VSP Direct I think), which is where you actually take the card details. This looks a lot cleaner from the customers point of view as there is no hopping from one site to another, but it means you must use https (ie http with the secure sockets layer) to safeguard the customers details. This, unfortunately, adds more complexity.

As for VirtueMart under Joomla, it looks like Chris Stead has done a fine job of porting the mambo/phpshop solution I posted, with an additional tweak to handle the enabling/disabling of down-loadable merchandise orders which I had not looked into. You need to read all Chris' posts in the thread though, as he adds a few corrections after his initial post.
Title: Re: ProtX
Post by: gamma911 on May 11, 2006, 13:22:32 PM
WEll everyone still has problems with PROTX

Can anyone tell me why PROTx does not update the order status?

What variables do I have to look at to get the order status to change correctly?
Title: Re: ProtX
Post by: Priz on May 27, 2006, 23:27:22 PM
I have installed the scripts as per Chris' instruction and it works  ;D

Well nearly, "OK" transactions are processed and and marked as confirmed :D but "NOTAUTHED" and "INVALID" transations have an interesting problem.  The crypt string does not appear to be decrypted properly.  If I display the value of the 'Status' field before entering the switch statement I get strings like "NOTAjÂÅV•¸..." (approx 300 characters long).

I have tried copying and replace the relevant functions from the Protx SDK over the ones Chris provided and still no joy :(

Any advice on what I am missing would be great.  Please feel free to state the obvious, I am not new to programming but I would have to describe my PHP skills as novice.

Thanks

Priz
Title: Re: ProtX
Post by: Iain on August 10, 2006, 18:49:01 PM
After what feels like years of searching, I have finally cracked the problem of some orders being passed back correctly by Protx and some not - the ones that are not go back to a blank page or simply don't update the database with the order status.

Between the Protx support section on their site and the Zen Cart forum (!!) I found the following:

If you are unable to decode the crypt string on your completion page, and are using PHP, this will be a URL encoding issue. When data is passed to our system it needs to be URL encoded, which means that spaces need to be replaced with a +. (or  %20 depending on the URL encoding used). Newer versions of PHP are removing the plusses (+) and putting the spaces back in before you run the decode routine on your completion page.
(NB: Versions of PHP that seem to have changed in the way they treat + symbols, are PHP 4.4.1 and 4.4.2. )


The solution is therefore a simple str_replace to sort out the 'crypt' part of the url sent back by Protx before decoding it. Two cautions; firstly I am in the very early stages of testing it, but I cannot currently replicate errors that routinely appeared before hacking around the code. Secondly, I'm not sure my coded solutions is syntactically the most elegant - I'm not the world's greatest PHP coder - but it does at least seem to work and that will do for me for now!

The solutions I came up with was to edit checkout.protx_cpi_result.php by inserting the following after line 61:

   $crypt=$_GET['crypt'];
   $decrypt=(str_replace(' ', '+', $crypt));

and then change the line that was at line 62:

$message_from_protx = ps_protx_cpi::simpleXor(base64_decode($_GET['crypt']),PROTX_CPI_SECRET);

to the following:

$message_from_protx = ps_protx_cpi::simpleXor(base64_decode($decrypt),PROTX_CPI_SECRET);

Hope this helps someone!



Title: Re: ProtX
Post by: Priz on August 14, 2006, 23:05:36 PM
Quote from: Iain on August 10, 2006, 18:49:01 PM
Hope this helps someone!

It helped me  ;D - Thanks

Priz
Title: Re: ProtX
Post by: Peter Clements on September 06, 2006, 14:05:48 PM
I'm posting this just in case anyone has the same problems we had.

Firstly, thanks for this payment module – followed the instructions months ago and EVERYTHING worked first time, only took 5 minutes from start to finish.

Recently we've had complaints from a client using VM with the Protx Payment Module that he is being emailed a few times a week by customers of his who are complaining that their Protx emails are telling them that their shipping address is the same as their billing address despite the fact that they had entered and selected a shipping address different to billing address.

I've found that editing lines 304 and 306 of the "ps_protx_cpi.php" file did the trick, changing all references of "$dbbt" to "$dbst".  This will pass the selected shipping address to Protx correctly.

BE SURE to leave all other references of "$dbbt" alone (i.e. those not on lines 304 or 306) as that's stuff handling the passing of the billing information.

Hope this helps and makes sense! :)
Title: Re: ProtX
Post by: maia on November 03, 2006, 18:15:30 PM
Just a quick question:

Could i use this payment module if i'm trying to implement a 3dsecure ecommerce solution ?

Thanks,
MAIA
Title: Protx Transaction code
Post by: John - Australia on November 06, 2006, 13:38:37 PM
Hi
does anyone know how to change the protx gererated tx code with the order numbr generated by Virtuemart
Title: Re: ProtX
Post by: John Butler on February 27, 2007, 18:52:35 PM
Hi,

I am building a Joomla test site for a not-for-profit personal development group in the UK. (http://yesgroup.org.uk/Joomla/)

I have been working my way through all the posts in this thread and have Protx Form working with Virtuemart 1.0.9 up to a point.  My php coding knowledge is non-existent, so I'm attempting to second guess the reasons.

I appear to have the issue referred to by gamma911 & moonbeaver in posts 55-58, 60 & 72, i.e. I get the corrrect responses on the Protx test area but when the encrypted code is sent back after successfully completing the test transaction at Protx, I get the following issue :-

A blank page with a "Page not found - The page you requested was not found on this web server." error message in response to attempting to resolve the generated link to the address "http://yesgroup.org.uk/joomla/index.php?&option=com_virtuemart&page=checkout.protx_cpi_result&crypt=...." delivered from Protx.

As I understand it, the checkout.protx_cpi_result.php file is not being found or referenced correctly by the setup file/response link to decrypt the data and process the outcome correctly within Virtuemart.  Am I correct?

As this thread has been dormant for some time, has anyone managed to resolve and get this working correctly since the last informative posts in August/September last year?

Sloop :)
Title: Re: ProtX
Post by: baggiesmad on March 28, 2007, 12:41:39 PM
Ive added the three files to my site like chris and yourself have done.

Ive created a new payment, but when I click save i get this error....



Warning: fopen(/home2/smashing/public_html/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.cfg.php) [function.fopen]: failed to open stream: Permission denied in /home2/smashing/public_html/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php on line 158


Ive also edited the "ps_protx_cpi.cfg.php" and added my password and store info.

I then tested the store out.

I added an item to my basket, selected protx payment which then confirms my order. after this, it takes me to the protx VSP simulation page on their site.

the problem is that it throws up a few problems.

Submission Errors
VSP Simulator has found the vendor 'mydomain' in the database but it is not enabled for VSP Form. If you intend to use VSP Form with this account, log into the accounts section of VSP Simulator and enable VSP Form.


Any help would be great.

Title: Re: ProtX
Post by: Vdub on April 01, 2007, 22:31:15 PM
Thanks to Chris Stead I  have a fully functioning Protx payment module. After making the necessary modificaitions with the instructions provided by Chris. Testing on the vsp simulator went okay. Test transactions on the live simulator have gone okay.

So fingers crossed all will go okay. Thanks to all contibuters. Good luck to those who are installing the Protx module
Title: Re: ProtX
Post by: Marcus on April 13, 2007, 14:39:52 PM
Yep, like Maia we are also looking for Protx 3D Secure integration with virtuemart 1.09 and Joomla 1.012.  Any help would be greatly appreciated.
Title: Re: ProtX
Post by: TRIPLEdm on April 25, 2007, 12:28:35 PM
Can anybody help me intergrate PROTX with Virtuemart?... I have a client insisting on useing PROTX but just dont know how to do it for them.

Thank you in advance.
Title: Re: ProtX
Post by: TRIPLEdm on April 25, 2007, 12:36:30 PM
I have found this solution... not tested but hoping for some feedback http://www.ecom-solution.com/index.php?page=shop.browse&category_id=1&option=com_virtuemart&Itemid=54
Title: Re: ProtX
Post by: smalcolm on May 03, 2007, 18:31:57 PM
Just wanted to say thanks to everyone that contributed to this thread - Ive just got protx integration working. THANKS!

my biggest stumbler was 'invalid URL' messages, then bizzarely when I was trying to checkout I was being redirected to wikipedia page on https!!!!!

The problem was that I had the CPI_REMOTE_HOST set to https://ukvpstest.protx.com when it should just be set to ukvpstest.protx.com.

After re-reading this thread, I can see that all the code have it set properly - not sure how I managed to screw it up, but if I did it, maybe you have to??
Title: Re: ProtX
Post by: Lee Wilson on June 11, 2007, 14:58:56 PM
Hi there,

Has anyone successfully implemented Virtuemart 1.0.10 with Joomla 1.0.12 ?

I've followed this thread and I thought Chris Steads posts were great, however there is no ps_orders file to edit with the latest version of virtuemart.

I've also tried downloading the module from http://www.terinea.co.uk/blogs/terineatechtips/2006/10/03/protx-for-virtuemat/ but am getting all sorts of funnies.

The last resort I'm thinking of unless anyone comes back to me from here is to purchase the module from www.ecom-solutions.com, but I'm not sure that will work either - and there is no feedback on this either.

If anyone has any suggestions / pointers I would be extremely grateful.

Thanks
Title: Re: ProtX
Post by: baggiesmad on June 11, 2007, 15:44:32 PM
Quote from: Lee Wilson on June 11, 2007, 14:58:56 PM
Hi there,

Has anyone successfully implemented Virtuemart 1.0.10 with Joomla 1.0.12 ?

I've followed this thread and I thought Chris Steads posts were great, however there is no ps_orders file to edit with the latest version of virtuemart.

I've also tried downloading the module from http://www.terinea.co.uk/blogs/terineatechtips/2006/10/03/protx-for-virtuemat/ but am getting all sorts of funnies.

The last resort I'm thinking of unless anyone comes back to me from here is to purchase the module from www.ecom-solutions.com, but I'm not sure that will work either - and there is no feedback on this either.

If anyone has any suggestions / pointers I would be extremely grateful.

Thanks

I have successfully implemented protx with virtuemart this week using this method and the latest version of virtuemart.
Title: Re: ProtX
Post by: Lee Wilson on June 11, 2007, 17:06:10 PM
Hi there, which method did you use ? the method via Chris Stead or other ?

It mentions editing the ps_order files in /components/com_virtuemart/classes/ which I didn't have on my set-up.

Any pointers would be gratefully received.
Title: Re: ProtX
Post by: baggiesmad on June 11, 2007, 17:15:08 PM
Quote from: Lee Wilson on June 11, 2007, 17:06:10 PM
Hi there, which method did you use ? the method via Chris Stead or other ?

It mentions editing the ps_order files in /components/com_virtuemart/classes/ which I didn't have on my set-up.

Any pointers would be gratefully received.

I used the first method chris posted up in here (page 3)

I have just set it up again as Im working on three virtuemart powered sites.

follow each step and it works..

Just make sure you have your vendor name and encrypted password correct.
Title: Re: ProtX
Post by: Lee Wilson on June 11, 2007, 17:30:46 PM
Yeah understand about the vendor name /password. But my problem is that I don't have the /classes/ps_order file / directory in my set-up. Had to create the classes directory to place the other files from Chris's thread in there.

What creates the classes directory in the VM component ? I think I'm missing a trick here somewhere.
Title: Re: ProtX
Post by: baggiesmad on June 11, 2007, 17:37:48 PM
You didnt have this location within your virtuemart download package?

/administrator/components/com_virtuemart/classes/payment/..
Title: Re: ProtX
Post by: Lee Wilson on June 11, 2007, 21:26:00 PM
I've installed version 1.0.10 and I don't get

/administrator/components/com_virtuemart/classes

I had to create this to populate the payment/ files that Chris covered in his mail.

Anyway we have just installed another product called ECJC and set-up protx in 2 minutes flat...

good luck everyone.
Title: Re: ProtX
Post by: Dave on June 14, 2007, 13:21:00 PM
Hello there,

I've just installed the instructions posted by Chris Stead, I must say this was a breeze, and my protx testing is going really well - thanks.

I have a question though. All of the orders I am putting through come back with ' You brought : Your order'

Is there a way of configuring this message so that the actual order description comes up here?

I see that this is picking up this message from the ps_protx_cpi.php file, but am not sure what to put here.

Thanks in advance.

Title: Re: ProtX
Post by: Dave on June 16, 2007, 14:17:45 PM
Hello,

I'd appreciate any help with this and am willing to pay someone a few bucks to sort out.

I am testing transactions at the moment and I've just realised something isn't quite right.

I get the emails ( and so does the customer) from protx, and also the pending order notification.
I am returned to the site and the order says successful, view your order details here. The order status on this screen is set to confirmed, however the customer or admin are not getting the status change email to say confirmed.

I've just turned on debug and there is an error on the confirmation screen, but I'm no real coder, so any help in resolving this would be great.

Notice: Constant _VALID_MOS already defined in /home/fhlinux169/sitename/user/htdocs/administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php on line 33



Title: Re: ProtX
Post by: Dave on June 20, 2007, 18:12:30 PM
Hi there again,

quick question regarding Protx VSPform and 3d secure...

Does anyone have this working ?

Is it simply a case of arranging for this to be activiated through Prtox, and once activated it will work with the current solution posted here ?

Or, if I were to activate it is there a whole host of other amendments that I would need to do to get this to work ?

I don't want to swith it on, only to find it buggers up my current set-up.

Thanks
Title: Re: ProtX
Post by: Chris Stead on July 10, 2007, 15:42:29 PM
Its been a long time since I logged on to this forum!

I'm glad that so many of you have found my posts useful.

In the last couple of days I've been asked to enable 3D Secure on a VirtueMart/Protx site, and its really very simple - just log into the Protx admin area and enable 3D Secure, end of story!

Whilst testing the site I noticed that returned messages from Protx were not decoding properly, so here is an updated version of checkout.protx_cpi_result.php which uses the utility functions in functions.php (which is part of the php-form-kit.zip supplied by Protx).

The updated version also sends order status change notification emails based on the success/failure of the payment process.

[attachment cleanup by admin]
Title: Protex vendortxcode
Post by: John - Australia on August 22, 2007, 05:41:04 AM
HI
does anyone know how to include (or replace) the order_number with the order_id. The order number is pretty meaningless in notifications. I have tried changing order_number to order_id in ps_protx_cpi.php and checkout_protx_cpi_result.php, but it ddnt seem to make any difference

John
Title: Re: ProtX
Post by: Ciaran on September 02, 2007, 20:49:40 PM
Hi,

I've installed the files that Chris put up. All I would like to know is, when a customer puts in their card details its not a https:// connection. Is the customers credit card being send over the internet un-encrypted?

Also what are the extra files Chris posted for? I'm new to virtuemart and am kinda pokeing around in the dark a lot.

Ciaran
Title: Re: ProtX
Post by: gamma911 on October 11, 2007, 13:48:53 PM
We are now going live with our Protx implementation.

I have found most issues are with the URL not being set correctly or the testvendor testvendor password is not right - ignore the password they gave you for testvendor - just use testvendor for login and pass.

Also when going live make sure you change the vendor name and also the encrypt pass to be absolutely right.

The URLS with no https:

A couple of issues I'd like to have resolved is the order ID being set correctly (vendortxcode) and also the Customer bought: your order text.
Title: Re: ProtX
Post by: jhdesign on October 23, 2007, 18:52:30 PM
Few issues that I'm having, any help is greatly appreciated.

1) User had to enter credit card info twice, once on site and when they get redirected again.
2) So switched it to Paypal mode, but shipping info/fee is not being passed.

Is there a final working version of this payment plugin?
Title: Re: ProtX
Post by: jaddi01 on October 25, 2007, 11:13:46 AM
Hi Guys!

just wanted to thank Chris Stead and the other contributors!  I hve our companys' test VSP site working.  I do however have one question.  When redirecting back to the site from Protx, how can I show the original Virtuemart Success screen with order invoice attached?  Is just a matter of linking to checkout.thankyou.php, because I've tried that and didn't work?    I'm coming back to an empty page after a successl order, eventhough I know the CPI contains the correct code?

EDIT:  Mananged to get it working  :-\  I didn't put the .php after the redirect link...   silly me!
Title: Re: ProtX
Post by: jhdesign on October 30, 2007, 14:49:48 PM
Can someone put together latest files with clear instructions how to get it working?
Title: Re: ProtX
Post by: El Fanjo on October 31, 2007, 15:10:16 PM
I am facing issues when implementing Artio JoomSEF, basically the url returned by ProtX after payment gets rewritten and the GET data is altered. When a customer is sent back to my site he gets a blank screen and the order status stays pending ! If the url rewriting is disabled everything works like a charm.

Did someone had this issue before ? How did you guys fixed it ?

Quote from: jhdesign on October 30, 2007, 14:49:48 PM
Can someone put together latest files with clear instructions how to get it working?

Everything is here and i can confirm that it is working with joomla/virtuemart 1.0.13 (well as long as you don't use SEF components.......). try a clean install of joomla/virtuemart, add the payment method, files and stuff and double check with ProtX just to make sure your config file is right. Fingers crossed it should work !
Title: Re: ProtX
Post by: El Fanjo on November 27, 2007, 11:56:09 AM
Hum some kind of caching error... Works now !!!
Title: Re: ProtX
Post by: richrock on November 27, 2007, 15:37:36 PM
I would also appreciate latest files etc..  I've been trying to do this for nearly two months now!!!  Best I get is a 5005 from Protx and no clues there...  >:(

Help!!!  :-[
Title: Re: ProtX
Post by: Gary on January 08, 2008, 12:28:10 PM
Could someone tell me if these hacks actually WORK.

FINALLY received payment info from our client only to find that protx doesnt have a payment module!!!

I spoke to Protx and they have nothing and suggested that the 'manufacturers' of Virtuemart contact them if they want to be integrated.

Would really appreciate some advice here.

Many Thanks

Gary
Title: Re: ProtX
Post by: El Fanjo on January 08, 2008, 13:44:45 PM
This hack actually works, well it is not a hack actually you need to create a proper payment method for ProtX.
If you follow the steps described in this thread it should be allright (take your time, read carefully as it is not the easiest integration).
Title: Re: ProtX
Post by: Gary on January 08, 2008, 14:14:24 PM
Thanks, will try and PRAY it works.
Title: Re: ProtX
Post by: synaptyx on February 07, 2008, 11:19:00 AM
Hi there, I'm not a coder, but need to get ProtX working on Virtuemart. I put all the files in place than followed the instructions on Page 3 of this topic, but when I ad the ProtX payment method I get this error:
QuoteWarning: add(/home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php) [function.add]: failed to open stream: No such file or directory in /home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/ps_payment_method.php on line 174

Warning: add(/home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php) [function.add]: failed to open stream: No such file or directory in /home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/ps_payment_method.php on line 174

Warning: add() [function.include]: Failed opening '/home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/valiant/public_html/jf_staging/administrator/components/com_virtuemart/classes/ps_payment_method.php on line 174
Can anybody help?
Title: Re: ProtX
Post by: amcs1983 on February 13, 2008, 16:23:41 PM
I downloaded the files a few days ago and they work perfectly. I had to manually edit the php file with the settings in but it worked first time perfectly.

A big thanks!

How do we make this into a payment module which can be downloaded and installed? Or even better add it to the Virtuemart package? I will be willing to put in some time to get this made into a installable module.
Title: Re: ProtX
Post by: smalcolm on February 27, 2008, 17:14:11 PM
I have had Protx integration working for the last 6 months on a live site, so can verify the instructions in this thread - thanks for the good work!

This morning I had a report from a customer who couldnt make a purchase - they were getting an error report saying that the postcode was too long. After some debug, I repeated the problem. They were getting the following error from Protx:

INVALID : 3016 :  The BillingPostCode value is too long.

(Note that there is also a Protx error 3027 :  The BillingPostCode is too long.)

The problem is that the Protx interface throws an error if the postcode supplied by the site is more than 10 characters long.. not sure the reason for this, but the solution seems to be to truncate the postcode!..

to do this, I modified two lines (318 and 322) in the ps_protx_cpi.php file, changing the 20 into a 10, so that they become:

    $temp.='DeliveryPostCode='.substr($dbbt->f('zip'),0,10);

and

    $temp.='BillingPostCode='.substr($dbbt->f('zip'),0,10);


Hope this helps!

Thanks.
Title: Re: ProtX
Post by: Matt Platts on March 27, 2008, 12:18:48 PM
I've just tried this installation on a fresh copy of Joomla and Virtuemart downloaded from this site. Im not getting any error messages, but the protx options cumes up under Please select a Payment Method, and then in a box saying 'Credit Card' with a space to enter card details. However this wasn't what I was expecting at all, I was expecting to be directed to another page to enter this information on the protx site.

Am i wrong in assuming this? Or it this trying to mimic the protx direct method and not the vps form? Anyone know?
Title: Re: ProtX
Post by: El Fanjo on March 27, 2008, 20:12:00 PM
This is odd.
I don't know what it is trying to mimic but you are right : this is not what VSP form do.
Which versions of Joomla and Virtuemart are you using ? How did you installed the payment method ?
Title: Re: ProtX
Post by: robertix on April 17, 2008, 18:44:51 PM
Hi Guys,

I have been reading this thread and off course have the same problem as you all, integrating protX with virtuemart.

Now i don't have the neccesary coding experience to make it work.
Whats the best thing for me to do, i've contacted protX and they said you have contact virtuemart etc.

gr.Robert
Title: Re: ProtX
Post by: El Fanjo on April 19, 2008, 18:21:46 PM
Any error message ? Which bit doesn't work ?
Title: Re: ProtX
Post by: dom hughes on June 10, 2008, 17:26:45 PM
I am using J1.5.2 and VM1.1.0 stable. I have adapted Chris Stead's latest files http://forum.virtuemart.net/index.php?topic=2079.99 (http://forum.virtuemart.net/index.php?topic=2079.99) to work with Protx in this configuration. You will need to correct the php extensions and place the ...functions.php in your /includes directory. In addition I had to change the length of the order_number field in the VM orders table to a longer value (my default was set at varchar 32, Protx needs at least 35, I have set to 40).

I have tested with the Protx simulator and all transactions seem OK.

Good luck and much thanks to Chris.



[attachment cleanup by admin]
Title: Re: ProtX
Post by: ozinm on June 12, 2008, 11:11:14 AM
Quote from: jhdesign on October 30, 2007, 14:49:48 PM
Can someone put together latest files with clear instructions how to get it working?

Joomla: 1.0.15
VirtueMart 1.0.15 stable  [Flying Fifteen]



The following worked for me:

1. upload the following files (see zip)

2. In the Joomla-Virtuemart component admin, create a new payment method called protx Secure Payment (note that this name is visible to the shopper, so it needs to be meaningful).

3. Tick the "Active" checkbox.

4. set the Payment Method Name to: protx Secure Payment

5. set the Code to: PROTXCPI

6. set the Payment class name to: ps_protx_cpi

7. set the Payment method type to: Use Payment Processor

8. On the "configuration" tab set up appropriate values for your site and your protx account (you may need to save and then reopen to see the protx options).


NB: Files in the attached zip have been lifted from this forum thread and all credit should go to those who originally wrote them  :)

[attachment cleanup by admin]
Title: Re: ProtX
Post by: ozinm on June 13, 2008, 14:40:59 PM
Quote7. set the Payment method type to: Use Payment Processor
I've just been fiddling with it a bit and it looks like if you are using VSP form (as we are) setting the payment method to "paypal related" works and the customer won't have to enter their card details in twice.

Title: Re: ProtX
Post by: synaptyx on August 08, 2008, 16:06:49 PM
I have followed these instructions, but when I try to save the new payment method I get this error:

http://ussvaliant.com/pd_staging/administrator/index2.php
Direct Access to this location is not allowed.
Title: Re: ProtX
Post by: ozinm on August 08, 2008, 16:28:43 PM
Quote from: synaptyx on August 08, 2008, 16:06:49 PM
I have followed these instructions, but when I try to save the new payment method I get this error:
http://ussvaliant.com/pd_staging/administrator/index2.php
Direct Access to this location is not allowed.

I'm not sure if the steps I posted above are relevant to you as you are on Joomla 1.5
I've now modified my post adding the versions I was using.
Sorry about that :( .
Title: Re: ProtX
Post by: synaptyx on August 08, 2008, 16:31:48 PM
Ah, thanks for the update.

Anybody got this working on Joomla! 1.5.5 with VirtueMart 1.1.2?
Title: Re: ProtX
Post by: dasmon777 on August 12, 2008, 08:36:17 AM
This may or may not be of help to anyone, but I was putting the protx module onto an update of VM1.0 to VM1.12

I had a fatal error cannot redeclare class vmlanguage.

Thanks to this thread http://forum.virtuemart.net/index.php?topic=40103.0 I found the answer and it works brilliantly!

I deleted the redundant english.php file in the language folder and adjusted the checkout.protx_cpi_result.php file to read from the updated language files.

It is attached if anyone else has a similar problem

Thank you for all your help guys - certainly been more helpful than protx ever has been

[attachment cleanup by admin]
Title: Re: ProtX
Post by: baggiesmad on August 20, 2008, 15:00:17 PM
does this work with joomla 1.0.15 & virtuemart 1.1.2
Title: Re: ProtX
Post by: Priz on August 20, 2008, 17:05:14 PM
Quote from: synaptyx on August 08, 2008, 16:31:48 PM
Ah, thanks for the update.
Anybody got this working on Joomla! 1.5.5 with VirtueMart 1.1.2?

I have it working - at least with the Protx simulator ... I will let you know what happens when the site goes live.

Priz
Title: Re: ProtX
Post by: baggiesmad on August 21, 2008, 10:12:19 AM
Quote from: Priz on August 20, 2008, 17:05:14 PM
Quote from: synaptyx on August 08, 2008, 16:31:48 PM
Ah, thanks for the update.
Anybody got this working on Joomla! 1.5.5 with VirtueMart 1.1.2?
I have it working - at least with the Protx simulator ... I will let you know what happens when the site goes live.
Priz

Thanks
Title: Re: ProtX
Post by: wytp on August 23, 2008, 00:48:35 AM
Quote from: ozinm on June 12, 2008, 11:11:14 AM
Quote from: jhdesign on October 30, 2007, 14:49:48 PM
Can someone put together latest files with clear instructions how to get it working?
Joomla: 1.0.15
VirtueMart 1.0.15 stable  [Flying Fifteen]

The following worked for me:
1. upload the following files (see zip)

  • /administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php
  • /administrator/components/com_virtuemart/html/functions.php
  • /administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php
  • /administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.cfg.php
2. In the Joomla-Virtuemart component admin, create a new payment method called protx Secure Payment (note that this name is visible to the shopper, so it needs to be meaningful).
3. Tick the "Active" checkbox.
4. set the Payment Method Name to: protx Secure Payment
5. set the Code to: PROTXCPI
6. set the Payment class name to: ps_protx_cpi
7. set the Payment method type to: Use Payment Processor
8. On the "configuration" tab set up appropriate values for your site and your protx account (you may need to save and then reopen to see the protx options).
NB: Files in the attached zip have been lifted from this forum thread and all credit should go to those who originally wrote them  :)
Thanks for your instruction, it works perfect but the following message shown after payment processed: Warning: Could not send a message to , (). and the order status didn't change.
any idea?
Title: Re: ProtX
Post by: hadrien on September 08, 2008, 13:30:16 PM
For people getting the following error message:
QuoteWarning: Could not send a message to , ()
I found a solution which might not work for everybody. If you notice that your order status is not automatically changed to 'confirmed' you're probably experiencing the same issue I had. The problem is that the checkout script needs the order_id to update/retrieve bits and pieces of data, and the query that retrieves the order_id in the first place in checkout.protx_cpi_result.php (around line 75) has a too long order_number to compare against the table. In your database in the table #__vm_orders change the type of order_number from VARCHAR(32) to, say, VARCHAR(50) and this should do the trick.

Other point for VSP Forms users: your customers shouldn't have to input their credit card details on your site but on the ProtX site. You can use this script and simply change the 'Payment Method Type' to 'HTML-Form based'.

I hope this helps,
cheers.
Title: Re: ProtX
Post by: dj_mystic82 on October 08, 2008, 19:09:35 PM
I'm trying to get this working in Joomla 1.5 with Virtuemart 1.1. I'm getting an error when I get to the Protx Test payment page saying "VSP Form Transaction Error 3031 : The Amount value is required."

I have used the file attached in oznims post above but changed the checkout.protx_cpi_result posted by dasmon777.

Can anyone who has this working in Joomla 1.5 and VM 1.1 attach their working files or point me to where they are on these forums if already on?

(I've tried submitig to /showpost/showpost.asp and I'm getting my vendorname, protocol and txtype returned ok)
Title: Re: ProtX
Post by: wytp on October 19, 2008, 17:21:41 PM
Quote from: hadrien on September 08, 2008, 13:30:16 PM
I found a solution which might not work for everybody.

Thank you so much, it works finally.
Anybody has this wroking in Joomla 1.5.7 and VM 1.1.2?
Title: Re: ProtX
Post by: hifimad on October 23, 2008, 16:18:04 PM
After the order has been processed and you are returned to VirtueMart I found the the screen was blank. No "Thank you for your order" message and green tick. I checked through checkout.protx_cpi_result.php and found that the echo commands for the text were written as follows:

<?php echo $VM_LANG->_PHPSHOP_THANKYOU ?>

However, in checkout.result.php they are written like this:

<?php echo $VM_LANG->_('PHPSHOP_THANKYOU'?>

I changed the code for every occurance of "echo" in checkout.protx_cpi_result.php to match and the thank you messages appeared as expected.

Also found that I had to copy the green tick (button_ok.png) to components/com_virtuemart/shop_image/ps_image/ so it would appear - otherwise this was also missing.

Thought I should post this to help other out that may have the same problem as me.
Title: Re: ProtX - Use E-Clear
Post by: sontrex on November 20, 2008, 16:55:15 PM
Hi Guys
If you looking for payment online then the best options is to use PSP http://www.eclear.net - Payment Service Provider - E-Clear
They are doing secure online payment. Search on Google global payment provider.
You will see them on the top.

Cheers

Pete
Title: Re: ProtX
Post by: xdoktor on December 08, 2008, 17:39:24 PM
Quote from: wytp on October 19, 2008, 17:21:41 PM
Quote from: hadrien on September 08, 2008, 13:30:16 PM
I found a solution which might not work for everybody.
Thank you
so much, it works finally.
Anybody has this wroking in Joomla 1.5.7 and VM 1.1.2?

has this been solved yet?
i need it too!
Title: Re: ProtX
Post by: baggiesmad on January 16, 2009, 13:00:28 PM
any news on this yet?
Title: Re: ProtX
Post by: jaddi01 on May 15, 2009, 09:52:34 AM
I'm in the process of making a working Protx / SagePay module for the latest Joomla 1.5.10 and Virtuemart 1.13.  So far so good.  Transactions are being processed and redirects are working too.  I am facing a few small issues though.

1) How can I pass on the shipping information to Sagepay?  I have fields that send the billing name and address and also fileds that will be accepted fro SagePAy for shipping data, but I need to know the corrosponding variable in Virtuemart and how to catch them in the order process for sending.  This is an issue where the billing address is different to the shipping address.  Up until now only the billing address has been passed on, which I have duplicated for the shipping address giving the customer a receipt with the same address for both.

2) How the heck do I stop Virtuemart from sending an order confirmation email when directing to SagePay?  This is annoying.  The best solution would be to send a confirmation email AFTER the transaction has completed (or not as the case may be).

So if you guys have any ideas?  I'll continue working on this and I'll happily post my files when I've got them up and running.

John

Title: Re: ProtX
Post by: jaddi01 on May 18, 2009, 10:52:51 AM
Getting closer to solving the confirmation email issues with the help of this thread http://forum.virtuemart.net/index.php?topic=39534.60 .  Still need to get my head around the shipping address >-- SagePay issue.  I'll work on that today.
Title: Re: ProtX
Post by: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

[attachment cleanup by admin]
Title: Re: ProtX
Post by: baggiesmad on June 01, 2009, 12:01:25 PM
Quote from: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Hi jaddi01

Does this mod now work with the latest version of joomla and virtuemart?
Title: Re: ProtX
Post by: jaddi01 on June 01, 2009, 12:13:30 PM
Hi Vanqush,

yes it does.  You do need to modify the CFG file with your own settings (I've set it to the protx test site, just uncomment the right one), but yes works for me. 
Title: Re: ProtX
Post by: baggiesmad on June 01, 2009, 12:18:57 PM
Quote from: jaddi01 on June 01, 2009, 12:13:30 PM
Hi Vanqush,

yes it does.  You do need to modify the CFG file with your own settings (I've set it to the protx test site, just uncomment the right one), but yes works for me.  

ok thanks will try it on my site this week.

has there been many changes from the original Protx payment method and the new Sagepay system?
Title: Re: ProtX
Post by: jaddi01 on June 01, 2009, 12:28:36 PM
No not really.  SagePAy didn't like the address variables being sent all in one string, so that had to be changed, but as far as the look and feel for the customer, I find it slightly better than the ol' Protx.
Title: Re: ProtX
Post by: essexboyupnorth on June 04, 2009, 10:48:37 AM
Just wanted to say thanks to Chris Stead and others who have contributed to this thread.

I have managed to get the Chris Stead Method to work with Sage Pay (Formerly Protx), VM 1.1.3 and Joomla 1.15.10, I've had to tweak a couple of things but thankfully nothing major as I have no PHP experience. I've been testing on a live system using a real credit card and a test product costing 0.01p. Here are my steps:

1) Use the Chris Stead Method as quoted in reply #22. When you set up the new payment method, before you can edit the configuration page you have to save and re-enter the payment method you've just created, you will then get a form to fill out in the configuration tab.

2) Fill out the configuration form as Chris suggests, I entered 2.2 in the VPS Protocol version field, live.sagepay.com in the hostname of the secure URL field and /gateway/service/vspform-register.vsp in the path of the secure URL field. Make sure you add your .com, .co.uk, .org to http://www.yourdomain in the success and failure url.

3)The pathway to the english.php file seems to have changed since Chris created his method so I changed the code in checkout.protx_cpi_result.php file on line 35 from:

// load Mambo Language File
    if (file_exists( $mosConfig_absolute_path. '/language/'.$mosConfig_lang.'.php' )){
      require_once( $mosConfig_absolute_path. '/language/'.$mosConfig_lang.'.php' );
    } else {
      require_once( $mosConfig_absolute_path. '/language/english.php' );
    }

to:

// load Mambo Language File
    if (file_exists( $mosConfig_absolute_path. '/languages/'.$mosConfig_lang.'.php' )){
      require_once( $mosConfig_absolute_path. '/languages/'.$mosConfig_lang.'.php' );
    } else {
      require_once( $mosConfig_absolute_path. '/administrator/components/com_virtuemart/languages/common/english.php' );
    }


and changed the code on line 54 from:

} else {
      require_once( ADMINPATH. 'languages/english.php' );
    }


to:

} else {
      require_once( ADMINPATH. 'languages/common/english.php' );
    }


This gave me a blank page from my own website and the order in VM was left as pending and not confirmed, not great but better than the errors I was getting.

4) The next step sorts out the blank page and the order status. Take the code in reply #77 of this thread and paste it as instructed into the checkout.protx_cpi_result.php to stop the gaps in url returned from Sage Pay being filled with %20, the order status should change from pending to confirmed in VM's orders section with a successful transaction.

I still need to work on a Thank You message and a link to the order details page but the camel's back is broken. Thanks to all who contribute to these forums, a novice half wit like me wouldn't stand a chance without you.
Title: Re: ProtX
Post by: jaddi01 on June 04, 2009, 11:12:28 AM
Hello essexboyupnorth

why didn't you just download my finished version that resolves all of the problems you mention posted 3 posts up?
Title: Re: ProtX
Post by: essexboyupnorth on June 04, 2009, 12:51:23 PM
Quote from: jaddi01 on June 04, 2009, 11:12:28 AM
Hello essexboyupnorth

why didn't you just download my finished version that resolves all of the problems you mention posted 3 posts up?

Sometimes it's difficult to spot when the specific problems you encounter are the same as those that have been solved when the wording in a post doesn't seem quite relevant to your own issue, also with 10 pages of thread finding the answers isn't always straight forward.

I thought I'd post the steps an utter php numpty took to get Sage Pay working in the latest of Joomla and Virtuemart in the hope it helps someone else in a similar situation.

Maybe we need a thread called THE PROTX / SAGE PAY SOLUTION with your finished version in. Unless you shout about it people won't hear. I know that when I find a solution to a problem I try to post it in as many relevant threads as I can.

Thanks for the heads up, I'll download your solution and take a look, I'm sure it's far more elegant than mine.
Title: Re: ProtX
Post by: 3cellhosting on June 23, 2009, 13:30:21 PM
Hi jaddi01,

Downloaded files. Uploaded to site as shown in readme.txt.

Create new payment - cannot enter Payment class name: ps_protx_cpi as this is a dropdown and this does not appear as one of the selections.

As a default I selected the option ps_payment but this would not save as a payment option. I started with 15 options and still have 15 options.

I am running Joomla 1.5.11 and VM 1.1.3

Quote from: jaddi01 on May 18, 2009, 15:58:41 PM

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Many thanks

David
Title: Re: ProtX
Post by: jaddi01 on June 23, 2009, 15:38:22 PM
Hello 3cellhosting

yes the ps_prox will not appear unless you have already uploaded the files to the correct locations.  Then I would suggest entering and modifying the ps_protx_cpi.cfg.php file directly (that's what I did) using a text editor like notepad.
Title: Re: ProtX
Post by: bobbie_bobster on June 26, 2009, 23:15:53 PM
Quote from: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:

Was having trouble getting the confirmation page to work on this setup, but then noticed that although the notes.txt file in the zip says to upload /administrator/components/com_virtuemart/html/protx_functions.php, I was getting a php error trying to reference /administrator/includes/protx_functions.php.

Moved the file and all is OK now.

Many thanks to all contributors to this solution, what I though might have been 3-4 days of work was reduced to a couple of hours.
Title: Re: ProtX
Post by: freshwebservices on July 05, 2009, 10:29:06 AM
Hi Guys,
Thanks for all the work you've put into this to date.

I'm new to VM, so be warned! I've installed & configured the Protx (SagePay) module as instructed in the zip file.

Its showing as a payment method but I have a couple of Qs/issues:
1) It only shows the card entry fields if the default Credit Card method is also active. This will be confusing to users who will select this option by default I believe. If I disable this method, then the SagePay only shows as a radio button - & there's no form to fill in their card details.
2)How can I set the Sage status - test, stimulator, live, etc?
3) Is there something else that I need to do before this payment method can be used - do I have to code a thank you page or anything like that?

Thanks,
Eddie
Title: Re: ProtX
Post by: jaddi01 on July 05, 2009, 17:00:33 PM
Hello and welcome.

Firstly this sounds like the wrong payment module for you.  This one requires the customer to enter their credit card details ONLY on the sagepay server and not in Virtuemart.  The customer is redirected to sage pay before entering the details. Hence a VSP process.  Sounds like you need this https://forum.virtuemart.net/index.php?topic=55753.0  (Sagepay direct).

Also configuration of servers can be done manually in the .cfg. file.  Just edit out the //  to activate the line of code.  Or enter // to deactivate a line.

No extra code needed thank you pages are automatically generated by virtuemart after payment is completed/aborted and redirected back to your site.
Title: Re: ProtX
Post by: freshwebservices on July 05, 2009, 20:06:00 PM
Hi,
Thanks for getting back to me so quickly - much appreciated.

Yes, I think you're correct - re: not the right one for me. Sorry about that - I did warn you that I was a VM newbie!

Thanks again,
Eddie
Title: Re: ProtX
Post by: mike420 on July 19, 2009, 16:25:01 PM
With the files I have collected from here (and a bit of editing!!), I have created a new Sage Pay VSP Form payment module which uses the new 2.23 protocol.

Extra fields have now been added to transfer billing and shipping address details.

Forgot to mention this is for Virtuemart 1.0.15 :)

[attachment cleanup by admin]
Title: Re: ProtX
Post by: jaddi01 on July 19, 2009, 17:59:07 PM
The files I provided on the previous page had already been updated to 2.23 and have the fields modified.  You could have saved yourself the time and just downloaded that one. 
Title: Re: ProtX
Post by: greenparrot on July 23, 2009, 15:08:47 PM
Joomla Version 1.5.10 & VirtueMart 1.1.3 stable & Protx/SagePay VSPForm

I downloaded the Sage_Pay.zip file from this thread http://forum.virtuemart.net/index.php?topic=2079.msg190505#msg190505. I tried to follow instructions in the read me file however when i go to save the payment method i get this error

"Direct Access to this location is not allowed."

I have read through a few threads about this but can't see a solution, the threads seem to move onto other problems

Can anyone help

Roy
Title: Re: ProtX
Post by: jaddi01 on July 23, 2009, 15:19:51 PM
If you downloaded the one above, then it will not work with your Joomla version.  You need the one on the previous page from me which is designed for Joomla 1.5.  Look in my post.
Title: Re: ProtX
Post by: greenparrot on July 23, 2009, 15:28:40 PM
Bingo jaddi01

That worked

Thanks

Roy
Title: Re: ProtX
Post by: greenparrot on July 27, 2009, 17:02:59 PM
I have the Sagepay payment module working except after a successful purchase when they return to my site it says 404 not found, the link is

http://www.iwsteamrailway.com/joomla/index.php?option=com_virtuemart&page=checkout.protx_cpi_result&crypt=MB4uEyUfVCAcbDUHBDxBRicPOwY5AFQ8IikFFhY7UkAPBjZHERkdBzg4DwAALBRhEQshFDEPHQY4JEAlACZQWhE+NyQ/CAxSYXk5QVApVVMCWnkBMg5QWG9+AxdSfFEEVV4tBjRdCAtxHDYgMTB9UV4RCSJpXlpaYAxLQyNxdRhXWgwmfS5cV2BnV0cjDgVxJVN6VmVfFEkDMicGESB6Wl5dfFNpSigCOD8IB1hxGgJXTA4xAy8/XWoLKj9FBXVhICJpJjQIGwokOTQWFj1YQV4nDjMTJCwrcRoJABELW1EGOCoUJQAdUhoLMjAtDXATIDx9NTUfHAMjdysyMQt8cCdMCA42GCgGM3dWVVYMZ1AAHz0CAxgIGyI5Wzwubnd0NTxyKh44PDUbBT8pVAp3DDRaHSsZKj4tb2wlEhcsYEwTD3IxGT8oSRsrFQdRDF1SCh48WmlfWV0=

Do you know what i'm doing wrong?

Thanks

Roy
Title: Re: ProtX
Post by: jaddi01 on July 27, 2009, 17:13:02 PM
Can you paste a copy of your cfg file here?  I think it's something to do with a trailing "/" but I'll have to search around to find out exactly what.
Title: Re: ProtX
Post by: greenparrot on July 27, 2009, 17:22:27 PM
<?php
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
define ('PROTX_CPI_VPSProtocol''2.23');
define ('PROTX_CPI_STORE_ID''iowsr');
define ('PROTX_CPI_TxType''PAYMENT');
define ('PROTX_CPI_SECRET''gdfd99rrrfs');
define ('PROTX_CPI_ApplyAVSCV2''1');
define ('PROTX_CPI_CHECK_CARD_CODE''1');
define ('PROTX_CPI_Apply3DSecure''1');
define ('PROTX_CPI_REMOTE_HOST''test.sagepay.com');
define ('PROTX_CPI_REMOTE_PATH''/Simulator/VSPFormGateway.asp');
define ('PROTX_CPI_SUCCESS_URL''http://www.iwsteamrailway.com/joomla/index.php?option=com_virtuemart&page=checkout.protx_cpi_result');
define ('PROTX_CPI_FAIL_URL''http://www.iwsteamrailway.com/joomla/index.php?option=com_virtuemart&page=checkout.protx_cpi_result');
?>
Title: Re: ProtX
Post by: jaddi01 on July 27, 2009, 17:43:21 PM
You might want to edit you post and remove your password asap, just in-case.  Also, I can't see anything wrong with your setup.  It may be Joomla related, I'll have a look about.
Title: Re: ProtX
Post by: greenparrot on July 30, 2009, 14:22:34 PM
problem solved

http://www.iwsteamrailway.com/joomla/index.php?option=com_virtuemart&page=checkout.protx_cpi_result

should be

http://www.iwsteamrailway.com/index.php?option=com_virtuemart&page=checkout.protx_cpi_result

i.e. minus joomla/

Roy
Title: Re: ProtX
Post by: jaddi01 on July 30, 2009, 15:59:10 PM
lol  I knew I was right with the link, just couldn't remember what... good job!
Title: Re: ProtX
Post by: ianmatchett on August 03, 2009, 17:44:44 PM
Hi all,

I would love to get this module working, my site is just giving me a blank page and not trying to go to the sagepay site! Any previous experience of this and quick tips to get it working?

I am using joomla 1.5.9, VM 1.1.3

like I said, once I get to the final checkout on my site it goes to a blank page.

Thanks!
Title: Re: ProtX
Post by: greenparrot on August 14, 2009, 16:13:32 PM
Is it possible to pass the product category through the protx payment gateway with this module.

I have products like this

category 1
  prod 1
  prod 2
  prod 3

category 2
  prod 1
  prod 2
  prod 3

I would like to pass through protx like this:

category 2 - prod 3

What lines of code would i have to mod?

Thanks

Roy

Title: Re: ProtX
Post by: 3cellhosting on August 27, 2009, 10:31:26 AM
Getting there slowly!

I have added the files, created the payment option, edited the config file, and I am getting an error as shown below...

Warning - Division by zero in /administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php on line 191

Any ideas please?

Regards

David
Title: Re: ProtX
Post by: jcaan on September 06, 2009, 13:00:12 PM
Hi. Ive followed Jaddi01's instructions for SagePay_VSP payment gateway, but the following errors occur:

In the payment method form configuration in the backend of virtuemart (Im using J1.154 & VM 1.1.4) I cannot modify the settings.

This is what I get ( I haven't listed all the values):

<? echo PROTX_CPI_VPSProtocol ?>  The VPS Protocol version. Currently 2.23
<? echo PROTX_CPI_STORE_ID ?> The name of your store. Usually the same as your organisation.
<? echo PROTX_CPI_SECRET ?> The "Encryption Password" you get from protx.

Everytime I make changes to ps_protx_cpi.cfg it gets overwritten when I save the payment method form the saved ps_protx_cpi.cfg gets replaced with the <? echo's as above.

Please can someone help me. Many thanks.
Title: Re: ProtX
Post by: stinga on September 15, 2009, 19:36:41 PM
G'day all,

I have installed and configured but it never shows up as a payment option in checkout, not sure what is wrong yet.

Edit...
Doh!, I was looking at the wrong site!
It does show up, I just now need to configure and test.
Title: Re: ProtX
Post by: craftyweb on October 15, 2009, 13:26:21 PM
Thanks for this payment module, got it set up fine and connecting to Sage Pay but when the shopper is returned to my site, from Sage Pay, there is an error.

I've followed the instructions in the notes of jaddi01's zip file but I get an error stating that the server couldn't find the file 'protx_functions.php' in the 'includes' folder (the instructions don't to add a file here though) line 32 of 'checkout.protx_cpi_result.php'.

If I move the 'protx_functions.php' file to the includes folder in which it expects to find it I then get the following error:

Fatal error: Call to undefined function SimpleXor() in /homepages/[edited-for-security]/administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php on line 69

Also in the notes in the zip file it states to upload:
/administrator/components/com_virtuemart/html/functions.php

as there is no functions.php file in the zip I presume that this is the 'protx_functions.php' file correct, or am I missing a file?

Thanks in advance, any advice much appreciated.

Jon
Title: Re: ProtX
Post by: stinga on October 15, 2009, 21:43:38 PM
G'day,

Yes there is a naming foobar, I called mine protx_functions since that is what the code wanted, but in the zip file it is called functions.
I just had a look at my includes dirctory and I don't have a functions.php in there so you *might* not have over written anything.
(I tend to check all this stuff before I go and blindly do what what it says to do!)
Title: Re: ProtX
Post by: craftyweb on October 20, 2009, 19:03:23 PM
stinga, so what folder do you have the 'protx_functions.php' file in?

When I place it in the html folder that the notes file specifies I get a 'file not found' error and if I put it in the includes folder the file seems to be included but I still get an error stating that the SimpleXor() function is undefined.

I can't understand how any one has got this working!

Thanks
Title: Re: ProtX
Post by: bobbie_bobster on October 29, 2009, 20:55:41 PM
Quote from: jaddi01 on May 18, 2009, 15:58:41 PM
Shipping info is now being passed on to SagePay.  I figured it out this morning, and then ironically read a post from Peter Clements in this thread detailing the same fix!  Anyway, all seems to be working well.  All I need to do now is change the references displayed to SagePay and not Protx and continue tweaking the confirmation emails with the help of the aforementioned thread.

I'll change the headers on the files to make them work natively with Joomla 1.5 when I'm happy that it is 100%.

*EDIT*

Finished.  Joomla 1.5 Native, Virtuemart 1.1.3, SagePay VSP.

Download Here:
For US billing addresses, Sage wants the state as part of the transaction record, which in the version referenced by this quoted post wasn't being included.

The solution is to add into ps_protx_cpi.php the following code:
(a)At line 330
$delivery_country = substr($dbst->f('country'),0,2);
    if( $delivery_country == "US" )
    {
    $temp.='DeliveryState='.substr($dbst->f('state'),0,2);
    $temp.='&';
    }
(b) At the new line 352 after adding this previous code in
$billing_country = substr($dbbt->f('country'),0,2);
    if( $billing_country == "US" )
    {
    $temp.='BillingState='.substr($dbbt->f('state'),0,2);
    $temp.='&';
    }

Tested with Sage and doesn't return any MALFORMED errors.
Title: Re: ProtX
Post by: Christopher on December 16, 2009, 16:27:19 PM
Hi there

I'm using J1.5.15 / VM 1.1.4 and Sagepay VSP

I have got the SagePay (Protx) interface working, processing transactions in test mode and firing off the emails but Sagepay sends the customer back to a page with the following:

Direct Access to this location is not allowed.

I've seen various posts throughout this thread offering several fixes, mostly related to the location of the language files but nothing seems to work - any help would be greatly appreciated - I'm getting close to tearing my hair out now!

Update: Have found the fault in the 'checkout.protx_cpi_result.php' page by rolling back to an earlier version before I'd tinkered with it!!

Thanks
Title: Re: ProtX
Post by: taralbu on February 07, 2010, 18:00:46 PM
Thank you so much jaddi01 for his module - I'd like to PayPal you a pint if I may!

The module worked fine; however a missing page error was generated upon returning to the site.  I had a look at checkout.protx_cpi_result.php and line 38 read:
include "$mosConfig_absolute_path/includes/protx_functions.php";

After uploading that file to that location, it worked.

Could I therefore suggest that you amend notes.txt to list the upload files as:

/administrator/components/com_virtuemart/html/checkout.protx_cpi_result.php
/administrator/components/com_virtuemart/html/protx_functions.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.php
/administrator/components/com_virtuemart/classes/payment/ps_protx_cpi.cfg.php
/includes/protx_functions.php


Or maybe a recode of line 38 would work too?  I haven't tried it myself.

Anyway, thanks once again!
Title: Re: ProtX
Post by: 3cellhosting on February 18, 2010, 22:31:52 PM
Quote from: bobbie_bobster on October 29, 2009, 20:55:41 PM
For US billing addresses, Sage wants the state as part of the transaction record, which in the version referenced by this quoted post wasn't being included.

The solution is to add into ps_protx_cpi.php the following code:
(a)At line 330
$delivery_country = substr($dbst->f('country'),0,2);
    if( $delivery_country == "US" )
    {
    $temp.='DeliveryState='.substr($dbst->f('state'),0,2);
    $temp.='&';
    }
(b) At the new line 352 after adding this previous code in
$billing_country = substr($dbbt->f('country'),0,2);
    if( $billing_country == "US" )
    {
    $temp.='BillingState='.substr($dbbt->f('state'),0,2);
    $temp.='&';
    }

Tested with Sage and doesn't return any MALFORMED errors.

Can you confirm if this is inserted at line 330 or does it replace another line? I have attached the code in the file I downloaded. This shows lines 326 to 332 inclusive.
    $temp.='DeliveryCountry='.substr($dbst->f('country'),0,2);
    $temp.='&';
    $temp.='DeliveryPostCode='.substr($dbst->f('zip'),0,20);
    $temp.='&';
    $temp.='DeliveryPhone='.substr($dbst->f('phone_1'),0,20);
    $temp.='&';
    $temp.='BillingFirstNames='.substr($dbbt->f('first_name'),0,30);

This is the only thing holding us up now. It has been working great for UK customers but we are now getting customers from the US.

Thanks jaddi01 for a great fix.

Regards

David
Title: Re: ProtX
Post by: baggiesmad on March 17, 2010, 17:36:23 PM
Does SagePay form work ok on virtuemart?
Title: Re: ProtX
Post by: Jason Farmer on April 27, 2010, 15:59:56 PM
yes, yes it does...

but there are a couple of hoops to jump through...

two I've found

protx_functions.php uses short tags ie <? rather than <?php which you may need to change dependant on your php settings...

the SimpleXor function in protx_functions.php is misspelt... it should be called simpleXor
Title: Re: ProtX
Post by: tradebox on June 13, 2010, 21:00:01 PM
Hi, I came across this thread looking for SagePay Form Integration, I've reviewed the thread for about 2 hours now but every time I get the same error message from SagePay:

Form Transaction Error


This transaction attempt has failed. We are unable to redirect you back to the web store from which you were purchasing. The details of the failure are given below.

Status:    INVALID

Status Detail:    5005 : The Vendor configuration is missing or invalid.

Copyright Sage Pay 2010

The other worrying thing is my order still goes through as paid :O
Title: Re: ProtX
Post by: craftyweb on June 18, 2010, 09:57:42 AM
SagePay customer support are very helpful with error messages. Give them a call if you haven't fixed this yet.
Title: Re: ProtX
Post by: baggiesmad on June 24, 2010, 10:42:42 AM
Hi

I have a website running Joomla v.1.0.15 Stable & Virtuemart v1.0.15

Now that Protx has changed to SagePay, what files do i use to get SagePay running on my website?

thanks
Title: Re: ProtX
Post by: tradebox on June 26, 2010, 13:05:10 PM
Quote from: craftyweb on June 18, 2010, 09:57:42 AM
SagePay customer support are very helpful with error messages. Give them a call if you haven't fixed this yet.
I didn't fix it, I paid £40 and got a working component in the end, didn't have time to debug this, just needed one that worked.
Title: Re: ProtX
Post by: MarkN on June 30, 2010, 17:40:16 PM
Hi there,
  I am so grateful for your work guys so far on this, I have has a small hiccup, the form goes through to sagepay etc and the payment goes through ok. The user is added to Virtuemart and is shown as confirmed.

When the user comes back to the site for the thank you message I get the following:

Thank you for your order.

Success Your order has been successfully placed!

Follow this link to view the Order Details.
No valid database connection Table 'web167-efrome82.jos_ssrrn_msc' doesn't exist SQL=SELECT memberlist_name, hp_id FROM jos_ssrrn_msc WHERE vm_product_id = 1
Info: Message sent to Mark Test1, marktest1@domainhere.com

Any ideas? as to why I am getting this error@

Thanks in advance
Mark N
Title: Re: ProtX
Post by: baggiesmad on July 05, 2010, 10:15:13 AM
Quote from: vannquish on June 24, 2010, 10:42:42 AM
Hi

I have a website running Joomla v.1.0.15 Stable & Virtuemart v1.0.15

Now that Protx has changed to SagePay, what files do i use to get SagePay running on my website?

thanks

can anyone tell me what files to use on this version ...

Joomla v.1.0.15 Stable & Virtuemart v1.0.15
Title: Re: ProtX
Post by: schonkton on August 22, 2010, 20:49:11 PM
Quote from: mike420 on July 19, 2009, 16:25:01 PM
With the files I have collected from here (and a bit of editing!!), I have created a new Sage Pay VSP Form payment module which uses the new 2.23 protocol.

Extra fields have now been added to transfer billing and shipping address details.

Forgot to mention this is for Virtuemart 1.0.15 :)

Hello there, This looks very promising. I've set set up as in the read me. However, I keep getting an error that currency field is missing, can anybody help?

Many thanks.

For an older set up - 1.0.15
Title: Re: ProtX
Post by: Christopher on July 26, 2011, 12:24:14 PM
Hi

I've got Sagepay running just fine on a website I'm building but I have the following problem:

My client takes orders for free samples of fabric via his shop (You can either buy fabric by the metre or order a sample). If you order free samples, the shipping is also free (Done by use of 'Store / Shipping Module List / Ship Value' and its working fine).

The problem is, Sagepay expects a transaction value of at least £0.01 (I spoke to their tech support) and so it throws the following error:

Status: INVALID
Status Detail: 4009 : The Amount is outside the allowed range

I *think* I should be editing ps_protx_cpi.php to 'catch' the order just after line 377 (Where it echoes "Please Wait" to the screen before jumping off to the Sagepay payment gateway)

Please can anyone advise what part of the code I need to adapt to prevent orders with a value of £0.00 being passed to Sagepay, but still store them as normal (The system currently generates all the correct emails, but sets the order status to 'Cancelled' if you pass through to Sagepay, see the error and click the 'Proceed' button to return back to your own site)

Any help would be very gratefully received

Thanks in advance

Christopher