Here's the workflow you can implement to get this done -
- Configure webhooks in Chargebee.
- Once this is done, you'll receive "invoice_generated" webhook when an invoice is generated on your site.
- Now collect the invoice payment outside Chargebee
- Once the charge is collected, call the record an invoice payment API. This will move the invoice status to PAID.
So in this case, Chargebee and your gateway would function as separate entities, brought to work together using your API integration.