Skip to content
Hierarchy
i-love-midtrans.mdx

Migrating from Midtrans to Tripay: A Painful but Necessary Switch

Boy do I love MidTrans so much. Thanks MidTrans, very cool.

By Ahsan Azizan · · 2 min read

We integrated Midtrans into our app, built with the T3 Stack and tRPC, to handle payment processing. Then we moved all of it to Tripay, because Midtrans never delivered a working QRIS GoPay payment method, and QRIS GoPay was the one our client specifically required.

The original setup with Midtrans

The Midtrans implementation was solid. We even wrote our own npm wrapper around midtrans-node so it played nicely with TypeScript. It held the utility functions: signature generation, Snap transaction creation, and notification handling. All of it worked until the client asked for QRIS GoPay.

The GoPay QRIS problem

The Midtrans documentation and their customer service both told us that enabling QRIS GoPay was a matter of getting approval, and that approval takes 3 to 4 working days.

It took over a week before they responded at all. When they did, they could not give us a date, or any assurance that it would work for our account. Our client was losing patience and we had nothing to tell them.

The decision to migrate

We stopped waiting. A short evaluation turned up Tripay, which supports QRIS out of the box. Its approval and onboarding process is simpler and more transparent, and we had QRIS payments working almost immediately.

The migration pain

The hard part was undoing what we had built around Midtrans:

  • Throwing away our custom midtrans-node TypeScript wrapper.
  • Rebuilding the utility functions for signature verification, invoice creation, and callback handling.
  • Refactoring the backend tRPC procedures that called Midtrans' APIs.

Tripay's API is not a drop-in replacement. Its authentication and its callback structure are different enough that we reimplemented most of the logic.

Lessons learned

  1. Don't over-invest in an early integration. We built a lot on top of Midtrans before we had confirmed that every payment method we needed actually worked.
  2. Check the support response times before you commit. If a reply takes more than a few days, that is a red flag.
  3. Abstract the gateway from the start. If our interface had been gateway-agnostic, the migration would have been far cheaper. Name the field paymentGatewayTransactionId, not midtransTransactionId.

Final thoughts

Tripay has less name recognition than Midtrans, and it did the job. We went live with QRIS GoPay and met the client's requirement. The migration was no fun and it was the right call.

If you are in the same spot, make the switch. Just expect to refactor far more than you planned, especially if you never designed for gateway portability.