You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu


Started by Rob, September 09, 2004, 18:44:00 PM

Previous topic - Next topic


Im on Joomla / VirtueMart

Chris Stead

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 ( 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)

Put the attached files (without the .txt extension) in the following locations:

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:
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"];

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

[attachment cleanup by admin]


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?

Chris Stead

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)


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?

Chris Stead

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.


Ill do that now and report back


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

Chris Stead

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.


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 -
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', '');
define ('PROTX_CPI_REMOTE_PATH', '/VSPSimulator/VSPFormGateway.asp');
define ('PROTX_CPI_SUCCESS_URL', '');
define ('PROTX_CPI_FAIL_URL', '');

Chris Stead

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.


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?


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!



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?


Right for some reason now it works?

Well this time anyway!!(in IE) - I changed the
// system fields


// system fields

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!