News:

Looking for documentation? Take a look on our wiki

Main Menu

ProtX

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

Previous topic - Next topic

gamma911

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

gamma911

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)

gamma911

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.

gamma911

Ill do that now and report back

gamma911

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.

gamma911

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');
?>

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.

gamma911

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?

moonbeaver

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

gamma911

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?

gamma911

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!