Order API - Reconstructing Shopping Cart after Credit Card D

This is an archive of old posting to the User Forum

Order API - Reconstructing Shopping Cart after Credit Card D

Postby Ian Scorer » Sun Jan 09, 2005 12:49 am

Hello,

I'm using the Order API as a mechanism by which to use a payment
processing gateway that is not supported by ShopSite.

I intend to use Perl and a combination of the CGI and LWP modules to
create a new HTTP request which will pass the necessary values from the
Checkout page to my payment processor and in turn handle the response
that comes back from the payment processor (authorize, decline etc).

Though I'm pretty new to Perl, I've already written a script that works
with the Shipping API in order to achieve something similar so I'm
comfortable about this part of the process.

I have both the "Email receipts to buyer, merchant" and "Screen receipt
for buyer" options unchecked in the Order API configuration options
inside ShopSite Admin. I have done this as I intend to handle this side
of things from my custom Perl CGI.

So, if the credit card transaction is authorized, then all is well and
good. I can transfer the customer to a thank you page (or output one
from Perl) and email both the customer and myself (as the merchant) the
necessary confirmation emails.

However, if the credit card transaction is declined, or there is a
problem with the payment processing gateway itself (it could not be
contacted, or returns an internal error), I somehow need to rebuild the
shopping cart and give my customer the opportunity to try again.

This is what I'm not sure how to achieve.

I can see that there are various places in which data surrounding the
order is stored, cookies and HTTP POST name/value pairs, and I can get
access to all of these via my PERL CGI script, but I can't seem to find
all the order line item details, and even if they were there, what would
I do with them? I would guess that the shopping basket is stored in the
backend database and referenced by an ID stored in one of the
client-side cookies, but that's just a guess...

I'm not even sure if it's possible to achieve what I'm trying to
achieve, although I really really hope it is. I guess that ShopSite
needs to cater for declines from supported payment processing gateways
somehow, but perhaps the same thing can't be done via the Order API...

Anyway, I'm hoping someone out there can help me in some way.

Kind regards,

Ian Scorer

P.S. Using ShopSite 7.1.2
Ian Scorer
 

Re: Order API - Reconstructing Shopping Cart after Credit Ca

Postby loren_d_c » Sun Jan 09, 2005 1:33 pm

The Order API will pass your custom cgi all of the product data from the
order, however there is no way to recostruct the shopping cart. The
Order API is only executed AFTER an order has been completed as far as
ShopSite is concerned, so it does not lend itself well to being a custom
'payment gateway' api. Some have used it this way, but have had to
accept the drawbacks that are that 1) the order is completed in ShopSite
before you ever send your request to the gateway (regardless of the
response you get from the gateway), so the order WILL appear in ShopSite
even if the gateway declines it, 2) there is also no way to insert any
data that may be the result of your payment gateway request into the
ShopSite order, since it is already complete at that point, and 3) once
the order is completed, the shopping cart data is removed and there is
no way to recreate that shopping cart data.

See the following ShopSite Knowledgebase articles for additional info:
http://support.shopsite.com/kbase/view_ ... nID=S04012
http://support.shopsite.com/kbase/view_ ... nID=S03755

-Loren



Ian Scorer wrote:

Hello,

I'm using the Order API as a mechanism by which to use a payment
processing gateway that is not supported by ShopSite.

I intend to use Perl and a combination of the CGI and LWP modules to
create a new HTTP request which will pass the necessary values from the
Checkout page to my payment processor and in turn handle the response
that comes back from the payment processor (authorize, decline etc).

Though I'm pretty new to Perl, I've already written a script that works
with the Shipping API in order to achieve something similar so I'm
comfortable about this part of the process.

I have both the "Email receipts to buyer, merchant" and "Screen receipt
for buyer" options unchecked in the Order API configuration options
inside ShopSite Admin. I have done this as I intend to handle this side
of things from my custom Perl CGI.

So, if the credit card transaction is authorized, then all is well and
good. I can transfer the customer to a thank you page (or output one
from Perl) and email both the customer and myself (as the merchant) the
necessary confirmation emails.

However, if the credit card transaction is declined, or there is a
problem with the payment processing gateway itself (it could not be
contacted, or returns an internal error), I somehow need to rebuild the
shopping cart and give my customer the opportunity to try again.

This is what I'm not sure how to achieve.

I can see that there are various places in which data surrounding the
order is stored, cookies and HTTP POST name/value pairs, and I can get
access to all of these via my PERL CGI script, but I can't seem to find
all the order line item details, and even if they were there, what would
I do with them? I would guess that the shopping basket is stored in the
backend database and referenced by an ID stored in one of the
client-side cookies, but that's just a guess...

I'm not even sure if it's possible to achieve what I'm trying to
achieve, although I really really hope it is. I guess that ShopSite
needs to cater for declines from supported payment processing gateways
somehow, but perhaps the same thing can't be done via the Order API...

Anyway, I'm hoping someone out there can help me in some way.

Kind regards,

Ian Scorer

P.S. Using ShopSite 7.1.2
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Order API - Reconstructing Shopping Cart after Credit Ca

Postby Ian Scorer » Sun Jan 09, 2005 8:22 pm

Hi Loren,

Thank you very much for your quick response, and my apologies, I should
have checked the Knowledge Base first.

For a variety of reasons it is not possible for me to use a supported
payment gateway so I'm left with trying to build the best shop possible
under those circumstances.

I fully accept that I can do nothing to change the order which will be
generated by ShopSite itself, however my back-office staff can deal with
that side of things, I'm just trying to make the shopping experience as
user-friendly for my customers as possible.

The last thing I want to do is waste your time Loren, but I'm going to
ask this question since it is not specifically addressed in your answer
below.

If I COULD obtain all the data associated with the shopping cart, would
it be possible for me to recreate the shopping cart itself after a
decline from my payment gateway?

My thought is that all the logic would be handled inside a Perl script
called as the Order API, but that it could reference data created by a
script called as the Shipping API.

The Shipping API is called each time the shopping cart is recalculated
and certainly when the checkout button is hit, so at that stage,
couldn't I write the data associated with the shopping cart out to a
cookie (or an independent database) ready for retrieval should my
customers credit card be declined?

The real question I guess is can I then feed that data back to a
ShopSite CGI in order to re-create the checkout page (or even view cart
page)?

Thank you for your time and consideration.

Regards,

Ian Scorer



Loren wrote:
The Order API will pass your custom cgi all of the product data from the
order, however there is no way to recostruct the shopping cart. The
Order API is only executed AFTER an order has been completed as far as
ShopSite is concerned, so it does not lend itself well to being a custom
'payment gateway' api. Some have used it this way, but have had to
accept the drawbacks that are that 1) the order is completed in ShopSite
before you ever send your request to the gateway (regardless of the
response you get from the gateway), so the order WILL appear in ShopSite
even if the gateway declines it, 2) there is also no way to insert any
data that may be the result of your payment gateway request into the
ShopSite order, since it is already complete at that point, and 3) once
the order is completed, the shopping cart data is removed and there is
no way to recreate that shopping cart data.

See the following ShopSite Knowledgebase articles for additional info:
http://support.shopsite.com/kbase/view_ ... nID=S04012
http://support.shopsite.com/kbase/view_ ... nID=S03755

-Loren



Ian Scorer wrote:

Hello,

I'm using the Order API as a mechanism by which to use a payment
processing gateway that is not supported by ShopSite.

I intend to use Perl and a combination of the CGI and LWP modules to
create a new HTTP request which will pass the necessary values from
the Checkout page to my payment processor and in turn handle the
response that comes back from the payment processor (authorize,
decline etc).

Though I'm pretty new to Perl, I've already written a script that
works with the Shipping API in order to achieve something similar so
I'm comfortable about this part of the process.

I have both the "Email receipts to buyer, merchant" and "Screen
receipt for buyer" options unchecked in the Order API configuration
options inside ShopSite Admin. I have done this as I intend to handle
this side of things from my custom Perl CGI.

So, if the credit card transaction is authorized, then all is well and
good. I can transfer the customer to a thank you page (or output one
from Perl) and email both the customer and myself (as the merchant)
the necessary confirmation emails.

However, if the credit card transaction is declined, or there is a
problem with the payment processing gateway itself (it could not be
contacted, or returns an internal error), I somehow need to rebuild
the shopping cart and give my customer the opportunity to try again.

This is what I'm not sure how to achieve.

I can see that there are various places in which data surrounding the
order is stored, cookies and HTTP POST name/value pairs, and I can get
access to all of these via my PERL CGI script, but I can't seem to
find all the order line item details, and even if they were there,
what would I do with them? I would guess that the shopping basket is
stored in the backend database and referenced by an ID stored in one
of the client-side cookies, but that's just a guess...

I'm not even sure if it's possible to achieve what I'm trying to
achieve, although I really really hope it is. I guess that ShopSite
needs to cater for declines from supported payment processing gateways
somehow, but perhaps the same thing can't be done via the Order API...

Anyway, I'm hoping someone out there can help me in some way.

Kind regards,

Ian Scorer

P.S. Using ShopSite 7.1.2
Ian Scorer
 

Re: Order API - Reconstructing Shopping Cart after Credit Ca

Postby loren_d_c » Mon Jan 10, 2005 9:55 am

"If I COULD obtain all the data associated with the shopping cart, would
it be possible for me to recreate the shopping cart itself after a
decline from my payment gateway?"

As I said before, the Order API will already give you all of the
shopping cart info, no need to use the shipping api to get it (and the
shipping api doesn't get nearly the amount of info that the Order API does).

But, also as I mentioned before, your script cannot manually recreate a
shopping cart file. You could try using the data from the Order API to
recreate the order buttons for the individual products and then do a
series of redirects to get all those items in the cart, but I don't know
if that will work.

-Loren





Ian Scorer wrote:
Hi Loren,

Thank you very much for your quick response, and my apologies, I should
have checked the Knowledge Base first.

For a variety of reasons it is not possible for me to use a supported
payment gateway so I'm left with trying to build the best shop possible
under those circumstances.

I fully accept that I can do nothing to change the order which will be
generated by ShopSite itself, however my back-office staff can deal with
that side of things, I'm just trying to make the shopping experience as
user-friendly for my customers as possible.

The last thing I want to do is waste your time Loren, but I'm going to
ask this question since it is not specifically addressed in your answer
below.

If I COULD obtain all the data associated with the shopping cart, would
it be possible for me to recreate the shopping cart itself after a
decline from my payment gateway?

My thought is that all the logic would be handled inside a Perl script
called as the Order API, but that it could reference data created by a
script called as the Shipping API.

The Shipping API is called each time the shopping cart is recalculated
and certainly when the checkout button is hit, so at that stage,
couldn't I write the data associated with the shopping cart out to a
cookie (or an independent database) ready for retrieval should my
customers credit card be declined?

The real question I guess is can I then feed that data back to a
ShopSite CGI in order to re-create the checkout page (or even view cart
page)?

Thank you for your time and consideration.

Regards,

Ian Scorer



Loren wrote:

The Order API will pass your custom cgi all of the product data from
the order, however there is no way to recostruct the shopping cart.
The Order API is only executed AFTER an order has been completed as
far as ShopSite is concerned, so it does not lend itself well to being
a custom 'payment gateway' api. Some have used it this way, but have
had to accept the drawbacks that are that 1) the order is completed in
ShopSite before you ever send your request to the gateway (regardless
of the response you get from the gateway), so the order WILL appear in
ShopSite even if the gateway declines it, 2) there is also no way to
insert any data that may be the result of your payment gateway request
into the ShopSite order, since it is already complete at that point,
and 3) once the order is completed, the shopping cart data is removed
and there is no way to recreate that shopping cart data.

See the following ShopSite Knowledgebase articles for additional info:
http://support.shopsite.com/kbase/view_ ... nID=S04012
http://support.shopsite.com/kbase/view_ ... nID=S03755

-Loren



Ian Scorer wrote:

Hello,

I'm using the Order API as a mechanism by which to use a payment
processing gateway that is not supported by ShopSite.

I intend to use Perl and a combination of the CGI and LWP modules to
create a new HTTP request which will pass the necessary values from
the Checkout page to my payment processor and in turn handle the
response that comes back from the payment processor (authorize,
decline etc).

Though I'm pretty new to Perl, I've already written a script that
works with the Shipping API in order to achieve something similar so
I'm comfortable about this part of the process.

I have both the "Email receipts to buyer, merchant" and "Screen
receipt for buyer" options unchecked in the Order API configuration
options inside ShopSite Admin. I have done this as I intend to handle
this side of things from my custom Perl CGI.

So, if the credit card transaction is authorized, then all is well
and good. I can transfer the customer to a thank you page (or output
one from Perl) and email both the customer and myself (as the
merchant) the necessary confirmation emails.

However, if the credit card transaction is declined, or there is a
problem with the payment processing gateway itself (it could not be
contacted, or returns an internal error), I somehow need to rebuild
the shopping cart and give my customer the opportunity to try again.

This is what I'm not sure how to achieve.

I can see that there are various places in which data surrounding the
order is stored, cookies and HTTP POST name/value pairs, and I can
get access to all of these via my PERL CGI script, but I can't seem
to find all the order line item details, and even if they were there,
what would I do with them? I would guess that the shopping basket is
stored in the backend database and referenced by an ID stored in one
of the client-side cookies, but that's just a guess...

I'm not even sure if it's possible to achieve what I'm trying to
achieve, although I really really hope it is. I guess that ShopSite
needs to cater for declines from supported payment processing
gateways somehow, but perhaps the same thing can't be done via the
Order API...

Anyway, I'm hoping someone out there can help me in some way.

Kind regards,

Ian Scorer

P.S. Using ShopSite 7.1.2
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Order API - Reconstructing Shopping Cart after Credit Ca

Postby Ian Scorer » Tue Jan 11, 2005 7:55 am

Hi Loren,

I'm sorry, I misunderstood your first reply but I think I'm up to speed
now. Thank you again for your assistance.

Ian


Loren wrote:
"If I COULD obtain all the data associated with the shopping cart, would
it be possible for me to recreate the shopping cart itself after a
decline from my payment gateway?"

As I said before, the Order API will already give you all of the
shopping cart info, no need to use the shipping api to get it (and the
shipping api doesn't get nearly the amount of info that the Order API
does).

But, also as I mentioned before, your script cannot manually recreate a
shopping cart file. You could try using the data from the Order API to
recreate the order buttons for the individual products and then do a
series of redirects to get all those items in the cart, but I don't know
if that will work.

-Loren





Ian Scorer wrote:

Hi Loren,

Thank you very much for your quick response, and my apologies, I
should have checked the Knowledge Base first.

For a variety of reasons it is not possible for me to use a supported
payment gateway so I'm left with trying to build the best shop
possible under those circumstances.

I fully accept that I can do nothing to change the order which will be
generated by ShopSite itself, however my back-office staff can deal
with that side of things, I'm just trying to make the shopping
experience as user-friendly for my customers as possible.

The last thing I want to do is waste your time Loren, but I'm going to
ask this question since it is not specifically addressed in your
answer below.

If I COULD obtain all the data associated with the shopping cart,
would it be possible for me to recreate the shopping cart itself after
a decline from my payment gateway?

My thought is that all the logic would be handled inside a Perl script
called as the Order API, but that it could reference data created by a
script called as the Shipping API.

The Shipping API is called each time the shopping cart is recalculated
and certainly when the checkout button is hit, so at that stage,
couldn't I write the data associated with the shopping cart out to a
cookie (or an independent database) ready for retrieval should my
customers credit card be declined?

The real question I guess is can I then feed that data back to a
ShopSite CGI in order to re-create the checkout page (or even view
cart page)?

Thank you for your time and consideration.

Regards,

Ian Scorer



Loren wrote:

The Order API will pass your custom cgi all of the product data from
the order, however there is no way to recostruct the shopping cart.
The Order API is only executed AFTER an order has been completed as
far as ShopSite is concerned, so it does not lend itself well to
being a custom 'payment gateway' api. Some have used it this way,
but have had to accept the drawbacks that are that 1) the order is
completed in ShopSite before you ever send your request to the
gateway (regardless of the response you get from the gateway), so the
order WILL appear in ShopSite even if the gateway declines it, 2)
there is also no way to insert any data that may be the result of
your payment gateway request into the ShopSite order, since it is
already complete at that point, and 3) once the order is completed,
the shopping cart data is removed and there is no way to recreate
that shopping cart data.

See the following ShopSite Knowledgebase articles for additional info:
http://support.shopsite.com/kbase/view_ ... nID=S04012
http://support.shopsite.com/kbase/view_ ... nID=S03755

-Loren



Ian Scorer wrote:

Hello,

I'm using the Order API as a mechanism by which to use a payment
processing gateway that is not supported by ShopSite.

I intend to use Perl and a combination of the CGI and LWP modules to
create a new HTTP request which will pass the necessary values from
the Checkout page to my payment processor and in turn handle the
response that comes back from the payment processor (authorize,
decline etc).

Though I'm pretty new to Perl, I've already written a script that
works with the Shipping API in order to achieve something similar so
I'm comfortable about this part of the process.

I have both the "Email receipts to buyer, merchant" and "Screen
receipt for buyer" options unchecked in the Order API configuration
options inside ShopSite Admin. I have done this as I intend to
handle this side of things from my custom Perl CGI.

So, if the credit card transaction is authorized, then all is well
and good. I can transfer the customer to a thank you page (or output
one from Perl) and email both the customer and myself (as the
merchant) the necessary confirmation emails.

However, if the credit card transaction is declined, or there is a
problem with the payment processing gateway itself (it could not be
contacted, or returns an internal error), I somehow need to rebuild
the shopping cart and give my customer the opportunity to try again.

This is what I'm not sure how to achieve.

I can see that there are various places in which data surrounding
the order is stored, cookies and HTTP POST name/value pairs, and I
can get access to all of these via my PERL CGI script, but I can't
seem to find all the order line item details, and even if they were
there, what would I do with them? I would guess that the shopping
basket is stored in the backend database and referenced by an ID
stored in one of the client-side cookies, but that's just a guess...

I'm not even sure if it's possible to achieve what I'm trying to
achieve, although I really really hope it is. I guess that ShopSite
needs to cater for declines from supported payment processing
gateways somehow, but perhaps the same thing can't be done via the
Order API...

Anyway, I'm hoping someone out there can help me in some way.

Kind regards,

Ian Scorer

P.S. Using ShopSite 7.1.2
Ian Scorer
 


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 2 guests