DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `hedera`.`tpvTransaction_confirmById`(vOrder INT)
BEGIN
/**
 * Confirma manualmente una transacción espedificando su identificador.
 *
 * @param vOrder Identificador de la transacción
 */
	DECLARE vAmount INT;
	DECLARE vMerchant INT;
	DECLARE vCurrency INT;

	SELECT amount, merchantFk, currency
		INTO vAmount, vMerchant, vCurrency
			FROM tpvTransaction t
			JOIN tpvMerchant m ON m.id = t.merchantFk
			JOIN tpvConfig c
				WHERE t.id = vOrder;

	CALL tpvTransaction_confirm(
		 vAmount
		,vOrder
		,vMerchant
		,vCurrency
		,0
		,NULL
	);
END$$
DELIMITER ;
