Require subscription price to be positive number

This commit is contained in:
silverpill 2022-09-18 23:33:43 +00:00
parent a1ab21a702
commit dd6317561e

View file

@ -121,6 +121,9 @@ pub async fn register_subscription_option(
let monero_config = config.blockchain()
.and_then(|conf| conf.monero_config())
.ok_or(HttpError::NotSupported)?;
if price == 0 {
return Err(ValidationError("price must be greater than 0").into());
};
let payment_info = MoneroSubscription {
chain_id: monero_config.chain_id.clone(),
price,