Refactor to return merchant_id