News:

Support the VirtueMart project and become a member

Main Menu

ProtX

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

Previous topic - Next topic

ssm

ProtX seems very reasonable, having problems following the code, is there any chance that somebody could provide it as a module?

Thanks

jmccann

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

clintanderson

IS ProtX available for the U.S.A.?

Thanks,
Clint

Ginger6

Does anyone know how to amend the above so it works with Virtuemart?

Chris Stead

#19
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]

doughammond

#20
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!

dbooth

#21
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>

David Preston

#22
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...


  • It seems to me that checkout.protx_cpi_result.php doesn't belong in the file path that nickweavers quotes (httpdocs/CMS/administrator/components/com_phpshop/classes/html). Am I wrong on this, because there is no such path already?
  • The php syntax (backslashes etc) of payment_extrainfo is all messed up in the forum post. I think I have corrected it properly in my installation, but I am not sure - is there any chance of a corrected version?
  • I have set the protex payment method to be 'Paypal related' as I too am assuming that we are dealing with VSP Form here - is this correct?

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.

David Preston

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.

ramo

Hi David, can you please post information on how you successfully intergrated protx with virtuemart.  I am currently trying to do it.

Thanks

David Preston

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!

playpal

#26
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


ssm

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.

gamma911

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?

David Preston

Are you on Mambo/phpShop or Joomla/VirtueMart?