Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

States, PSIGate and other wierdness...


lenz

Recommended Posts

I am trying to get psigate to work with an oscommerce store and have a single problem at this time i do not kow how to solve. The oscommerece software transmits the users STATE as a full word - Minnesota vs. MN and PSIGATE says they need it to transmit as the abbreviation. Therefore NO transactions go through. How do I change this? Change it so it stores the users data as an abbreviation and not the full state name...

 

Also I downloaded and began installing the latest milestone of OSC in hopes that there would be an OBVIOUS fix for the above question and have found that it DOES NOT include the STATE field in the user profile... What is up with this? Am I missing something?

Link to comment
Share on other sites

State is simply turned off in the admin.....go to admin>customer details and enable it.

 

For your PSI gate problem take a look at the database and find the table that hold the state abbreviations and change the field in the psigate to call for the abbreviation.

Link to comment
Share on other sites

Thanks - I kind of figured this pref was able to be changed and I have been looking since yesterday - BUT There is NO admin>customer details.

 

Can someone give better directions?

 

I need:

1) The location of the pref to ENABLE states to be viewed.

2) the location of the pref to change FULL state to ABBREVIATED state

Link to comment
Share on other sites

Have you finished installing the MS1? Did you update the database? If you did the state field is accessable through the admin. However, the admin only turns it on or off and has nothing to do with the PSI gate.

 

To fix the PSI gate you actually have to edit some code. You will find the 2 letter state codes in the table called zones, in a column called zone_codes you need to put that in the area of PSI gate that is calling for the state's name.

Link to comment
Share on other sites

You are kidding. Why is this included if it does not work out of the box? I dont know that I can do the editing... Am I modifying the PSIGate payment module on my side? Yeah - Ok but - you talk of getting info from a table - From phpmyadmin, yes? Then I modify the PSIGate module with what? All psigate wants is Abbreviation and not full state... This seems like it should be a switch for this monkey to flip...

 

Thanks for the help.

 

I did find this thread which I think will fix the no state showing up/no customer details showing up problem...http://www.oscommerce.com/forums/viewtopic.php?t=35295&postdays=0&postorder=asc&start=20

Link to comment
Share on other sites

Nope, I'm not kidding. :D :D

 

You are using Open Source software that is still under development....Sometimes you have to fix things...That's part of the joy of non-commercial software.

 

Also, if you'll look for the other thread that txwebman had, he did have the same problem with the state not showing....He had to update the the database. I think I asked if you had done that.

Link to comment
Share on other sites

Well - i am having no luck upgrading the database so i might just go another route and reinstall a base OSC in another DB - then move my data over. I am still in shock over the fact that PSIGate is ready to run, with the payment module included, but it will not. I appreciate and love free software, but doesnt anyone test this stuff?

 

Clay :lookround:

Link to comment
Share on other sites

Here is what i found so far... This is the call in the psigate that is the "billing state"

 

tep_draw_hidden_field('Bstate', $order->billing['state']) .

 

This is the call in the psigate that is the "Shipping state" - Which i dont need to worry about... yet.

 

tep_draw_hidden_field('Sstate', $order->delivery['state']) .

 

But then there is this. Which looks like what you were talking about... I am not sure what to change to what...

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PSIGATE_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

 

To fix the PSI gate you actually have to edit some code. You will find the 2 letter state codes in the table called zones, in a column called zone_codes you need to put that in the area of PSI gate that is calling for the state's name.

 

Hmm - does this mean I edit the module or the SQL database? I am not sure where this change should be... Little more help? Thanks... :?

Link to comment
Share on other sites

Clay,

 

I don't use PSI gate but, looking at the code for the module (catalog/includes/modules/payment/psigate.php) I'd say the change you need to make is in this section.

 

      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PSIGATE_ZONE > 0) ) {

       $check_flag = false;

       $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PSIGATE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");

       while ($check = tep_db_fetch_array($check_query)) {

         if ($check['zone_id'] < 1) {

           $check_flag = true;

           break;

         } elseif ($check['zone_id'] == $order->billing['zone_id']) {

           $check_flag = true;

           break;

         }

       }



       if ($check_flag == false) {

         $this->enabled = false;

       }

     }

Link to comment
Share on other sites

Well I am not a php coder so I would not presume to debate you - BUT this reference does not mention the 'zone_name' field which is the field that is being transmitted. I looked elsewhere for this field reference hoping there was a place to swap it for the 'zone_code' field which is what is needed to be transmitted - And no luck - Most of the place it is referenced it is scripted in and would likely break unless 10 other references are updated. So I have to guess that the reference that is passing the value to the PSI module is not in that file - perhaps in the...

 

Thank you so much for your help - i understand the problem and might have a fix on the solution, but i am still not sure what to do unless someone tells me the code.

 

Anybody know anybody who uses PSIGate - I mean the code in the the SW - You would think people use it! Or maybe not cause they have to rewrite the code!!! Hah! :(

 

Well it is paid for and I have to get it working or there will be hell to pay.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...