Jump to content

Question

Posted

When invoices go out, they aren't reflecting the client's autodebit setting. In other words, they never say "Auto debit is enabled for your account, so we'll automatically process the card you have on file on..."

Where have I gone wrong? Autodebit is working, the invoice goes out and is automatically paid as expected.

 

Here is my invoice template:

Hi {contact.first_name},

An invoice has been created for your account and is attached to this email in PDF format.
{% for invoice in invoices %}Invoice: #{invoice.id_code}
Invoice Total: {invoice.total | currency_format invoice.currency}
Balance Due: {invoice.due | currency_format invoice.currency}

{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted}.{% endif %}{% endif %}

Pay Now
{% endfor %}
If you have any questions about your invoice, please let us know!

2 answers to this question

Recommended Posts

  • 0
Posted
6 hours ago, katycomputer said:

When invoices go out, they aren't reflecting the client's autodebit setting. In other words, they never say "Auto debit is enabled for your account, so we'll automatically process the card you have on file on..."

Where have I gone wrong? Autodebit is working, the invoice goes out and is automatically paid as expected.

 

Here is my invoice template:

Hi {contact.first_name},

An invoice has been created for your account and is attached to this email in PDF format.
{% for invoice in invoices %}Invoice: #{invoice.id_code}
Invoice Total: {invoice.total | currency_format invoice.currency}
Balance Due: {invoice.due | currency_format invoice.currency}

{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted}.{% endif %}{% endif %}

Pay Now
{% endfor %}
If you have any questions about your invoice, please let us know!

Here' is the default conditional for the auto debit message:

{% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner.{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at http://{client_url} to set up auto debit.{% endif %}

It looks like you just removed the else statement, so it'll either show that message or nothing. I'd suggest putting something in between the autodebit and invoice.autodebit_date_formatted conditionals as a test to see if it is output, which will show whether autodebit is boolean true.

We have a task - https://dev.blesta.com/browse/CORE-2770 which is designed to catch cases where auto-debit is enabled but there is no account set for auto-debit. I don't think this is related to your issue.

The only other thing I would suggest is to try toggling auto-debit off and back on. If the value is not set for some reason, it may appear on anyway. If you toggle off and back on, it will ensure the setting is present.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...