User Guide
Shopping Cart Reference 179
Insert [ShoppingCart] in [Recordset] when [button] is clicked
using OrderID from [HiddenFormElement] if [CyberCash]
transaction is success
This contract is an extension of the interaction to submit the Shopping cart
contents to a recordset using an OrderID from a Hidden Form Element. With an
additional participant - the CyberCash element - this contract allows you to
submit the cart contents if the Cybercash transaction was successful, otherwise the
cart won't be submitted. Because the cart is destroyed when it is inserted into the
database, this contract is useful for retaining the contents of a shopper's order if
the cybercash process was unsuccessful so that they can potentially rectify the
cause of the cybercash error and resubmit their order without having to repopulate
the shopping cart.
DrumNote_502 illustrates the use of the related Session version of this contract.
Note that this contract can be used in conjunction with contracts that generate an
OrderID needed for an OrderDetails record (such as the 'Insert order in
[recordset]...' and "Replace [token] in [target] with unique OrderID contracts).
When the button is clicked, the shopping cart data is inserted into the orders
database using the OrderID stored in the Hidden Form Element only if the
Cybercash transaction was successful, where each cart item is an 'order detail'.
Parameters:
OrderIDCol is the name of the OrderID column in the target recordset.
VariableName is the name of the ASP server variable that stores the OrderID
for the current shopping session
SuccessRedirect specifies the target page for redirecting after Cart contents are
successfully added to the database.
FailedRedirect specifies the target page for redirecting if the cart data was not
successfully inserted in the database. This allows you to display an error
message for the user so they'll know the order couldn't be placed.
Participants:
ShoppingCart
Recordset
CyberCash
HiddenFormElement
Button (any clickable object)