Process Scheduled Transactions and Reattempt Logic

Prev Next

Scheduled Batch Job to Process Scheduled Transactions

When you complete the Setup Wizard we schedule a Blackthorn | Payments batch jobs to run nightly. You can also manually run these batch job any time you want from the Blackthorn | Payments Admin tab.

If you fire a batch process to capture all the open Transactions and another batch process is already running, the second process will quietly fail. This way, protection against double-charges is implemented.

Process Scheduled Charge Transactions

There is a nightly scheduled batch job{target=_blank} that will automatically capture the charge Transactions.

Batch Job Name: Blackthorn | Payments Daily Captures

Those Transactions have to meet the following criteria to be processed:

  • Auto-Process checked
  • A valid Payment Method
  • Due Date or Date To Process = Less than or equal to Today
  • Transaction Status = "Open"
  • Currency ISO
  • Amount

The fields below are needed for Transfer Transactions (Stripe Connect) to be automatically processed:

  • Auto-Process checked
  • A valid Connected Account
  • Due Date or Date To Process = Less than or equal to Today
  • Transaction Status = "Open"
  • Currency ISO
  • Amount

Process Scheduled Refund Transactions

There is a nightly scheduled batch job that will automatically capture the refund Transactions.

Batch Job Name: Blackthorn | Payments Daily Refunds

Those Transactions have to meet the following criteria to be processed:

  • Auto-Process checked
  • Payment Method is the same as the original Transaction
  • Due Date or Date To Process = Less than or equal to Today
  • Transaction Status = "Open"
  • Transactions Type = "Refund"
  • Amount is negative
  • Original Transaction (if refund) = original Transaction
Custom automation that runs in the background

If your own automation creates or updates a Transaction from an asynchronous Salesforce context, a Batch job or a future method, Blackthorn does not process it. This applies to charges, refunds, captures, releases and metadata updates alike. The Transaction is saved and keeps its existing status, and no error is shown and nothing is written to the logs, so it looks like it simply never ran.

A common way to hit this is a Flow or Apex that sets the Refund checkbox while running inside a Batch job, for example from a post-registration form mapping. The refund Transaction stays in its unprocessed status indefinitely.

To work around it, move the update out of the asynchronous context. Publishing a Platform Event and doing the update in its subscriber is the usual approach, because the subscriber starts in a fresh context.

Reattempt Logic

The reattempt logic allows you to automate reattempted Transactions. A new Transaction record will automatically create from the reattempt logic if the original one fails. Out-of-the-box, Blackthorn | Payments enables reattempt logic for four reattempts, one day apart.

What Payment Gateway are you using?

Reattempt logic applies to Stripe, Authorize.net, and Spreedly payment gateways.

Automated Reattempts applies to Transactions with:

  • A Payment Method.
  • Auto-Process checked
  • Due Date equals or is less than TODAY.
  • Transaction Status = "Failed".

Customized your reattempt logic in custom settings.

Reattempt Logic Process

  • If the Transaction fails, a new Transaction is automatically generated with a Transaction Status = "Open".

  • The new Transaction is generated in a scheduled job under Blackthorn Payments | Daily Captures. If you want to change the frequency of when these jobs process, click Manage.

  • Each newly generated Transaction from the failed Transaction is related. On the original failed Transaction record, you'll see all of the reattempts in a related list and a field called Reattempt Number that auto-increases by 1 each time that original transaction is reattempted.

  • Based on the reattempt number, you can take action.

    Our recommendation: Create a Process Builder process whereby each criterion fires by an incremental Reattempt Number, such as

    • Reattempt #1, do nothing.
    • Reattempt #2, auto-fire an email template to the Payment Method email address with a PayLink so the customer can update their card.
    • Reattempt #3, create a Task for someone internal to follow-up, etc.
  • The reattempt logic should function whether the Transaction was initially auto-processed or processed in real time, as determined by the setting in Blackthorn Pay - Trigger Settings.

The full use case can be found here{target=_blank}.

Next Steps

Troubleshooting

If you have received an error with the auto-process and/or reattempt logic or have a question, please view our Troubleshooting{target=_blank} or FAQ{target=_blank} page. If you still have Default Payment Method questions, please contact Blackthorn Support. We're happy to help!