The Shopspray plugin needs instructions on how to do certain things within your application. These include:
- How to get a Person/User based on username in your solution
- Get an Organization that a Person/User belongs to.
- Where to get certain pieces of information from your solutions' OrderCarrier model.
- How to login a ucer
To give the plugin these instructions you need to implement certain interfaces that are exposed by the plugin under the Shopspray.PunchOut.Core.External namespace. These include the following interfaces:
Responsible for giving the plugin information on how to identify users and their organizations - howerer your solutions' customer model may look like.
Responsible for mapping your relevant Order data to a generic structure that the plugin uses.
Responsible for common actions that the plugin performs but can't assume how they should be done in your solution, actions like log in and logout.
- (Optional) IOrderRequestService
If you intend to use the plugin as a way to give your customers the option to place orders directly through the cXML Order Requests specification - then this provides you the ability to work with the data they pass in that request to create proper orders according to your solutions' needs.
The end goal for a punchout user session is not to place an order but rather to Post Back cart line item data to their procurement system. This means that many features that you might have on your checkout page bears little relevance to your punchout users. The bare minimum you need is to ensure that they have some mechanism to return to their procurement system but it's a good idea to remove as much from the checkout as possible for punchout users to reduce confusion.
- Your "Place Order" button needs to be removed and replaced with a button that returns the punchout user to their procurement system. This is technically done by calling the endpoint:
- Remove payment selection
- Remove delivery method selection
- Remove address inputs
- Remove any other Checkout elements that require user input but won't affect the final data being posted back to the users procurement system.
- If your checkout normally consists of several steps, consider bypassing steps to let punchout users "Post back" during their first checkout step. Assuming that you can adjust that step to be able to give a good overview of the cart.