Re-populating the shopping cart based on a form POST
The Get Contents From Form server behavior takes the data passed back from the merchant gateway and uses it to re-populate the shopping cart.
Currently, only PayPal is supported directly in eCart for re-population of shopping cart contents in this manner. PayPal's Instant Payment Notification (IPN) service posts not only the high level information for the transaction, but the line item details contained within the shopping cart. When the Get Contents From Form server behavior is run on the page, it correlates the line item details with the appropriate columns in the shopping cart.
Since the information for each cart column is available on the return post, the contents of the shopping cart can be re-created once that data has returned.
A custom option is available to configure support for gateways not directly supported in eCart.
The configure button allows you to correlate information returned to columns within the shopping cart specific to the type of POST returned by IPN. This data can be used for a shopping cart display for an order receipt, maintaining the shopping cart contents if a transaction fails, or even inserting shopping cart contents into the database.
Re-population of the shopping cart is triggered by a specified event on the page.
Currently, only PayPal is supported directly in eCart for re-population of shopping cart contents in this manner. PayPal's Instant Payment Notification (IPN) service posts not only the high level information for the transaction, but the line item details contained within the shopping cart. When the Get Contents From Form server behavior is run on the page, it correlates the line item details with the appropriate columns in the shopping cart.
Since the information for each cart column is available on the return post, the contents of the shopping cart can be re-created once that data has returned.
A custom option is available to configure support for gateways not directly supported in eCart.
The configure button allows you to correlate information returned to columns within the shopping cart specific to the type of POST returned by IPN. This data can be used for a shopping cart display for an order receipt, maintaining the shopping cart contents if a transaction fails, or even inserting shopping cart contents into the database.
Re-population of the shopping cart is triggered by a specified event on the page.
To apply the Get Contents From Form server behavior:
- Open the page that will receive the POST from your merchant gateway.
- In the Server Behaviors panel, click the plus button and select eCart > Add to Cart > Get Contents From Form
The Get Contents From Form dialog opens:
- Select the trigger on the page that will run the server-side code for this server behavior.
- Select the shopping cart name that correlates to the eCart Object specific to your shopping cart implementation.
- Select the IPN configuration specific to your needs from the list available.
- If necessary, click Configure to modify the given IPN configuration specific to your needs.
The following shows the default configuration for PayPal available for re-populating the cart.
Specialized server-side code is provided for the ID, Name, Quantity, and Price columns. This code takes the line item details information, extracts values specific to line items, and correlates them to the given columns. - Click OK.
The server behavior is applied to the page.