If you want to post payments automatically to the Payment Providers, the Scheduled Payment flag needs to be enabled as 'True' on the Payment Methods list.

 Additionally, within the "Payment Gateway Setting" action in the ribbon, the Scheduled Pmt. Jnl. Template Name and the Scheduled Pmt. Jnl. Batch Name needs to be set to confirm what journal you want Business Central to use when scheduling these payments.  

 

Job Queue Entry

To schedule and post the payment automatically, you need to create a "Job Queue Entry Card".  This needs to point to the right 'Codeunit', ID '9030519. When you are ready with the setup set the Status to 'Ready'.

 

Any payments due for the selected scheduled payment (i.e. any posted sales invoices with the payment method which has Scheduled Payment ticked for and is due) will be processed by the Job Queue. The Job Queue will process any scheduled payments where the Next Payment Date is 'today' and the Status is 'ready' on the "Scheduled Payment" card. More information on this is below.

 

Scheduled Payment Card

The Scheduled Payment can be set for the combination from the General Tab (Account Type, Account No., Payment Method Code, Currency Code, Cardholder No., and Payment Card). Populate all the fields to set up the scheduled payment for the required Customer. 

You can specify the first date for the payment in the First Payment field and the Frequency specifies if the payment is recurring and therefore the frequency of the next payment.

The Next Payment Date Formula specifies the date formula for the payment recurrence to calculate the Next Payment date.

The Final Payment specifies the final payment, i..e the end date for the scheduled payments.

 

Run the scheduled payment manually once in the foreground from the Scheduled Payment Card with the Process Payment action.

 

If the Job Queue fails (Status is 'Error') after the payment is taken, then you can use the Show Error to see the actual error and check the created lines with the Open Journal Batch action.

 

You must resolve any issues and post the Cash Receipt Journal manually, otherwise risk talking double payments if you run the job again.

The Status then needs to be set to 'Ready again and wait for the next batch run.

You can see the "Scheduled Payment Log Entries" by using the Log Entries action.

 

Payment Gateway Log

After the "Sales Order" is posted the "Payment Gateway Log" is automatically created. The payment is taken against the journal line which is then applied to one or many source documents. The transaction uses the Default Payment Cardholder’s details.