How to schedule the batch job
a. Go to Developer Console, paste this code and click execute
Parameter:
o Settlement Id
o If the Settlement Id parameter is EMPTY, it will retrieve the latest Settlement where the Gateway Reconciliation Status is Unreconciled
o If the Settlement Id parameter is NOT empty, use the Settlement record stored in the Settlement parameter throughout the whole process.
Starting After :
...
Starting After parameter OR Settlement’s Starting After
...
When the scheduled batch runs
If there is an error in a batch, a PosiPay Log is created with a type of Error. Otherwise, if successful, the Settlement Record will be updated with the payout data.
...
Check the Payout summary if the Settlement record and its related created Gateway Transaction of the related list match the payout summary.
...
If the Reconciliation Balance is not equal to the Amount in the Settlement record, a PosiPay Log record is created.
...
If the Reconciliation Balance is equal to Amount in the Settlement record, the Gateway Reconciliation Status of the Settlement record is set to Reconciled.
PosiPay Logs will be created according to the created/updated Gateway Transactions link to the settlement record.
NOTE: Developer skill is required for this setup as we do not have the UI for scheduled processes yet.
Open the Developer Console > Debug > Open Execute Anonymous Window > paste the code below, and execute
Code Block | ||
---|---|---|
| ||
GatewaySettlementReconciliationBatch settlement = new GatewaySettlementReconciliationBatch();
String cronExp = '0 30 3 * * ?';
System.schedule('[PosiPay] Gateway Settlement Reconciliation', cronExp, settlement); |
For Testing only
If the above code doesn't work follow these steps :
Create a Screen Flow
Go to Setup > Flow > Click New Flow
...
Select Screen Flow and click Create.
...
Add Element and select Screen.
...
In the Components, click PosiPay Settings and fill in the Label and the API Name (auto-populated), then click Done.
...
After completing the flow, click Save and fill in the Flow Label and the Flow API Name will auto populate.
Flow Label: Gateway Settlement Schedule
Flow API Name: auto-populated once the Flow Label is input.
Next place to go: Step 7 - Set up Stripe Payment Flow