Email informing that the order was paid but it was not

I have a problem, an email is being sent to the customer when the order is being processed, but the customer has not paid yet and an email is sent as if the customer had already paid, via notification to the customer > order confirmation, I think that the variable is not being treated correctly, I don’t know if it’s because I use the Yampi checkout, but it doesn’t make sense, because the status of the order appears on Shopify, that it hasn’t been paid yet… and I can’t check the variable

It sends thanks for the purchase as if it had already been paid and there are these ifs to deal with when there is no confirmation of payments

{% if has_pending_payment %} {% if buyer_action_required %} You will receive a confirmation email after completing the payment. {% else %} Payment is being processed, and you will receive an email when your order is confirmed. {% endif %} {% else %}

It seems like he’s not getting into any situation