Paypal checkout module (it's done!)

LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Fri, 2005-06-17 07:43

Hello,

Many Thanks for a great Add-On!! After changing the modules.inc as suggested in a previous entry, it works perfect with my latest nightly CVS build.
Only one issue - I had to list all prices with "." (even having the "," normally used in my country settings). With ",", the shipping and handling is not transfered to Paypal and appears as 0.00 on the statement. The item prices had been 'converted' somehow - but using the "." it's perfect.

Thanks again,
Best regards,
Lutz

-------------
Gallery version = 2.0-beta-3+ core 0.9.25
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.53 (Win32) DAV/2 PHP/5.0.4
Database = mysql 5.0.3-beta-nt
Toolkits = Thumbnail, Exif, ArchiveUpload, ImageMagick, Ffmpeg, Dcraw, Gd
Operating system = Windows NT DELL-4550 5.1 build 2600
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT))

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Fri, 2005-06-17 09:05

LFrank- I am aware of the problem using anything apart from '.' as a separator. This arises from the fact that Gallery doesn't have a floating-point storage type, so we have to store things as strings or integers, and cast back and forth as necessary. It's on my list of things to tidy up, but it's one of those that isn't going to be as straightforward as it sounds!!

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sat, 2005-06-18 18:40

*** UPDATED ***
Took down the module files from this post as they are old and no longer supported. See here for the current versions to work with Beta 4.
***

(Updated with notes on CVS versions)

Right - the next version of the plugin is now ready for the more adventurous of you to test...

I have had to make a number of changes to the structure of the module - not least the creation of a new plugin structure for payment processing elements. What was just one module has evolved into three different modules (with the addition of the email payment option). The basic structure is now as follows:

  • checkout - takes care of compiling the order details - selecting products, quantities, showing prices, etc, then hands off to one of the installed checkout payment plugins. I've packaged 2 such plugins in the downloads below:
  • checkoutpaypal - this now handles the actual PayPal payment processing elements that were previously in checkout. There is one small change in functionality - each item/product combo is now added as a separate line in the PayPal cart with the appropriate quantities.
  • checkoutemail - an all-new email payment processor, as promised in previous posts. This collects some more information from the customer, then sends emails as per the module configuration.

One major advantage of this new structure is that it makes it relatively easy to add further payment processor plugins in the future. Things like WorldPay, or any other merchant service, can just be coded as payment processors without having to worry about the rest of the cart logic.

One problem I came across was because I wanted the email module to send HTML emails (we could do text, but it's just plain ugly) - there turned out to be a limitation in GalleryCoreApi::sendTemplatedEmail. mindless very kindly added the option to send additional headers to the email function, so we can now create a MIME multipart message. The downside - this version of the module requires today's CVS at least in order to run. This is not for the faint of heart!!

I debated long and hard about whether to go down the CVS route, and decided that the email functionality seems to be sufficiently in demand to warrant it. For those of you who want Gallery to send you the order information by email, use this version of the module. For those of you who are just after PayPal, and would prefer to run a more well-known G2 release, stick to the previous version with G2 Beta 3.

One further warning is about the email plugin. Note that the version is 0.0.1 - that should give you an idea of how early this plugin really is! There are things that I know are missing - particularly input validation on the details form - and I'm sure there are 101 things I don't know about as well... If you're going to use this, please can I ask that you provide me feedback so I can fix the bugs?

UPDATE - important note on CVS versions:
There are indications that these modules will not work with some of the more recent CVS releases. I'd suggest downloading the 1st July release, as that is the one I tested against. Have a read of the CVS instructions here for an overview, but use the following command to actually check out the module:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/gallery checkout -D 7/1/2005 -P gallery2

Anyway, enough warnings, here's the code:[/]

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Sat, 2005-06-18 18:58

Oh my gosh... I have just about fainted. Guess what I will be doing today? Turnbulm, you are my new role model. To have someone applying energy to this is in a word, fantastico...

turnbulm wrote:
Right - the next version of the plugin is now ready for the more adventurous of you to test...

I have had to make a number of changes to the structure of the module - not least the creation of a new plugin structure for payment processing elements. What was just one module has evolved into three different modules (with the addition of the email payment option). The basic structure is now as follows:

  • checkout - takes care of compiling the order details - selecting products, quantities, showing prices, etc, then hands off to one of the installed checkout payment plugins. I've packaged 2 such plugins in the downloads below:
  • checkoutpaypal - this now handles the actual PayPal payment processing elements that were previously in checkout. There is one small change in functionality - each item/product combo is now added as a separate line in the PayPal cart with the appropriate quantities.
  • checkoutemail - an all-new email payment processor, as promised in previous posts. This collects some more information from the customer, then sends emails as per the module configuration.

One major advantage of this new structure is that it makes it relatively easy to add further payment processor plugins in the future. Things like WorldPay, or any other merchant service, can just be coded as payment processors without having to worry about the rest of the cart logic.

One problem I came across was because I wanted the email module to send HTML emails (we could do text, but it's just plain ugly) - there turned out to be a limitation in GalleryCoreApi::sendTemplatedEmail. midless very kindly added the option to send additional headers to the email function, so we can now create a MIME multipart message. The downside - this version of the module requires today's CVS at least in order to run. This is not for the faint of heart!!

I debated long and hard about whether to go down the CVS route, and decided that the email functionality seems to be sufficiently in demand to warrant it. For those of you who want Gallery to send you the order information by email, use this version of the module. For those of you who are just after PayPal, and would prefer to run a more well-known G2 release, stick to the previous version with G2 Beta 3.

One further warning is about the email plugin. Note that the version is 0.0.1 - that should give you an idea of how early this plugin really is! There are things that I know are missing - particularly input validation on the details form - and I'm sure there are 101 things I don't know about as well... If you're going to use this, please can I ask that you provide me feedback so I can fix the bugs?

Anyway, enough warnings, here's the code:

[/]

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 05:01

Wow, the new set of modules looks promising!! Many Thanks!

Two 'little' things ...

- I would love to get the detailed E-mail using even the PayPal Checkout (having those generic filenames provided by the camera). At least testing the sandbox, I only got the 'normal# confirmations.

- The E-Mail sent does not display the thumbnail - the link to the original gallery page works. I found that if I delete the ?g2navId=x545d0ec0 from the thumbnail and open the link to the JPG directly, it is displayed.

- and (I forgot) the E-Mail using off-line payment - shouldn't it ask for some payment details?

Best regards,

Lutz

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sun, 2005-06-19 08:45

LFrank - the confirmations I get from PayPal include the filename, products, and quantities exactly as they are loaded into the PayPal cart. What is missing from your confirmations that you need in order to print the order? However, I am thinking of getting this kind of email sent out as part of the PayPal process as well - probably when we get the IPN from PayPal so we know the payment is complete. Before I do this though I want to resolve any bugs in the plain email module so I can re-use the code without having to track future problems in 2 places...

I think the problem with URLs is to do with how I'm using Gallery's URL generator. I didn't see this issue on my machine, but I hadn't noticed that the navId was being appended. I'll play around with this a bit and see if I can get a cleaner URL - any maybe even one to the full-size rather than just the resizes.

There's a whole bunch of extra stuff that probably wants to go on the 'Details' page, but I think it's likely that everyone will have different ideas. My plan is to see what people want, and set it up to match the most common requests. After that, the module is actually pretty easy to customise if anyone wants anything different. What kind of payment details were you thinking of capturing here?

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sun, 2005-06-19 09:25

LFrank- I can't reproduce your problem with the thumbnails. Please can you add me to the list of recipients for a test transaction, then go ahead and get it to send me an email? My address is in the header of module.inc.

BTW - what email client are you using to view the message?

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 10:01

the clients were Outlook Express and MDaemons WorldClient.
A test "buy" is on its way
:)
CU
Lutz

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 10:12

Being not logged in, I've just got the following error:

Error Detail -
Error (ERROR_BAD_PARAMETER)
in C:\Inetpub\Scripts\GALLERY2\modules\core\classes\helpers\GalleryDerivativeHelper_medium.class at line 48 (EmailController::error)
in C:\Inetpub\Scripts\GALLERY2\modules\core\classes\GalleryCoreApi.class at line 882 (EmailController::fetchThumbnailsByItemIds)
in C:\Inetpub\Scripts\GALLERY2\modules\checkoutemail\Email.inc at line 93 (EmailController::fetchThumbnailsByItemIds)
in C:\Inetpub\Scripts\GALLERY2\main.php at line 183 (EmailController::handleRequest)
in C:\Inetpub\Scripts\GALLERY2\main.php at line 87
in C:\Inetpub\Scripts\GALLERY2\main.php at line 78
System Information
Gallery version 2.0-beta-3+
PHP version 5.0.4 apache2handler
Webserver Apache/2.0.53 (Win32) DAV/2 PHP/5.0.4
Database mysql 5.0.3-beta-nt
Toolkits ImageMagick, Gd
Operating system Windows NT DELL-4550 5.1 build 2600
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

Being logged in, it runs fine (except the thumb) - you should have received a copy of the mail generated recently.

perhaps that's related to my thumbs issue

CU
Lutz

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 10:19
turnbulm wrote:
LFrank- the confirmations I get from PayPal include the filename, products, and quantities exactly as they are loaded into the PayPal cart. What is missing from your confirmations that you need in order to print the order?

I would love to know the album, having a lot of images with very similar names. Identifying the album - or seeing the thumb - would help greatly.
CU
Lutz

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sun, 2005-06-19 10:41

LFrank- there seems to be something strange going on with you G2 install. I tried browsing directly to the following URL: http://localmail.dynip.com/GALLERY2/main.php?g2_view=Core:ShowItem&g2_itemId=58639 and G2 just bombed out. I'm not entirely sure, but I have a feeling this may have something to do with the rewrite module. Please can you disable short URLs on your site then try again?

This is something deeper than the email module - it's in the core of Gallery. The URL we've constructed and sent in the message is correct, it's just that your G2 isn't fulfilling the request properly.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 12:20

OK, I've disabled all the rules in Rewrite - and deactivated the whole module.
Best regards,
Lutz

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 13:04

I've just checked all file permissions within my gallery (program and image container), cleared all caches and tried again.
Opening the gallery as a guest, ading items to the cart and checking (offline) out gives no error any longer (using 'normal' URL's).

Nevertheless the mail containing the thumb does not display the thumb. Getting the thumb-URL and opening it directly in explorer (http://localmail.dynip.com/GALLERY2/main.php?g2_view=core.DownloadItem&g2_itemId=59857&g2_serialNumber=2&g2_navId=xd88117cc) gives a "not authorized", stripping the &g2_navID part (http://localmail.dynip.com/GALLERY2/main.php?g2_view=core.DownloadItem&g2_itemId=59857&g2_serialNumber=2) opens the thumb.
(The links posted just worked exactly as described)

Strange - isn't it?

Lutz

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sun, 2005-06-19 13:39

Very strange.... I recall reading a post where someone had problems with navId a few months ago, but I can't find it again now. I don't think it went anywhere though from memory.

The thing is, only Apache can issue a 403. Gallery will return some other kind of Gallery problem - or just redirect to the main page - if you try to get an image you're not authorised for. What do your web logs say when you try this?

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 14:23

turnbulm, the error logs do not contain anything related to the gallery access - really strange

 
highpulse
highpulse's picture

Joined: 2004-05-15
Posts: 45
Posted: Sun, 2005-06-19 15:23

Turnbulm, I have no clue about half of the things you are talking about so I will just smile :) and say THANKS! I will learn as I go.

I have 1700 pictures to process first today so I might not beable to install your update till tonight or tomorrow. Oh and it is "Father's Day" in the USA so I better spend time being one. Is "Father's Day" a USA only holiday?

Thanks again everyone!

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-19 15:29

highpulse, Europe - at least Switzerland and Germany - have already had its father's day a few weeks ago ;)
Have much Fun!

 
samscales

Joined: 2002-09-29
Posts: 53
Posted: Sun, 2005-06-19 17:24

highpulse - "Father's Day" today in the UK, so I guess were more lined up with you over the pond than Europe. :o

 
highpulse
highpulse's picture

Joined: 2004-05-15
Posts: 45
Posted: Sun, 2005-06-19 18:04

All right, a little off topic but more important!

Happy Father's Day regardless of which day you celebrate it on!

 
sevensleeper2005

Joined: 2005-06-21
Posts: 2
Posted: Tue, 2005-06-21 17:23

Hi Everyone,
just installed Gallery 2 beta 3. Really nice. Saw the checkout module and of course wanted to give it a spin. Getting a error though on the Checkout module. The paypal and email module installed fine but the checkout is giving me this error:

Error (ERROR_BAD_PARAMETER) : checkout.Admin can't be parsed
in modules/core/classes/GalleryView.class at line 124 (gallerystatus::error)
in modules/core/SiteAdmin.inc at line 154 (galleryview::loadview)
in modules/core/classes/GalleryView.class at line 214 (siteadminview::loadtemplate)
in main.php at line 302 (siteadminview::doloadtemplate)
in main.php at line 86
in main.php at line 77

Any ideas. Thanks,
J

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Tue, 2005-06-21 20:58

sevensleeper2005- the version of the module you have (the one in three parts) requires a pretty recent CVS build to run. There are definitely problems in there that will keep it from working with G2B3, and it looks like you've got one of them.

There was an API change recently (since B3) where the naming convention for views has changed from using a : separator to a . instead. The error you're seeing above is because of the view name 'checkout.Admin' in line with the new API - and the reason that you're only seeing it on the Checkout module is because (I think) that's the only module of the three that requires configuration at install time.

If you want a version of the plugin to work with G2B3, you need to use v0.1.4 from page 4 of this post. If you want the current version of the module with the email capability then you need to read my warnings in the post on page 5 and get a recent version of G2 from CVS or the snapshots.

 
sevensleeper2005

Joined: 2005-06-21
Posts: 2
Posted: Wed, 2005-06-22 15:37

Thank you turnblum. Will try a CVS version. Or maybe I'll have the patience to wait for Gallery2 to become final. Gotta see how much time I have on my hands. But I would like to thank all the people who contribute so much work to the Gallery project.
Thanks, J

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Wed, 2005-06-22 22:12

Turnbulm... I have had opportunity to install and work with the new modules.

Wonderful.

The logic and flow are great. There are little tweaks or wishlist things, but I wanted to express without adding the gimme gimme gimme stuff... that I appreciate your work on this very much. What a boon to have this added into G2!

regards, drhiii

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Wed, 2005-06-22 22:44

Thanks for the comments :)

Go on - what are the wishlist things? Like I said above, I know this is a really early version of the email thing, and my plan was to see what people wanted before I decided what to tweak in the final version.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Thu, 2005-06-23 01:55

Well, first things first... is that you need to know how much this is appreciated by me and am certain many others. The email notifications with appended URLs is fantastic. It makes it instantly doable for photographers being able to communicate to printers in far fewer steps. That alone is worth its weight in platinum.

Okie dokie, wish list stuff. Trust you will discard at will.... here goes.

Something I notice is when Adding something to the Cart, G2 assigns 1 to the quantity, but when "Purchase Photos" is selected, the quantity is blank and if a number is not re-inserted, it results in no value all the way through to checkout. Not sure if this is intended behavior but methinks having the quantity value carried over might be smoother than leaving the field blank.

Am sure you are being pestered over "tax" fields so will not re-pester on that.

Littletechgirl brought up a good point about prepaid shoots. A couple things here... perhaps a more generic piece of language here might help that instead of "Pay Offline". I of course can go dig into the scripts and change it, but this is just a thought. "Complete Transaction Offline" is horribly long, complicated and cumbersome, but you get the idea. This way the Selection can satisfy two funtions... pay by "whatever method like check" or just select images and submit it because it is a prepaid gig. In this logic, having the ability to deselect shipping cost too. Or perhaps a fork in the logic where one may select a 'prepaid' option that leads them down a no pay/no shipping cost value that just generates a notification email? This all may be more trouble than this is worth of course.

More fields for paper and items?

Oh yes, something that would be most helpful is in the Product/Price/Quantity/Paper screen... providing a text box or FAQ box to the owner of the gallery so that text may be entered ala an information box, that could be used to provide some detail about print processes, paper types, stuff like that. I find myself wanting to provide some info or descriptions at some point in the process and this seem the best place. Or in an expanded view, providing a FAQ box for each screen in the checkout process that displays if populated, otherwise remains null?

Another selection that would be helpful would be "custom" print or "ask a question". This is opening up perhaps unwanted communications to the photographer or printer, but this could be admin selectable. Selecting this would place someone in an email situation where the image URL would be sent to the email address, no transaction. This may have little merit to some, but I find providing a way for a person to be able to create a simple dialogue often times can seal a deal. And of course, email addresses can be made available via G2 anyway so this may be moot.

An Admin screen to manage transactions? Pending orders, completed orders, etc. A mini accounting thingie. Just a thought.

And a big one which I don't think you have control over as this needs to be handled at the system permissions layer... but the ability to allow or deny the whole shopping cart module on a per album basis. I know there is a thread that drills down into a more granular permissions schema, but I thought to mention this for the whatever because ya never know. The ability to allow or deny the cart and checkout on a per album basis is very useful.

Ok, off this long soapbox. Your code and logic lay out very nicely. Every aspect, from functions to cosmetics to over all flow... well done! You have created a fanbase for sure.

drhiii

turnbulm wrote:
Thanks for the comments :)

Go on - what are the wishlist things? Like I said above, I know this is a really early version of the email thing, and my plan was to see what people wanted before I decided what to tweak in the final version.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Thu, 2005-06-23 04:14

Turnbulm, I need a little help. I installed all 3 parts, but when I go to the "Checkout by Email" config page in Site Admin, I get the following error next to all 3 email address fields. Any ideas?

Notice: Undefined index: showCustomer in C:\Inetpub\xxx\gallery2\g2data\smarty\templates_c\%%416902858\%%16^16A^16A70BC3%%Admin.tpl.php on line 98
>

Thanks in advance!

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Thu, 2005-06-23 09:44

drhiii- quite a list! There's a few things on there that are already on my list as 'must do' items, and there are a couple of new ideas.

Re: more products and papers - just keep adding and saaving your changes. The logic on the admin page will make sure there's always spare boxes (definitely for products and I think I also did it for papers).

The main things about workflow and logic you have mentioned are all in my mind for version 2 of this lot. There are a number of limitations that have grown out of the way we have to plug in to the existing 'cart' module, and I'm seriously thinking of making this whole module stand alone with its own cart logic. That would make it much easier to do the permissions thing, quantities, supported item types, make the checkout buttons more prominent than the action dropdown, etc. A nice place to go, but I'm sure you can see it's not going to be easy...

Some of the other things are starting to show up in how I've split the modules. It was definitely the right thing to do, but I need to work a bit on persistent storage so it's all owned and maintainted correctly. Until that's right I can't get the proper view on transactions necessary to do the admin page. That one is in the works now.

littletechgirl- I've never come across that error before... will it let you define an email address and check all three boxes? If you do, does the error go away? I think it might be something to do with an assumption I've made on the state of undefined variables that might not be valid in all installations.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Thu, 2005-06-23 10:15

I know. I got carried away when ya said 'go ahead'. Kid in a candy store. I do wish I could code so I could contrib tho.

And I understand the information below. Add more boxes, they are smart and grow. Yes.

To cut to the chase, I do not think this would be easy at all, to anticipate the flow of things and then affect them. It was fantastic tho, and a big surprise, to see the modules appear and then observe the elegance that you applied to the flow.

Standalone. I understand. That this is modular is excellent as well. But it appears most of the things I chattered about you had already mused over. The permissions aspect tho... that you have already dug into this idea as well... pretty amazing.

Well done. I showed this to a couple of photo friends just in passing, stating it is in the werks, and they fell over with just the appearance of it. This whole thing, everyone who has made this possible... quite excellent imo. I will stand back and just test things as they appear and hopefully be able to supply some measure of support.

drhiii

turnbulm wrote:
drhiii- quite a list! There's a few things on there that are already on my list as 'must do' items, and there are a couple of new ideas.

Re: more products and papers - just keep adding and saaving your changes. The logic on the admin page will make sure there's always spare boxes (definitely for products and I think I also did it for papers).

The main things about workflow and logic you have mentioned are all in my mind for version 2 of this lot. There are a number of limitations that have grown out of the way we have to plug in to the existing 'cart' module, and I'm seriously thinking of making this whole module stand alone with its own cart logic. That would make it much easier to do the permissions thing, quantities, supported item types, make the checkout buttons more prominent than the action dropdown, etc. A nice place to go, but I'm sure you can see it's not going to be easy...

Some of the other things are starting to show up in how I've split the modules. It was definitely the right thing to do, but I need to work a bit on persistent storage so it's all owned and maintainted correctly. Until that's right I can't get the proper view on transactions necessary to do the admin page. That one is in the works now.

littletechgirl- I've never come across that error before... will it let you define an email address and check all three boxes? If you do, does the error go away? I think it might be something to do with an assumption I've made on the state of undefined variables that might not be valid in all installations.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Thu, 2005-06-23 12:00

Well, I tried that, but I get:

Notice: Undefined index: showThumbs in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 80

Notice: Undefined index: showLinks in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 89

Notice: Undefined index: showThumbs in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 80

Notice: Undefined index: showLinks in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 89

Notice: Undefined index: showThumbs in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 80

Notice: Undefined index: showLinks in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc on line 89

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Admin.inc:80) in C:\Inetpub\caincreativememories.com\gallery2\main.php on line 472

Where did it go wrong??

Quote:
littletechgirl - I've never come across that error before... will it let you define an email address and check all three boxes? If you do, does the error go away? I think it might be something to do with an assumption I've made on the state of undefined variables that might not be valid in all installations.

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Thu, 2005-06-23 17:03

littletechgirl- it seems this error was as I thought, because I'd made a dubious assumption about unitialized boolean variables. I've been more explicit in my code in admin.inc, and hopefully the issue has now been resolved.

I've uploaded a new version of the module in my post on page 7 with the fix.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Fri, 2005-06-24 00:29

Argh, you fixed that error, but now when i go through the cart and to to Purchase Photos, I get this:

Notice: unserialize(): Argument is not a string in C:\Inetpub\caincreativememories.com\gallery2\modules\checkout\SelectProducts.inc on line 60

and this...

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125
 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Fri, 2005-06-24 07:09

Hi!
Checkoutemail 0.0.2 runs fine on my latest CVS. Only issue is still the not appearing thumb in the body of the e-mail - Sigh.
... Eager to test more :)
Lutz

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Fri, 2005-06-24 08:44

littletechgirl- it looks like I've made the same bad assumption somewhere else. The thing is that in this case that assumption would have been made well back before v0.1.5. Did that version run OK on your platform? If so, what else has changed since it worked back then?

I will have a look at tidying up my assumptions again over the weekend, but this one isn't as simple as the last one so it'll take a bit longer...

LFrank- I still can't work out quite what's going on in your case. Did you get anywhere with working out where your http/403 errors were coming from, or why G2 bombed out with that URL I tried to retrieve an image?

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Fri, 2005-06-24 08:57

This is of little help because everything works, but will add that yes... every aspect of the checkout, checkoutemail and checkoutpaypal has worked. No errors on this current build, from 6-21 pulled from the nightly.

I showed it to someone today and their eyes got big as saucers.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Fri, 2005-06-24 10:10

turnbulm,

Quote:
I still can't work out quite what's going on in your case. Did you get anywhere with working out where your http/403 errors were coming from, or why G2 bombed out with that URL I tried to retrieve an image?

403:
No, unfortunately not - the logs are empty. No trace of the authorization error - only the NavID thing helped out. I'm currently reconfiguring my Apache not running the Gallery as a virtual Host. On the other trial, I'm installing an IIS again to better check what happened with the permissions. May this gives some more hints ... I'll keep you updated.

Bombing out:
Didn't happen again after clearing the template cache.

CU
Lutz

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Fri, 2005-06-24 12:24

Interesting. The other version worked great. Maybe I'll try a fresh install of everything later today and let you know what happens.

Kris

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Sat, 2005-06-25 19:50

littletechgirl- I also see some of the errors you mentioned, but only as informative errors in my Apache logs. They don't appear on the site and don't affect the functionality. Maybe you have something turned on in your php.ini about displaying errors?

I am planning on fixing the code to get rid of these, but I hadn't seen it as a big issue until now as it didn't affect how the module worked.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Sun, 2005-06-26 17:37

As told, I've switched from Virtual Host to classic access of my Apache Gallery and got some entries in my error/access.logs again (some similar to the already reported)
During the "shopping event"

84.159.194.183 - - [26/Jun/2005:18:50:37 +0200] "GET /GALLERY2/main.php?g2_view=checkoutemail.Details&g2_navId=x8c0b24e6 HTTP/1.0" 200 29762

from the error.log

[client 84.159.194.183] PHP Notice:  Undefined index:  quant in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 166, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=cart.ViewCart&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  paper in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 212, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=cart.ViewCart&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  quant in C:\\Inetpub\\Scripts\\GALLERY2\\modules\\checkout\\Confirm.inc on line 73, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.SelectProducts&g2_statusId=x18191425&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custName in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 61, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custEmail in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 67, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custAddress1 in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 73, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custAddress2 in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 79, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custAddress3 in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 85, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custAddress4 in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 91, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custAddress5 in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 97, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custZip in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 103, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custCountry in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 109, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6
[client 84.159.194.183] PHP Notice:  Undefined index:  custComments in F:\\G2data\\smarty\\templates_c\\%%3582604413\\%%1C^1C0^1C04E69B%%Details.tpl.php on line 115, referer: http://localmail.dynip.com/GALLERY2/main.php?g2_view=checkout.ConfirmPhotos&g2_navId=x8c0b24e6

after opening the mail received ...

84.159.194.183 - - [26/Jun/2005:19:26:41 +0200] "GET /GALLERY2/d/60811-2/Family+day+2005_05-06-18_0039.JPG?g2_navId=x8c0b24e6 HTTP/1.0" 403 349
84.159.194.183 - - [26/Jun/2005:19:26:47 +0200] "GET /GALLERY2/d/60811-2/Family+day+2005_05-06-18_0039.JPG?g2_navId=x8c0b24e6 HTTP/1.0" 403 349

and trying to open the thumb directly (giving my "famous" error)

84.159.194.183 - - [26/Jun/2005:19:27:46 +0200] "GET /GALLERY2/d/60811-2/Family+day+2005_05-06-18_0039.JPG?g2_navId=x8c0b24e6 HTTP/1.0" 403 349
and after "stripping" the navID
84.159.194.183 - - [26/Jun/2005:19:28:52 +0200] "GET /GALLERY2/d/60811-2/Family+day+2005_05-06-18_0039.JPG HTTP/1.0" 403 349
displaying the thumb.

I have E_ALL as error_reporting directive in my php.ini
No idea left ...

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-06-28 04:07

I'm back again and still getting the same Quant errors. Am I having problems because I am on IIS, not Apache??

Here's an abbreviated version:

Notice: Undefined index: quant in C:\Inetpub\caincreativememories.com\gallery2\g2data\smarty\templates_c\%%416902858\%%9A^9A7^9A79DAC9%%SelectProducts.tpl.php on line 125

I did try going through the cart anyway to see if it was just informative, but then I get:

Notice: Undefined index: newqty in C:\Inetpub\caincreativememories.com\gallery2\modules\checkout\Confirm.inc on line 82

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\caincreativememories.com\gallery2\modules\checkout\Confirm.inc:82) in C:\Inetpub\caincreativememories.com\gallery2\main.php on line 472

Just my luck. I had plenty of time to get this setup and working, but now I actually NEED it to work because I have pictures that I need to load for orders. I will try just doing the paypal part again, and skip the email and see if I get the same errors.

UPDATE: You probably know already, but it must be a problem in the main Checkout module. I removed the email one and got the same result. Is it possible to use your original module (1.4 I think) and just add the email one?

Thanks for all of your help.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-06-28 04:12

I just noticed, the very top of my page has the following error:

Notice: unserialize(): Argument is not a string in C:\Inetpub\caincreativememories.com\gallery2\modules\checkout\SelectProducts.inc on line 60

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Tue, 2005-06-28 06:48

littletechgirl- these errors are all showing up when I use empty variables in the templates - something that's been going on since before I started modifying this module. I think there must be some setting somewhere in your environment that's making an issue out of this now, else you would have seen the same problem with all the previous versions. The most likely place is in your php.ini, and I'd guess the most likely setting is display_errors (should be off). It may also be that your error_reporting value has become more liberal, so you're just seeing the errors now that were previously ignored.

I am working on getting rid of the problem, but it's quite deep-rooted throughout the module so it's not straightforward.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-06-28 13:20

You are a true genius. I HAD recently updated my PHP version, and it updated my php.ini file, and sure enough, that setting was turned on. I found and changed the display_errors to off, and it seems to be working great now. Thank you SOOOO much. I am going to put through a couple of test transactions and make sure that everything works.

turnbulm wrote:
littletechgirl- these errors are all showing up when I use empty variables in the templates - something that's been going on since before I started modifying this module. I think there must be some setting somewhere in your environment that's making an issue out of this now, else you would have seen the same problem with all the previous versions. The most likely place is in your php.ini, and I'd guess the most likely setting is display_errors (should be off). It may also be that your error_reporting value has become more liberal, so you're just seeing the errors now that were previously ignored.

I am working on getting rid of the problem, but it's quite deep-rooted throughout the module so it's not straightforward.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-06-28 13:37

Okay, hopefully the last error. This is probably something with my config too. When I process the order (via email) I get:

Error Detail -
Error (ERROR_UNKNOWN) : Could not send mail to 

    * in C:\Inetpub\caincreativememories.com\gallery2\modules\core\classes\helpers\MailHelper_simple.class at line 89 (gallerystatus::error)
    * in C:\Inetpub\caincreativememories.com\gallery2\modules\core\classes\GalleryCoreApi.class at line 2505 (mailhelper_simple::sendtemplatedemail)
    * in C:\Inetpub\caincreativememories.com\gallery2\modules\checkoutemail\Email.inc at line 169 (gallerycoreapi::sendtemplatedemail)
    * in C:\Inetpub\caincreativememories.com\gallery2\main.php at line 183 (emailcontroller::handlerequest)
    * in C:\Inetpub\caincreativememories.com\gallery2\main.php at line 87
    * in C:\Inetpub\caincreativememories.com\gallery2\main.php at line 78

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Tue, 2005-06-28 14:22

littletechgirl- I'm just using Gallery's standard email methods. I'd suggest you go and do whatever's necessary to test email in the core module configuration. Once that's working, then the PayPal module should also work... hopefully...

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2005-06-28 16:08

Okay, I fixed my mail issues. It was a combination of the gallery mail settings and settings on my server.

Let me say that this ROCKS!!! I LOVE the way the mail comes through with the thumbnails, etc. Job very very well done.

:)

THANK YOU THANK YOU THANK YOU!!!

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Tue, 2005-06-28 17:23

I do too... the way email come through with wonderfully formatted information is fantastic. This eliminates soooooooooooooo many steps for a photographer to get a file to a printer.

This module REALLY rocks.

drhiii

littletechgirl wrote:
Okay, I fixed my mail issues. It was a combination of the gallery mail settings and settings on my server.

Let me say that this ROCKS!!! I LOVE the way the mail comes through with the thumbnails, etc. Job very very well done.

:)

THANK YOU THANK YOU THANK YOU!!!

 
youpi

Joined: 2005-06-17
Posts: 35
Posted: Thu, 2005-06-30 08:21

hi, i get this error :

Quote:
Notice: Undefined offset: 1 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 2 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 3 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 4 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 5 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 6 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined offset: 7 in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 65

Notice: Undefined index: paper in c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc on line 72

Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\gallerietest\gallery2\modules\checkout\Confirm.inc:65) in c:\program files\easyphp1-8\www\gallerietest\gallery2\main.php on line 460

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Thu, 2005-06-30 15:08

youpi- you are seeing the same problem that littletechgirl was seeing earlier. I am working on fixing it, but it's quite a job. For now though, check your php.ini file and make sure that display_errors is set to 'off'. That will prevent these non-critical errors from being displayed in the browser.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Thu, 2005-06-30 19:13

Just as an FYI, I let a couple of artists take a peek at this module. To say they got energized was an understatement. Wanted to mention it to add energy to this.

Turnbulm, this mod really does rock. And I know it is not a simple thing either. Thank you...

 
turnbulm

Joined: 2004-10-03
Posts: 431
Posted: Thu, 2005-06-30 20:12

drhiii- it's actually quite enjoyable when I get a chance to work on this. And, having worked something like 50 hours in the last 4 days, I get to take a day off tomorrow!! Which means a whole day of coding!

Here's hoping I can get a release out to fix the unassigned variables issue...