Batch Processor - FAQ

1. How do I start or stop the  Batch Processor

Click on the Merchant Facility Tab

Select "All Merchant Facilities"

Click into the Primary and Active Merchant Facility

1.2. Start/Stop the Batch Processor

The Batch Payments Processors section is about 1/4 of the way down the screen.

  • Press the Button "START" to Start.  Note, after starting, the label changes to STOP.
  • If already started, press the "STOP" button to stop.  Note, after stopping, the label changes to START.
2. How do I check for and cancel duplicate Batch Processors running?
  • Click on the setup cog (top right)
  • Search "Scheduled Jobs" and click into Scheduled Jobs
How to setup Sites Sharing Settings | Payments2Us Installation Manual | Manuals - Mozilla Firefox

2.2. Look for duplicate job names beginning with "batchPaymentsProcessor" and delete

  1. Sort current jobs by Job Name
  2. Check to see if there are multiple scheduled jobs with the name starting with "batchPaymentsProcessor".
  3. ONLY IF THERE IS MULTIPLE. Press Del for each processor.  Make sure you do the next step of restarting the batch processor.

2.3. Restart Batch Processors

See procedure: How do I start or stop the Batch Processor and START the Batch Payments Processor.

3. How to I remove Phantom Batch Processors?

3.1. Phantom Batch Processor Introduction

On rare occasions, a Batch Processor may get stuck in a processing status of Queued.  This seems to occur when Salesforce has done upgrades.  

Symptoms of this happening are when Payment Txn Status's get stuck in Receipting Complete Status and the Batch Processor status on the Merchant Facility is showing as running.

From version 7.7 onwards, an Error Log is created indicating this condition exists.

Apart from Payment Txn's staying at a status of "Receipting Complete", another indication of Phantom or Duplicate Batch Processors can be seen up setup > Search "Apex Jobs".  In this screen, if you observe the "batchProcessor" job NOT showing "Completed" status and ONLY Aborted Status, then that is sign that phantom or duplicate Batch Processor jobs issue exists. NOTE: Aborted Status and "Completed" status showing is NORMAL and all is ok.

The below screenshot shows the issue.

3.2. Check for duplicates

Before continuing with this procedure, first check to see if multiple processors are currently scheduled.  If they are, you can simply stop those and all should be ok.  If you are still observing issues or getting error reports after that, then continue with this procedure.

See procedure: How do I check for an cancel duplicate Batch Processors running.

3.3. Stop the Batch Processors

See procedure How do I start or stop the Batch Processor on how to STOP the Processors

3.4. Query Phantom Batch Processor Jobs from Developer Console

3.4.1. Open the Developer Console

  • Top right click on the settings cog
  • Followed by Developer Console
Phantom Batch Processors.docx - Word

3.4.2. Run query on Batch Processors

  1. Click on the query tab.
  2. Paste “SELECT Id,Status,JobType,ApexClass.Name,CreatedDate,LastProcessed,JobItemsProcessed,NumberOfErrors FROM AsyncApexJob WHERE (JobType IN ('BatchApex','ScheduledApex') AND status IN ('Holding', 'Queued', 'Processing', 'Preparing') AND ApexClass.Name IN ('batchProcessor') AND ApexClass.NameSpacePrefix = 'AAkPay')”  into the query
  3. Then press Execute
  4. Double click into the Id Cell.  Copy the ID.
  5. NOTE, you will need to repeat Step Execute code to Abort Phantom Job for each row.  NOTE Press the Execute (step 3) button each time Batch Processor Id's might change in the time it takes you to do the other steps.
SELECT Id,Status,JobType,ApexClass.Name,CreatedDate,LastProcessed,JobItemsProcessed,NumberOfErrors FROM AsyncApexJob WHERE (JobType IN ('BatchApex','ScheduledApex') AND status IN ('Holding', 'Queued', 'Processing', 'Preparing') AND ApexClass.Name IN ('batchProcessor') AND ApexClass.NameSpacePrefix = 'AAkPay')
Phantom Batch Processors.docx - Word

3.5. Developer Workbench

3.5.1. Login to Developer Workbench

3.5.2. Select API Version 31

Click on the top link with the user + company + version No.

Phantom Batch Processors.docx - Word

Select Version 31

Phantom Batch Processors.docx - Word

3.5.3. Run Apex Code to Abort Phantom Jobs

  • Select "Apex Execute" from the Utilities Menu
  • Press Next button
Phantom Batch Processors.docx - Word
3.5.3.1. Execute code to Abort Phantom Job
  1. Copy “system.abortjob('7074Q00007LyJwe'); “
  2. Change “7074Q00007LyJwe” to the id that was copied from Step 3 above.
  3. Press Execute
  4. Repeat for each Id in Step Run query on Batch Processors.  
    NOTE, you should press the EXECUTE button (as in the Run query on Batch Processors step) again as the Id's might have changed in the time you've taken to do these updates.  
    Continue to repeat until there are no Id's left from the query.
system.abortjob('7074Q00007LyJwe');
Phantom Batch Processors.docx - Word

3.6. Restart Batch Processors

See procedure How do I start or stop the Batch Processor on how to START the Processors

3.7. I keep getting the following error: Please investigate this error.Program/Area: batchProcessor.statusUpdateSubject: Database.update(paymentTxnList)Description: The new owner must have read permission. The owner on the Payment Txn has the correct access, what is causing this?

1. Check the Payment Form used by the Payment Txn. see which user is in the Donor Care field

2. On the user, give them the Payments2Us Admin permission set. See Step No. 5 here on how to assign permission sets.