Author Topic: Can't add a new payment method  (Read 13878 times)

aussieute

  • Jr. Member
  • **
  • Posts: 75
Can't add a new payment method
« on: May 16, 2008, 01:14:26 am »
Am setting up a new payment processor and get the warning upon saving ... Direct access to this location is not allowed when I save the "Payment Method Form"

what's the cause of this  ??? ... more importantly how to make it go away

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #1 on: May 24, 2008, 23:12:23 pm »
It appears that the problem lies with the MIGS Mastercard payment options - ps_migs

I can add other payment options but when I select ps_migs .. I get the dreaded error.

Anyone using the MIGS files from Shorty had this issue?

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: Can't add a new payment method
« Reply #2 on: May 25, 2008, 08:08:15 am »
Probably you are using a payment method for vm 1.0.x. For vm 1.1, there are a number of differences. Your problem may be solved by replacing the first line in the file. Copy and paste the first line from any other payment method that you know is working.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #3 on: May 26, 2008, 03:08:04 am »
Thanks Joseph

Anyone got this working on VM 1.1 as there is more than what Joseph has hinted at?

Fatal error: Call to undefined function: mosgetparam() in administrator/components/com_virtuemart/classes/payment/ps_migs.php on line 33
======== part of ps_migs.php that this relates to ================
    /**
    * Show all configuration parameters for this payment method
    * @returns boolean False when the Payment method has no configration
    */
29 function show_configuration() {
30
31 global $VM_LANG, $sess;
32 $db =& new ps_DB;
33 $payment_method_id = mosGetParam( $_REQUEST, 'payment_method_id', null );
34 /** Read current Configuration ***/
35 require_once(CLASSPATH ."payment/".$this->classname.".cfg.php");

The file ps_migs.cfg.php is writeable

Thanks

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #4 on: May 26, 2008, 05:38:01 am »
Ok Line 33 needs changing from

$payment_method_id = mosGetParam( $_REQUEST, 'payment_method_id', null );
to
$payment_method_id = vmGet( $_REQUEST, 'payment_method_id', null );

I then figured I'd turn on debugging and see what's happening.  :'(
I didn't like what I saw and I'm beginning to wonder whether I'm chasing something bigger than this.  ???

On the public view I went to the shop and <gulp> got the following 500 Error

Quote
500 - JDatabaseMySQL::query: 1146 - Table 'dum_dummy.jos_vm_cart' doesn't exist SQL=SELECT `cart_content` FROM `jos_vm_cart` WHERE `user_id`=62


JDatabaseMySQL::query: 1146 - Table 'dum_dummy.jos_vm_cart' doesn't exist SQL=SELECT `cart_content` FROM `jos_vm_cart` WHERE `user_id`=62

Call stack
#    Function    Location
1    jsite->dispatch()    /home/dum/public_html/newsite/index.php:68
2    jcomponenthelper::rendercomponent()    /home/dum/public_html/newsite/includes/application.php:124
3    require_once()    /home/dum/public_html/newsite/libraries/joomla/application/component/helper.php:162
4    require_once()    /home/dum/public_html/newsite/components/com_virtuemart/virtuemart.php:22
5    require_once()    /home/dum/public_html/newsite/components/com_virtuemart/virtuemart_parser.php:74
6    ps_cart::initcart()    /home/dum/public_html/newsite/administrator/components/com_virtuemart/global.php:125
7    ps_db->query()    /home/dum/public_html/newsite/administrator/components/com_virtuemart/classes/ps_cart.php:39
8    jdatabasemysql->loadobjectlist()    /home/dum/public_html/newsite/administrator/components/com_virtuemart/classes/ps_database.php:120
9    jdatabasemysql->query()    /home/dum/public_html/newsite/libraries/joomla/database/database/mysql.php:452
10    jerror::raiseerror()    /home/dum/public_html/newsite/libraries/joomla/database/database/mysql.php:229
11    jerror::raise()    /home/dum/public_html/newsite/libraries/joomla/error/error.php:173
12    jexception->jobject()    /home/dum/public_html/newsite/libraries/joomla/error/error.php:138
13    call_user_func_array()    /home/dum/public_html/newsite/libraries/joomla/base/object.php:49
14    jexception->__construct()

I thought was a MIGS issue only to find that maybe my problem isn't what I thought?

--- more findings ----
Just checked the administrator/components/com_virtuemart/sql/virtuemart.installation.joomla.sql to make sure that jos_vm_cart was there to install and discovered the following

Quote
CREATE TABLE IF NOT EXISTS `jos_vm_cart` (
`user_id` INT( 11 ) NOT NULL ,
`cart_content` TEXT NOT NULL ,
`last_updated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY ( `user_id` )
) TYPE = MYISAM COMMENT = 'Stores the cart contents of a user';

Ok so it never installed .. I'll do it manually ... wrong!!

Quote
#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIMESTAMP ,
PRIMARY KEY ( `user_id` )
) TYPE = MYISAM

Can someone enlighten me as what to do and where to go with this please?  ::)

asterix

  • Beginner
  • *
  • Posts: 43
    • Darwin Website design
Re: Can't add a new payment method
« Reply #5 on: May 29, 2008, 04:55:30 am »
You need to change the file permission (CHMOD) for ps_migs.php and ps_migs.cfg.php to 777 in order to make changes to them through your virtuemart console.
Or you can manually write in the changes to the .cfg file and upload them.


The dum_dummy error  - are you trying to purchase a 'dummy' product that comes with virtuemart (the sample products?_)
Try using a real one perhaps and see if that sorts it.

See how you go manually installing, there is an ecommerce download version of Virtuemart with joomla and virtuemart in the one package.

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #6 on: May 30, 2008, 00:22:45 am »
asterix - the files are 777 but when saving the page reloads ... the admin template disappears whilst the contents is ther and I get the following error ...

public_html/newsite/administrator/components/com_virtuemart/classes/payment/ps_migs.cfg.php :: Writeable
Direct Access to this location is not allowed.


Will try your other suggestions and report back

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #7 on: June 06, 2008, 03:50:25 am »
Makes no difference.
  :'(

drhiii

  • Beginner
  • *
  • Posts: 7
Re: Can't add a new payment method
« Reply #8 on: July 26, 2008, 16:05:18 pm »
Was this 500 error ever solved?  I am now getting this error in Joomla 1.5.3 and 1.5.4, for not just VirtueMart, but other components too.  Across several installations.

I have not changed my php or apache environment at all. 

Help??

aussieute

  • Jr. Member
  • **
  • Posts: 75
Re: Can't add a new payment method
« Reply #9 on: August 18, 2008, 02:29:41 am »
It related specifically to MIGS Mastercard payment module

tez

  • Jr. Member
  • **
  • Posts: 130
Re: Can't add a new payment method
« Reply #10 on: February 25, 2009, 14:01:05 pm »
I ran into this problem too. I have ps_migs working on another copy of Joomla 1.5.9 with vm 1.1.3, same files. But after I added the payment method to a new Joomla install It gives the same error as above.

I might add that my working Joomla was an upgrade version from 1.5.6 and vm 1.0.x to 1.1.2 to 1.1.3 (actually it was probably a Complete Package install with Joomla/vm preinstalled). So there might be an extra file or two in there which helps VM load the Joomla functions, but not for new installs?

tez

  • Jr. Member
  • **
  • Posts: 130
Re: Can't add a new payment method
« Reply #11 on: February 25, 2009, 14:27:47 pm »
Ah found it. Turn on Legacy Plugin in the Plugin Manager.  This is for the old ps_migs.php
There is a new ps_migs which works with 1.5+ and vm1.x+ which I have not tried yet. Find that here http://forum.virtuemart.net/index.php?topic=19994.msg144050#msg144050

You don't want Legacy mode, so change mosGetParam to vmGet (as above) and also change the lines
Code: [Select]
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); to the Joomla 1.5  non-legacy way
Code: [Select]
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

You will also have to change the part which has
Code: [Select]
$config .= "defined('_VALID_MOS') or die(To the new way,
Code: [Select]
$config .= "if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); \n\n";
Because that is written into the .cfg file when you edit your settings...

Might as well add this fix for unregistered shopping incase you run into missing Credit Card drop down, http://forum.virtuemart.net/index.php?topic=40477.0

Your transaction key might need to be entered gain. Commbank calls it Access Code. Click View/Change Secure Hash, enter your admin password (? i assume), then enter your Access Code and admin password again.