Forum OpenACS Q&A: Ecommerce Module, OpenACS from CVS Head and Postgres 7.2

Hello,

I have read in the bboards that support for PG7.1 will eventually be
dropped for PG7.2.

I was wondering if anyone has tried putting ecommerce module through
its paces with a PG7.2 install of OpenACS from Head.

Thanks,

I just installed the latest release of OpenACS on an up-to-date RedHat v7.3 system that includes the latest PG RPMs. All is well so far. Today is August 20, 2002. I have yet to perform any extensive testing on the ecommerce package.
I have been working on this for the past several days, testing on FreeBSD 4.6 with Postgresql 7.2.1. I have run into several bugs:

The bug tracker only suggests that Ecommerce for OACS 3.x is reportable. I'll review what I've found and will be happy to file bug reports and patches where I have them when a new category is created, or somebody tells me just to use the Ecommerce category that's in there.

First of all, in sql/postgresql/ecommerce-create.sql, replace all instances of timestamp with timestamp(0). I'm not sure when PG started this precision on the timestamp, but Tcl won't parse the fractions of a second business. I'd much prefer being able to tell my Postgresql to default to (0) for compatability with previous versions. Maybe somebody here knows how. As it stands, this change is not backwards compatable.

Next, I deleted the query ec_creditcard_authorization.transaction_data_select from ecommerce-credit-procs.sql, because it's implemented in both the -oracle and -postgresql versions, and it was picking up the Oracle version. I'm even not sure that I have this all worked out yet, but it certainly does not belong there, right?

Finally, I had to make a lot of changes to the www/checkout.tcl script. The db_multirow in line 62 is backwards, ie.

db_multirow get_user_addresses addresses {
should be
db_multirow addresses get_user_address {

But that's not what I ended up with. It looks like the full change never got committed, or something. I ended up using the following changes:

Index: www/checkout.tcl
===================================================================
RCS file: /cvsroot/openacs-4/packages/ecommerce/www/checkout.tcl,v
retrieving revision 1.5
diff -u -r1.5 checkout.tcl
--- www/checkout.tcl    5 Aug 2002 15:29:18 -0000       1.5
+++ www/checkout.tcl    5 Sep 2002 15:16:49 -0000
@@ -59,7 +59,7 @@
 
     # Present all saved addresses
 
-    db_multirow get_user_addresses addresses {
+    db_multirow -extend {formatted delete edit use} addresses get_user_addresses {
         select address_id, attn, line1, line2, city, usps_abbrev, 
               zip_code, phone, country_code, full_state_name, phone_time, 
               address_type
@@ -68,12 +68,13 @@
            and address_type = 'shipping'
     } {
 
-       set row(formatted) [ec_display_as_html [ec_pretty_mailing_address_from_args $row(line1) $row(line2) $row(city) $row(usps_abbrev) $row(zip_code) $row(country_code) 
-                                                   $row(full_state_name) $row(attn) $row(phone) $row(phone_time)]]
-       set address_id $row(address_id)
-       set row(delete) "[export_form_vars address_id]"
-       set row(edit) "[export_form_vars address_id address_type]"
-       set row(use) "[export_form_vars address_id]"
+       set formatted [ec_display_as_html [ec_pretty_mailing_address_from_args
+               $line1 $line2 $city $usps_abbrev $zip_code $country_code 
+                               $full_state_name $attn $phone $phone_time]]
+       #set address_id $row(address_id)
+       set delete "[export_form_vars address_id]"
+       set edit "[export_form_vars address_id address_type]"
+       set use "[export_form_vars address_id]"
     }
     set hidden_form_vars [export_form_vars address_type]
 
Randy,

It looks like I forgot to commit the timestamp(0) fix that I did over a month ago. Oh, wait, no I didn't forget to commit. I just didn't commit at the time because I didn't have time to work on upgrade scripts back then. I wondered if you could just make an UPDATE on the PG data dictionary for those columns.

There are _lots_ of things that could be improved on the e-commerce package. I fixed some, and I'm still fixing. One of the main things I'm adding to it is multiple payment gateway support. Right now it only supports one payment gateway and it's hard-wired for credit card payments.

Also, I think you meant ecommerce-credit-procs.xql, no? If so, I think you're correct.

Let's keep this e-commerce discussions (and fixes) coming.

I must add that I think Bart did a good job on the porting of the module. The improvements are needed because the e-commerce was made for the 3.x ACS series and it shows, and on top of that the module as a whole is very hard-coding happy.

These 3.x- and hard-code-isms were left in the 4.x port probably due to time and bugdget constraints. We have to fix those.