From Fragile to Future-Proof: Solving Web Monetization Chaos with Payment Systems That Scale

Bookmark
Rate this content

What happens when 'just integrate Stripe/Adyen/Revolut' isn't enough? As platforms grow, payments turn from a simple integration into a complex web of gateways, compliance, and strategy conflicts. This talk is for anyone who's hit scaling pain. I'll walk through the hard lessons from moving millions through fragmented systems, and show how treating payments as orchestration, not a feature, can unlock real growth. No fluff, just the realities of building monetization systems that scale.

This talk has been presented at JSNation US 2025, check out the latest edition of this JavaScript Conference.

FAQ

The outage resulted in an estimated loss of $5,000 to $10,000 in lost subscriptions.

The main topic was about monetization and integrating scalable payment systems into frontend systems, specifically within the React framework.

SmallPDF experienced an outage with Braintree when an API key was mistakenly removed, resulting in a loss of integration and causing all payments to fail.

The Braintree outage lasted for approximately 12 hours, from 9pm to 10am.

Supporting local payment methods is important because it can significantly increase conversion rates by offering users familiar and frictionless payment options.

Payment orchestration is the management of multiple payment providers to optimize transactions for cost, speed, and reliability. It reduces reliance on a single provider and allows for better handling of downtime and regional payment preferences.

Payment orchestration offers benefits like increased uptime, higher conversion rates, and reduced transaction fees by optimizing payment methods per country and using multiple providers.

SmallPDF introduced Alipay as a payment method for users in China, which led to a 3.5x increase in annual recurring revenue.

SmallPDF uses anomaly detection and payment orchestration to quickly reroute payments to alternate providers, reducing downtime from hours to minutes.

Dynamically loading payment gateway code reduced SmallPDF's bundle size by 70%, optimizing the platform's performance.

Faris Aziz
Faris Aziz
29 min
20 Nov, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Introduction to Web Monetization and Payment Systems at SmallPDF with a Focus on Braintree Integration Issues. Challenges of Braintree Integration and Subscription Processing Impacting SmallPDF's Operations. Struggles with Global Payment Systems and Localization Impact on SaaS Platforms. Optimizing Local Payment Methods for Global Impact. Managing Compliance Challenges in Global Payments. Managing Global Payment Challenges. Managing Payment Risks and Uptime. Payment Orchestration for Enhanced Reliability. Front End Payment Orchestration. Handling Multiple Payment Gateways and SDKs. Rules Configuration for Payment Gateways and Scaling Benefits. Dynamic Payment Methods Based on Country and A-B Testing. Fast Detection of Payment Anomalies and Easy Gateway Rerouting

1. Web Monetization and Payment Systems

Short description:

Introduction to Web Monetization and Payment Systems at SmallPDF with a Focus on Braintree Integration Issues.

Hey, everyone. Thank you for coming to my JS Nation talk. I'm really excited to be introducing a topic that's been really close to my heart the past couple of years, and it's about monetization and how to bring payment systems that scale to your frontend systems. And today, we're going to be talking a little bit about how to bring that into the realm of React. And the talk is specifically called From Fragile to Future Proof, How Do You Solve for Web Monetization Chaos with Payment Systems That Scale?

And the way I like to start this is a little bit with a story time. And so I work at SmallPDF. And SmallPDF is a platform where we've got tens of million users per month and we process payments in multiple different countries across the globe. And so with one of the payment providers that we have, and one of those providers is called Braintree, we had an outage a couple of months ago. And in that outage, we actually just lost the integration with Braintree because one of our API keys was removed by mistake.

And when those API keys was removed, all of a sudden we started receiving a bunch of 401 errors, and we didn't know what was going on, and every single payment was failing. And Braintree essentially helped us process all of our PayPal and credit card payments in the majority of our countries. So that means that no users were able to process any payments, create any subscriptions, because we were heavily reliant on Braintree as a processing system. And so that's really chaotic. And this issue happened really, really late at night, and it took really long to figure it out. So that took long for the alerting system to tell us something that was going on.

2. Challenges of Subscription Processing

Short description:

Challenges of Braintree Integration and Subscription Processing Impacting SmallPDF's Operations.

And so when we have a platform that's running 24 seven, and something starts going wrong, things start getting bad pretty quickly. So this is actually a screenshot from our TrackJS dashboards. This is the equivalent of your Sentry dashboard, which uses a different platform for that. And you can see that all of a sudden, there's a massive spike, a spike in these Braintree token fetch errors. And that's exactly those errors that we're facing because the API key was removed. And that lasted for a long period of time. And it was really hard to discern anomalies, because there was so much of the sea of errors and logs coming through, it was very hard to be able to determine what was going on.

Moving forward, you can see over here in our data doc dashboard, there's now a log for the amount of subscriptions that we create. And that same amount of time, that same slot of time, where we saw all those errors climb up with TrackJS, you can now see that all the subscription creations tacked. And so it shows the direct correlation where the errors happening meant that we weren't able to process subscriptions. That makes sense. Now you'll see that there's still some small spikes over there. That still show we were able to process some subscriptions. And I'll show you why that's the case. Because Braintree wasn't the only gateway we're using at the time, we're also using Adgen and some other gateways to process some other payments. But it still wasn't the majority of our volumes, we saw massive tank.

Now how bad was this incident? It lasted from 9pm till 10am. So working hours, right? It was actually, yeah, clearly after working hours, we all work Swiss times in small PDF, the main office is based in Zurich. And so people are probably in the middle of their dinner time or getting ready for bed. And whoever received that alert was not having a great night. If you're good at math, that translates to around about 12 hours of downtime, which is no small amount of time. So for 12 hours, nobody was able to create a subscription. And beyond that, that translates to five to $10,000 in lost subscriptions. That's no small amount of money. And we're going to explore something that's gonna change that.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.
A Framework for Managing Technical Debt
TechLead Conference 2023TechLead Conference 2023
35 min
A Framework for Managing Technical Debt
Top ContentPremium
Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
A Practical Guide for Migrating to Server Components
React Advanced 2023React Advanced 2023
28 min
A Practical Guide for Migrating to Server Components
Top Content
Watch video: A Practical Guide for Migrating to Server Components
React query version five is live and we'll be discussing the migration process to server components using Next.js and React Query. The process involves planning, preparing, and setting up server components, migrating pages, adding layouts, and moving components to the server. We'll also explore the benefits of server components such as reducing JavaScript shipping, enabling powerful caching, and leveraging the features of the app router. Additionally, we'll cover topics like handling authentication, rendering in server components, and the impact on server load and costs.
Monolith to Micro-Frontends
React Advanced 2022React Advanced 2022
22 min
Monolith to Micro-Frontends
Top Content
Microfrontends are considered as a solution to the problems of exponential growth, code duplication, and unclear ownership in older applications. Transitioning from a monolith to microfrontends involves decoupling the system and exploring options like a modular monolith. Microfrontends enable independent deployments and runtime composition, but there is a discussion about the alternative of keeping an integrated application composed at runtime. Choosing a composition model and a router are crucial decisions in the technical plan. The Strangler pattern and the reverse Strangler pattern are used to gradually replace parts of the monolith with the new application.
Power Fixing React Performance Woes
React Advanced 2023React Advanced 2023
22 min
Power Fixing React Performance Woes
Top Content
Watch video: Power Fixing React Performance Woes
This Talk discusses various strategies to improve React performance, including lazy loading iframes, analyzing and optimizing bundles, fixing barrel exports and tree shaking, removing dead code, and caching expensive computations. The speaker shares their experience in identifying and addressing performance issues in a real-world application. They also highlight the importance of regularly auditing webpack and bundle analyzers, using tools like Knip to find unused code, and contributing improvements to open source libraries.

Workshops on related topic

Building a Shopify App with React & Node
React Summit Remote Edition 2021React Summit Remote Edition 2021
87 min
Building a Shopify App with React & Node
Top Content
Workshop
Jennifer Gray
Hanna Chen
2 authors
Shopify merchants have a diverse set of needs, and developers have a unique opportunity to meet those needs building apps. Building an app can be tough work but Shopify has created a set of tools and resources to help you build out a seamless app experience as quickly as possible. Get hands on experience building an embedded Shopify app using the Shopify App CLI, Polaris and Shopify App Bridge.We’ll show you how to create an app that accesses information from a development store and can run in your local environment.
Build a chat room with Appwrite and React
JSNation 2022JSNation 2022
41 min
Build a chat room with Appwrite and React
Workshop
Wess Cope
Wess Cope
API's/Backends are difficult and we need websockets. You will be using VS Code as your editor, Parcel.js, Chakra-ui, React, React Icons, and Appwrite. By the end of this workshop, you will have the knowledge to build a real-time app using Appwrite and zero API development. Follow along and you'll have an awesome chat app to show off!
Hard GraphQL Problems at Shopify
GraphQL Galaxy 2021GraphQL Galaxy 2021
164 min
Hard GraphQL Problems at Shopify
Workshop
Rebecca Friedman
Jonathan Baker
Alex Ackerman
Théo Ben Hassen
 Greg MacWilliam
5 authors
At Shopify scale, we solve some pretty hard problems. In this workshop, five different speakers will outline some of the challenges we’ve faced, and how we’ve overcome them.

Table of contents:
1 - The infamous "N+1" problem: Jonathan Baker - Let's talk about what it is, why it is a problem, and how Shopify handles it at scale across several GraphQL APIs.
2 - Contextualizing GraphQL APIs: Alex Ackerman - How and why we decided to use directives. I’ll share what directives are, which directives are available out of the box, and how to create custom directives.
3 - Faster GraphQL queries for mobile clients: Theo Ben Hassen - As your mobile app grows, so will your GraphQL queries. In this talk, I will go over diverse strategies to make your queries faster and more effective.
4 - Building tomorrow’s product today: Greg MacWilliam - How Shopify adopts future features in today’s code.
5 - Managing large APIs effectively: Rebecca Friedman - We have thousands of developers at Shopify. Let’s take a look at how we’re ensuring the quality and consistency of our GraphQL APIs with so many contributors.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
0 To Auth In An Hour For Your JavaScript App
JSNation 2023JSNation 2023
57 min
0 To Auth In An Hour For Your JavaScript App
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.js backend + Vanilla JS frontend) to authenticate users with One Time Passwords (email) and OAuth, including:
- User authentication – Managing user interactions, returning session / refresh JWTs- Session management and validation – Storing the session securely for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.