//
// Express checkout for the specified item. The Shop that is specified must be
// associated with a Remote Payment Service Provider (PSP). The redirect URL 
// should point to a page that generates the PSP HTML form.
//
// Parameters:
//
//  -   itemId: ID of the item that should be checked out.
//  -   shopId: ID of the shop that should handle the purchase.
//  -   successPath: The user will be redirected to this path upon successful submission.
//  -   failurePath: The user will be redirected to this path upon failed submission.
//
function captureSingleItem(itemId, shopId, successPath, failurePath) {

    // Construct the Checkout URL.
    if (itemId != '') {
        var servletPath = '/servlet/remote_single_item_capture';
        var url = servletPath + '?itemId=' + itemId + '&shopId=' + shopId + '&successPath=' + successPath + '&failurePath=' + failurePath;
        document.location.href = url;
    }
}


