anddd the implementation's finally done, hehe.
ngl, this was an actual heck of a mess (thnx to Sonnet 5.5)
the dynamic calculations had to account for so many combinations of installments, discounts, concessions n additional charges, as well as keepin the whole thing configurable per tenant
then there's the merchant routing, Razorpay integration, webhook handling, payment verification, duplicate payment scenarios, receipts n all that jazz
staging n the last couple of flow tests now...
@amrxlogsbeen workin' on a pretty interesting payment infra for a multi-tenant product.
- every tenant here has its own pay structures, installments, discounts, concessions, penalties n additional charges
so the entire payment calculation logic needs to be kinda dynamic
- payments can then be routed either through a central merchant account or directly through each tenant's own merchant account, all configurable without changing the underlying integration though
- plus all the stuff around the whole transaction lifecycle, refunds, payment verification, duplicate payment handling as well as keeping everything properly isolated across tenants
and ofc, making sure the entire thing is secure
fun architecture tbh...