In Ofbiz order payments require both “authorize” and “capture” records in Payment gateway Response to consider a payment “SETTLED”.
By default Ofbiz calls only the 'Authorize' payment service during the Order Confirmation process and calls the 'Capture' payment settings service on Order Completion.
Certain payment gateway configurations will have authorize and capture calls in a single
service.
For example, the SagePay-Token, can automatically authorize and
capture and create the needed Ofbiz entity records (Payment Gateway
Response) all in a single service call.
In this scenario on order confirmation the order is Approved whilst the order payment is SETTLED.
Other Payment Gateway configurations will have the authorize and capture calls in separate services.
For example PayPal Express Token.
The authorize service authorizes and creates authorize payment gateway
response.
The capture service captures the authorized transaction and creates the capture gateway response. In this scenario, (since the capture service is called on order complete), on order confirmation the order is Approved whilst the order payment is AUTHORIZED.
However, a client might want to authorize and capture on order confirmation even
though the payment gateway is not configured to do such.
To meet this requirement (authorize and capture on order confirm) the BigFish
checkout flow is configured to call a method (autoCapturePayments
'note: Bigfish service') as a final step after the order has been
confirmed (Approved) by the customer.
This method checks order payments for an 'Authorized' (PAYMENT_AUTHORIZED); if found then 'capture' the authorized payment by calling the payment settings 'Capture' service.
Note:
This autoCapturePayments method is called as a final step in the check
out flow;
if current payment gateway config is set to authorize and capture when autoCapturePayments is called there are no longer order payments to Authorize, therefore the method simply returns.
This all works fine except for the scenario where the payment gateway config
only authorizes and the client does NOT want to capture on order confirm.
If this is required then some code changes may be required to disable to “Capture” service call