Order API - Custom CGI and ShopSite Receipt Problem

This is an archive of old posting to the User Forum

Order API - Custom CGI and ShopSite Receipt Problem

Postby Chris Eaves » Fri Jul 18, 2003 1:20 pm

Hope someone out there can help me with this little problem.

We have created a custom perl script to auto-add members to a client's
mailing list on checkout using the Order API. Problem is, the script must
return the content type header (Content-type: text/html) or an Apache Server
error is returned.

But, after the content type header is returned from our script, another one
is returned for the ShopSite Receipt page. This second one ends up being
visible in the browser window.

We have both the 'Email receipts to buyer, merchant?' and 'Screen receipt
for buyer?' options selected on the Order API page.

Anyone run into an issue like this? Or have any ideas on how we could either
have the script run silently and produce no output without causing an error
(it runs fine from the command line that way) or get ShopSite to not display
a duplicate content type header?

I know we could create a complete custom receipt page and that would solve
the problem, but we do not have approval from the client for the additional
hours that would take.
Chris Eaves
 

Re: Order API - Custom CGI and ShopSite Receipt Problem

Postby loren_d_c » Fri Jul 18, 2003 3:34 pm

I have created custom scripts for the Order API that do not produce output to
the browser and have never experienced this problem. It is likely an issue with
the script. Try a simple test script that doesn't really do anything, like this:

#!/usr/bin/perl

1;

If this works as the custom cgi for the Order API feature without the problem
you mention, then examine your mailing list script again and see if you can find
an issue there.

-Loren



Chris Eaves wrote:

Hope someone out there can help me with this little problem.

We have created a custom perl script to auto-add members to a client's
mailing list on checkout using the Order API. Problem is, the script must
return the content type header (Content-type: text/html) or an Apache Server
error is returned.

But, after the content type header is returned from our script, another one
is returned for the ShopSite Receipt page. This second one ends up being
visible in the browser window.

We have both the 'Email receipts to buyer, merchant?' and 'Screen receipt
for buyer?' options selected on the Order API page.

Anyone run into an issue like this? Or have any ideas on how we could either
have the script run silently and produce no output without causing an error
(it runs fine from the command line that way) or get ShopSite to not display
a duplicate content type header?

I know we could create a complete custom receipt page and that would solve
the problem, but we do not have approval from the client for the additional
hours that would take.
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Order API - Custom CGI and ShopSite Receipt Problem

Postby Rob » Fri Jul 18, 2003 8:05 pm

Put this line of code as the last one in your custom order API script:

print "<!-- ";

That'll supress the "Content-type:" line I believe on the receipt page.

Rob

But, after the content type header is returned from our script, another
one
is returned for the ShopSite Receipt page. This second one ends up being
visible in the browser window.
Anyone run into an issue like this? Or have any ideas on how we could
either
have the script run silently and produce no output without causing an
error
(it runs fine from the command line that way) or get ShopSite to not
display
a duplicate content type header?
Rob
 

Re: Order API - Custom CGI and ShopSite Receipt Problem

Postby loren_d_c » Sat Jul 19, 2003 8:23 am

You shouldn't have to do this, your script should be able to run without
printing anything to the browser. But if you do do this, not only will
it comment out the ShopSite content-type, it will also comment out the
entire HEAD section and the BODY tag of the HTML page, so you would have
to print those out from your script as well.

-Loren



Rob wrote:
Put this line of code as the last one in your custom order API script:

print "<!-- ";

That'll supress the "Content-type:" line I believe on the receipt page.

Rob


But, after the content type header is returned from our script, another

one

is returned for the ShopSite Receipt page. This second one ends up being
visible in the browser window.
Anyone run into an issue like this? Or have any ideas on how we could

either

have the script run silently and produce no output without causing an

error

(it runs fine from the command line that way) or get ShopSite to not

display

a duplicate content type header?


loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Order API - Custom CGI and ShopSite Receipt Problem

Postby Rob » Mon Jul 21, 2003 11:12 am

Sorry about that. I thought the person using the order API script was
already outputting to the screen with an image. That's what I get for
reading too quickly :)

My solution does work well if you are outputing an image or code to the
receipt as well, as that supresses the headers like Loren said.

Rob

"Loren" <loren_d_c@yahoo.com> wrote in message
news:bfbnpp$2ig$1@support.shopsite.com...
You shouldn't have to do this, your script should be able to run without
printing anything to the browser. But if you do do this, not only will
it comment out the ShopSite content-type, it will also comment out the
entire HEAD section and the BODY tag of the HTML page, so you would have
to print those out from your script as well.

-Loren



Rob wrote:
Put this line of code as the last one in your custom order API script:

print "<!-- ";

That'll supress the "Content-type:" line I believe on the receipt page.

Rob


But, after the content type header is returned from our script, another

one

is returned for the ShopSite Receipt page. This second one ends up being
visible in the browser window.
Anyone run into an issue like this? Or have any ideas on how we could

either

have the script run silently and produce no output without causing an

error

(it runs fine from the command line that way) or get ShopSite to not

display

a duplicate content type header?



Rob
 


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 60 guests