response URL problem from payment provider


  • Your avatar
    seyi    
     4 years ago
    0

    Hi. I have problem with response page after redirect transaction. Problem appeared after "Coupon Pro" for Virtuemart instalation. Log is showing this : "PHP Fatal error: Class 'ps_DB' not found in root/www.mywebsite.com/response.php"
    I'm using it for gift certificate.

    Any Help with this Please?

    Peter
  • Your avatar
    seyi    
     4 years ago
    0

    hello,

    I do not have a response.php file in the root. Is this a customized file?
  • Default avatar
    piotr8    
     4 years ago
    0

    This *_response.php is file requested by external server (developed by payment provider) . In this file there is a few php instructions related to joomla and virtuemart files. All was fine until Avo Coupon was installed. After installation I have made transaction and on redirect payment site was error about no access this *_response file. In fact there was access but *_response.php file include an error from some other virtuemart or joomla file. Gift coupons would be a perfect solution in my shop but I need help with this.

    Peter
  • Your avatar
    seyi    
     4 years ago
    0

    there is only one place this code is called in AwoCoupon, and if you are having this error, then you must be calling the coupon code function outside of virtuemart. Try this to see if it fixes the problem:

    in www/administrator/components/com_awocoupon/assets/virtuemart/ps_coupon.php, around line 1297 is this code
    <?php
    $db 
    = new ps_DB;
    if( 
    $auth["user_id"] > ) {

        
    $q "SELECT state, country FROM #__{vm}_user_info WHERE user_id='"$auth["user_id"] . "'";
        
    $db->query($q);

        
    $db->next_record();
        
    $state $db->f("state");
        
    $country $db->f("country");

        
    $q "SELECT tax_rate FROM #__{vm}_tax_rate WHERE tax_country='$country' ";
        if( !empty(
    $state)) {
            
    $q .= "AND (tax_state='$state' OR tax_state=' $state ' OR tax_state='-')";
        }
        
    $db->query($q);
        if (
    $db->next_record()) {
            
    $my_taxrate $db->f("tax_rate");
        }
        else {
            
    $my_taxrate 0;
        }
    }
    ?>


    change it completely to this
    <?php
    $db 
    = & JFactory::getDBO();    
    if( 
    $auth["user_id"] > ) {

        
    $db->setQuery("SELECT state, country FROM #__vm_user_info WHERE user_id='"$auth["user_id"] . "'");
        
    $tmp $db->loadObject();
        @
    $state $tmp->state;
        @
    $country $tmp->country;

        
    $q "SELECT tax_rate FROM #__vm_tax_rate WHERE tax_country='$country' ";
        if( !empty(
    $state)) {
            
    $q .= "AND (tax_state='$state' OR tax_state=' $state ' OR tax_state='-')";
        }
        
    $db->setQuery($q);
        
    $my_taxrate = (float)$db->loadResult();
    }
    ?>
  • Default avatar
    piotr8    
     4 years ago
    0

    Thanx for that answer but unfortunately its not working. I replaced exactly as you show above but still the same problem. Maybe its obvious but even I uninstall Avo Coupon, its not change anything. There is only test item on store so least time I just made new installation of Virtuemart.

    Any other idea?

    Thank you
    Peter
  • Your avatar
    seyi    
     4 years ago
    0

    The actual error from your first post is
    PHP Fatal error: Class 'ps_DB' not found in root/www.mywebsite.com/response.php


    I think you would need to look in that particular file. The error should have given you a line number also.
  • Default avatar
    piotr8    
     4 years ago
    0

    Hi seyi,
    I have sent it to you on PM

    Peter
  • Default avatar
    piotr8    
     4 years ago
    0

    Hi,
    So, is that all support what I can expect after Avo Coupon Pro purchase?
    My shop was running until I installed your plugin which is high rated on joomla forum. And no more support.

    not good.
  • Your avatar
    seyi    
     4 years ago
    0

    Hi Peter,

    I sent you a possible solution through pm yesterday. Also this is custom code, outside of AwoCoupon. You cannot expect support for that.
  • Default avatar
    piotr8    
     4 years ago
    0

    Hi Seyi,
    I didn't check my PM before. There was no message sent on my email. Sorry about that!
    But I want to say that your help was excellent. Finally everything is working as it should.
    Thank you for very good support.
    If I understand (I'm not coding...) mistake was made by programmers who delivered payment module for Virtuemart? Particularly this response.php?

    Anyway thx once more

    Piotr
  • Your avatar
    seyi    
     4 years ago
    0

    No problem, glad to hear you got it working.

    If the solution I proposed was the one you used, then yes, it was a coding mistake in the payment module. The 'if' condition was closed too early causing the error to occur if the 'if' condition code was not run.