Scheduled Batch Jobs
  • 13 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Scheduled Batch Jobs

  • Dark
    Light

You can see our scheduled jobs in Setup - Jobs - Scheduled Jobs. All of our job names start with Blackthorn | Payments.

Here is a list of batch jobs we schedule once you complete the Setup Wizard and when you click the Schedule Recommended Payment Jobs button on the Blackthorn | Payments Admin tab. The names in bold below will be shown in Salesforce Setup - Jobs - Scheduled Jobs if they're scheduled.

Change to Schedule Recommended Payment Jobs

For existing users, clicking Schedule Recommend Payment Jobs will no longer trigger the “Blackthorn | Payments Transaction Rollup To Parent” scheduled job. You will need to click the new Schedule Transaction Rollup to Parent Job button.

Some of these jobs can be run manually whenever you want from the Blackthorn | Payments Admin tab. You can also schedule batch jobs to run.

  • Blackthorn | Payments Balance Update - runs nightly @ 2:00am - Updates Stripe available and pending balances for all Payment Gateways and Connect Accounts.
  • Blackthorn | Payments Billing Balance Rollup - runs nightly @ 4:00am - Updates balances on Invoices (Blackthorn Invoices and Stripe Invoices) from related and captured Transactions.
  • Blackthorn | Payments Daily Captures - runs nightly @ Midnight - Processes scheduled charge transactions with a Due Date = TODAY.
  • Blackthorn | Payments Daily Captures(Authorized) - runs nightly @ Midnight - Processes scheduled authorized transactions with Due Date = TODAY.
  • Blackthorn | Payments Daily Refunds - runs nightly @ 2:00am- Processes scheduled refund transactions with Due Date = TODAY.
  • Blackthorn | Payments Log Record Cleanup - runs nightly @ Midnight - Deletes Blackthorn Log records that were created 30 or more days ago. If you have a large number of Blackthorn Log records to delete immediately, you can execute this code in the Salesforce Developer Console. It will keep records created in the last 5 days and delete everything else - you may have to execute this code multiple times - it only deletes 10k records at a time:
Integer daysToKeep = 5;
bt_stripe.BlackthornLogService.deleteOldBlackthornLogRecords(daysToKeep);
  • Blackthorn | Payments Set Payout - runs nightly @ 4:00am - Connects Completed Payout records with related Charge and Transfer (Stripe Connect) records.
  • Blackthorn | Payments Webhook Record Cleanup - runs nightly @ Midnight - deletes successfully processed Webhook Event records.
  • Blackthorn | Payments Webhook Record Processing @ 0 - runs at the top of each hour and also schedules a new job to run 5 minutes after the last batch run finishes - processes Webhook Event records.
  • Blackthorn | Payments Transaction Rollup To Parent - runs every 30 mins to update the Transaction's summary to the Transaction's parent objects. This includes Payouts, Captures, Transfers, and Refunds on the parent record.
For new installs, the following changes were made to the “Blackthorn | Payments Transaction Rollup To Parent” scheduled job.
  • After installing Payments, the "Blackthorn | Payments Transaction Rollup To Parent" scheduled job will no longer be automatically scheduled.
  • To opt-in to the “Blackthorn | Payments Transaction Rollup To Parent” scheduled job, the Payments Admin will need to go to the Blackthorn | Payments Admin page and click the Schedule Transaction Rollup to Parent Job button.
  • If Disable Trans Rollup to Parent is set to “True” in Blackthorn Pay - Trigger Settings and “Blackthorn | Payments Transaction Rollup To Parent” is scheduled, then real-time rollups do NOT run, but the scheduled batch job DOES run every hour to process rollups.

NOTE: For existing users, clicking Schedule Recommend Payment Jobs will no longer trigger the “Blackthorn | Payments Transaction Rollup To Parent” scheduled job. You will need to click the new Schedule Transaction Rollup to Parent Job button.

The following batches will be schedule if Blackthorn Pay - Features custom setting has the Connect Valid Through with a future date

  • Blackthorn | Payments Daily Payouts - runs nightly @ 1:00am - Processes Payout transactions.
  • Blackthorn | Payments Daily Transfer - runs nightly @ 1:00am - Processes transfers(Stripe Connect only).

The following batches will be schedule if Blackthorn Pay - Features custom setting has the Billing Valid Through with a future date. (Stripe Billing batches)

  • Blackthorn | Payments Send Stripe Invoices - runs nightly @ 6:00am - to send invoices for all the Invoices which are in draft status, Billing Method is "Send Invoice" and Send Invoice On Date is the current date.
  • Blackthorn | Payments Past Due Invoices - runs nightly @ 5:00am - to update the Invoice's status to Past Due for the Stripe invoices whose due date is past that are not paid.

What's Next