DROP PROCEDURE IF EXISTS floranet.order_confirm;

DELIMITER $$
$$

CREATE DEFINER=`root`@`localhost`PROCEDURE floranet.order_confirm(vCatalogueFk INT)
READS SQL DATA

BEGIN
/** Update order.isPaid field
 *  
 *  @param vCatalogueFk floranet.catalogue.id
 * 
 *  @returns floranet.order.isPaid
 */
	UPDATE `order`
		SET isPaid = TRUE,
			payed = NOW()
		WHERE catalogueFk = vCatalogueFk;

	SELECT isPaid
		FROM `order`
		WHERE catalogueFk = vCatalogueFk;
END$$
DELIMITER ;