How PayU does proactive error monitoring for mobile SDKs -: - www.deekpay.com

How PayU performs proactive error monitoring of mobile SDKs -

contexts

PayU provides payment gateway solutions for online businesses, serving over 500,000 merchants and supporting over 150 payment methods. It is the payment partner of choice for e-commerce merchants, including all major e-commerce companies and most airlines.

PayU has a number of mobile SDKs that play a critical role in the payment functionality of merchant applications. Our main goal is to make merchant integration on the PayU platform as simple and seamless as possible with minimal effort.

Below we talk about how we built the PayU Crash Reporter SDK and integrated it into all of our SDK products for an early fix strategy.

Statement of the problem

PayU distributes the SDK through public repositories (e.g. Maven Central, Cocoa Pods) and businesses integrate it into their applications. When a crash occurs in our codebase, the crash information is logged on the merchant's crash tool dashboard and then communicated to us later. We are not able to monitor crashes in real time. Debugging took longer as it was not always easy to get the required debugging information from the merchant dashboard. Sometimes we had trouble parsing the stack trace due to missing SDK version information and corresponding mapping files.

explorations

We tried to solve this problem using multiple products on the market (e.g. Crashlytics, ACRA, BugSnag), but none of them were plug-and-play.

Here's why we can't fix the problem:

It is technically impossible to have multiple of these solutions in a single application at the same time because all of them need to be configured with a unique ID at the application level. these products do not support library modules and are limited to project use at the application level.

We found an open source solution, Sentry, that solves the above problems. Sentry has an SDK product that fulfils our main goal of monitoring SDK crashes, but it also poses some challenges:

Bulky: The Sentry SDK is about 1000KB in size, as it provides many other features that we are not interested in, such as health monitoring, NDK crash reporting, and so on.

Data control: We wanted to have tighter control over the data because the Sentry SDK captures a lot of data points that are not important to us. This also led to an inflated payload size.

final approach

We developed our own PayU Crash Reporter SDK (based on Sentry) to address the above issues.The PayU Crash Reporter SDK registers a global exception handler to parse the stack trace and only reports crashes that occur within the PayU SDK. High-frequency events are then incorporated into our sprint cycles or resolved as hot fixes, creating a more stable SDK.

PayU Crash Reporter SDK Flow

PayU Crash Reporter SDK Dashboard

Size: About 40 KB, 1/25th of the size of the Sentry SDK. we reduced the size by removing all unnecessary features.

Data Control: Report only essential fields such as library version, transaction ID, details of all modules in the merchant application and stack trace to simplify debugging.

Stability: The PayU crash reporter is written entirely in Kotlin and uses modern practices (such as coprocessing) to mitigate network calls and improve stability.

Extensibility: The PayU Crash Reporter SDK is designed to be used by all of our SDK products for crash monitoring.

go from strength to strength

With the PayU Crash Reporter SDK integrated into all SDKs, we are able to provide a smooth and stable experience for over 150 merchants.

In a recent example, one of our top e-commerce companies with millions of daily active users had a poor customer experience when our SDK crashed when device memory was low. We found and fixed this issue in the early release phase of the app using the PayU Crash Reporter SDK.

In addition to this, frequent crashes observed by the PayU Crash Reporter SDK at runtime (e.g. unhandled exceptions, numeric format exceptions, illegal parameter exceptions, null pointer exceptions, etc.) were immediately fixed in subsequent versions of the corresponding SDK.

Everything you need to get started

You can check out the various payment SDKs offered by PayU for a seamless payment experience - for both Android and iOS.

For any integration related support, please contact your Key Account Manager or email [email protected].