How LinkedIn taught its payment router to pick a gateway
In January 2023 a LinkedIn team described how it stopped splitting subscription renewals between payment gateways by fixed ratios. A cheap logistic regression now picks the gateway, trained on logs reweighted so the old split does not bias it. LinkedIn reports a statistically significant lift in approvals, without giving one overall number.

When a subscription renewal fails, the customer just finds the service suspended. Some of those failures are avoidable: the same charge might have passed at another payment gateway. On 25 January 2023 Xianyun Mao, Stan Xu, Rachit Kumar, Vikas R, Xia Hong and Divyakumar Menghani of LinkedIn described how they replaced a rule-based router with a model that picks the gateway for each renewal.
The problem: a fixed split for a moving target
Premium, Talent Solutions and Sales Navigator renew monthly or yearly, and "LinkedIn usually has two or more payment gateways to choose from". A gateway is the company that passes the charge on to the card network and the banks.
The old engine chose by ratio. Rules on country, currency, product and card type set a split, and each payment went randomly by it. The post's example: "ads payments in the US are routed to gateway A and gateway B in a 40-60 split." But "the static rules failed to capture the temporal changes in approval rate across gateways", and "We had over 100 rules in the rule-based routing engine, and updating them manually was intractable and error-prone."
LinkedIn retries a failed renewal at another gateway or later, but if nothing works "the service will be suspended and might eventually be canceled." The aim was fewer of those cases "caused by avoidable payment gateway failures."
How they built it
Routing as classification. The team chose to "predict the best payment gateway using transaction parameters" with supervised learning. With K gateways the model has K+1 classes: one for each gateway that approved, plus failure. Failure is ignored at prediction time, since "failure is not an action", and the top-scoring gateway gets the charge.
Fix the bias in the logs. The training data comes from the old router, so a gateway that got more traffic shows more approvals, even if it approves less often. In the post's toy example, redrawn above, gateway A gets 40% of traffic and approves 75%; gateway B gets 60% and approves 60%. Count approvals as they are and B wins, 36,000 to 30,000. The fix is inverse probability weighting: resample so each gateway contributes the same number of transactions. With 50,000 each, A leads 37,500 to 30,000. In production each gateway got two million resampled rows: "J* was 2,000,000 in our model."
In our reading, this works because the old router was random. Each segment sent some traffic to every gateway, so the logs hold a fair sample of each. A router that always sent a segment to one gateway would leave nothing to learn from.
A small model. Five inputs: transaction type, card type, payment instrument type, product family and card network. It was trained and deployed in the US only. The model is a multiclass softmax logistic regression, chosen "because of low serving cost."
Test it against the rules. "Engineers bifurcated the existing routing logic into two routing engines", one on the rules and one on the model, and ran an A/B test. After launch, "the model refresh was based on the routing data since the previous model update."
What it delivered
All results are LinkedIn-reported. The one claim: "The payment approval rate of the model-based engine showed statistically significant lift." There is no overall number for the lift, the approval rate or the size of the test.

Over four weeks, most daily points sit between zero and one percentage point. On most days the error bar crosses zero, so the significance must come from the test as a whole; the post does not say how.
There is no comparison with simply re-tuning the old ratios, so we cannot tell how much of the gain is the model and how much is replacing a stale split. Cost and fraud are not measured.
Next on the team's list were a cost target, issuing banks as an input, and bandits, since "MAB has great potential to learn from non-stationary settings".
What has changed since
We found no follow-up from LinkedIn on its engineering blog.
The bandit idea became a product feature. Checkout.com launched Intelligent Acceptance in June 2023, and its docs say "It uses multi-armed bandit algorithms to balance acceptance, cost, and fraud." Results are measured against "a small portion of them unoptimized as a control group". An August 2023 paper with live tests on the payments of Dream11, a fantasy sports platform, reports a bandit router that "consistently improves the success rate of transactions by 0.92% compared to the traditional rule-based methods over one month."
A warning arrived too. A 2024 paper from Adyen studies payment models retrained, generation after generation, on data their earlier versions collected. That is LinkedIn's refresh loop. It finds "subsequent generations may perform worse due to shifts in the reward distribution and increased class imbalance in the training data." Once the model sends nearly everything to one gateway, the next training set has almost no data on the other, and no reweighting can invent it.
Fixed splits are still sold as a feature: in Spreedly's docs, "An A/B Test step splits traffic across gateways by percentage".
Why it matters for your business
In Indonesia cards are a small part of online checkout. Worldpay figures quoted by Antom say: "Digital wallets lead at 42%, bank transfers 34%, cash/COD 13%, credit cards 5%". The same page elsewhere says about 7%, so treat it as a rough guide. For most shops, card routing touches a thin slice of sales. For subscriptions, SaaS, travel and foreign buyers, that slice matters.
Card approval is far from solved. Midtrans writes that "the rate of success for credit card payment is roughly around 70% - 80%". DOKU's docs say Indonesian online card payments are "usually required additional security from issuer Bank, called 3D Secure (3DS)." Some declines are failed authentication, which no choice of gateway will fix.
The Midtrans, Xendit and DOKU docs we read describe no merchant-controlled routing across gateways, so a merchant usually integrates two gateways itself. Domestic debit is another matter: Bank Indonesia's PBI 19/8/PBI/2017 says "Setiap transaksi pembayaran domestik wajib diproses melalui GPN (NPG)." Our reading is that gateway choice matters mostly for credit and foreign cards; check with counsel.
The lesson is not the logistic regression. It is to keep some randomness in the router, log every attempt, and correct for how the data was collected before learning from it.
How we would build it today

- Measure your mix. Split last quarter's payments by method and outcome. If cards are 5% of revenue, fix the checkout first.
- Two gateways for cards, not ten. A primary and a secondary, each with its own acquiring bank.
- Start with weights and a kill switch. A fixed split like LinkedIn's 40-60, and one switch to move everything when a gateway goes down.
- Fail over once. Retry on the other gateway for timeouts and gateway errors, never for a hard decline. Idempotency keys stop double charges.
- Log every attempt. Gateway, outcome, decline code, BIN, issuer, network, card type, 3DS result, amount, time. This is your training data.
- Never stop exploring. Every gateway keeps 5% to 10% of traffic in every segment, our pick. Without it, the Adyen feedback loop sets in.
- Learn simply. A daily table of approval rate per segment beats a fixed split. Move to a bandit when rates drift fast, or a small model like LinkedIn's when you must explain each choice.
- Keep a control group. A fixed share stays on the old rules. By our arithmetic, seeing a half-point lift at 75% approval takes over 100,000 attempts per group.
- Count cost and fraud. Track fee per approved payment and fraud rate next to approval.
- Leave the national rails alone. QRIS, virtual accounts and domestic debit need monitoring, not a model.
With a few thousand card payments a month, steps 1 to 5 are the whole job. The model can wait for the volume.