<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sergey Koskov on Medium]]></title>
        <description><![CDATA[Stories by Sergey Koskov on Medium]]></description>
        <link>https://medium.com/@skoskov?source=rss-67a0d2ada982------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MpPCBjPXjZh9QSdMWXPq0Q.jpeg</url>
            <title>Stories by Sergey Koskov on Medium</title>
            <link>https://medium.com/@skoskov?source=rss-67a0d2ada982------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:56:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skoskov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Rule Engine for Payment Systems]]></title>
            <link>https://medium.com/@skoskov/a-rule-engine-for-payment-systems-54b78825feef?source=rss-67a0d2ada982------2</link>
            <guid isPermaLink="false">https://medium.com/p/54b78825feef</guid>
            <category><![CDATA[rule-engine]]></category>
            <category><![CDATA[anti-fraud]]></category>
            <category><![CDATA[payment-processing]]></category>
            <dc:creator><![CDATA[Sergey Koskov]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 17:16:13 GMT</pubDate>
            <atom:updated>2020-03-11T18:03:06.560Z</atom:updated>
            <content:encoded><![CDATA[<p>My name is Vladimir and I am a fintech software developer with 15 years of experience. I founded Reactive Pay two years ago and since then we develop solutions for the payment industry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*n1L2-JRJyXbyMcjsAnbN6A.jpeg" /><figcaption>Vladimir Kovalevskii, Founder and CEO at ReactivePay</figcaption></figure><p><strong>The problem.</strong></p><p>Once, when I was developing a payment system, I found myself faced with a problem of scalability and transaction performance in a core processing subsystem. Complicated aggregation queries and thorough database payment parameter checks (limits, IP ranges, amount of validation against turnover performance) were constantly occupying my database CPU as well as my middleware application resources. Breaking this down into pieces, folding in SaaS components, and making those a proper logic encapsulation was a developer’s nightmare. But even after addressing those, several major issues remained:</p><ul><li>Fast data lookup for tiny or small values/lengths (would only give me the customer’s revenue for the past two days or would show me how many payment attempts had been made from Germany or what were my bank card declined payment rate for the previous quarter). A quite complicated query needs to be performed to fetch one number only.</li><li>Fast decision-making/comparing algorithms based on that data (“OK, I’ve got a 600 USD invoice to pay from my EU bank card, so can I pay it or not? And if not, then what actions must I take?”)</li><li>Getting dynamic values for a parameter depending on incoming requests (“I want to collect a bigger fee for non-EU customers”)</li></ul><p>Usually, those tasks have a significant impact on system performance, and each requires multiple teams to develop distributed SaaS components, not to mention complicated specifications for each process and collecting requirements that are often vague and varying.</p><p>How can we narrow and nail down this problem? What if we had a flexible concept for each and every service component united under one name, one concept that could give industry flexibility/performance/scalability and simplicity in implementing it. Sort of semi-standard and development guidance or even a framework for building such subsystems in a complicated transaction flow environment such as a payment software solution.</p><p><strong>Concept/Solution.</strong></p><p>Reflecting back on my experience and constantly carrying on various experiments in coding, I came up with an idea of using a sort of rule engine where I have a solid rule that describes how to:</p><ul><li>Aggregate incoming request parameters</li><li>Calculate those parameters</li><li>Possibly lookup variations/scenarios depending on those parameters</li><li>Primitive call-to-actions on filter/rule triggering</li></ul><p>The rule could be divided into 2 sections, let’s call it “header” and “body” (taking those from HTML language specification), where the “Header” describes whether this particular rule matches incoming request parameters and body has several filters or any data that shall be returned if the rule matches the request. To perform fast rule lookup, we can use hashes, building them out of header params/values pairs and comparing them with those we built from the request.</p><p>When a request comes into service, we take its matching rules and add aggregated/calculated parameter values to pre-defined tables that are stored in the lightweight, small database so that we can easily fetch those values using hash lookup method based on those rules’ header parameters.</p><p>This looks flexible, reliable, transparent, and friendly to any modifications as well as fits most of the business processes that exist in complicated transacting environments such as payment systems.</p><p><strong>Rule engine.</strong></p><p>The rule engine is a basic module that stores rules in JSON format and provides the following operations:</p><ul><li>Rule storage in JSON formatted text</li><li>Rule parser and filter fetcher</li><li>Hash-based lookup module</li></ul><p>Currently, MongoDB is used as the main storage for both rules: aggregated values and counters, where each rule is mapped to the following data model:</p><ul><li>Header (header section value of rule JSON text)</li><li>Body (body section value of rule JSON text )</li><li>Comment (random comment for user-friendly search queries)</li><li>Hash (hash built out of header’s param/value pairs)</li><li>HashDescr (hash descriptor — a string represented as param/value for full-text search by param/value)</li></ul><p>Rule engine uses a simple hash lookup logic where we first build a list of hashes for the request parameters, then filter the rules using the hash property from rule dataset.</p><p>With this list of rules (request parameters matched), we can check the body section and perform actions that are defined within the body’s scope. For example, those could be represented as a list of filters that apply to the request (filter if the number of requests for the last 24 hours is more than 100).</p><p><strong>Definitions and rule syntax.</strong></p><p>Two major instances have to be defined in any system that uses ReactivePay Rule Engine (we call it Flexy):</p><ul><li>Definitions (JSON formatted value that contains definitions/mapping for incoming request parameters as well as aggregating and calculating logic for them)</li><li>Rules (Set of JSON formatted values that define actions/filters for incoming requests)</li></ul><p>Those values are usually set up using the admin panel, which is a simple UI for modifying both rules and definitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fawHoBPtgjYe091h" /></figure><p>Definitions can be represented as the major metadata descriptor for the incoming request. This metadata also contains information or prescriptions for the engine on how to calculate incoming data via the aggregation section: summarize or count parameter value. These types of definitions are reflected as counters in the database. They are used by the engine to facilitate filtering logic, for example, triggering a filter when the turnover for incoming transactions in a 1-day period is less than a value defined inside a rule’s body section.</p><p><strong>Hello world</strong></p><p>A simple example showing the concept of ReactivePay Rule Engine.</p><p>Consider that incoming HTTP requests: {data: “Hello world”}, must be limited by the number of 10 in 2 days period. Let’s build a simple definition and rule.</p><p>A definition should be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*TfuqxWd2FRShfcRYGbqZFw.png" /></figure><p>And we define a simple rule that will fire a filter trigger if it comes to a 10 in 2 days:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*MBXpmDLwvW2o7qCk0cC4Uw.png" /></figure><p>Once the number of requests hits 20 the system responds which filter and rule have fired.</p><p><strong>Use cases and live product applications</strong></p><p><strong>Flexy </strong>is a part of ReactivePay framework. It supports multiple geo parameters, currencies and a handful of payment attributes. We use it for several major tasks:</p><p>1) Fraud prevention, traffic filtering rule and limits — please find more at <a href="https://reactivepay-docs.readthedocs.io/en/latest/fraud.html">https://reactivepay-docs.readthedocs.io/en/latest/fraud.html</a></p><p>Source code: <a href="https://github.com/ReactivePay-Official/reactivepay-flexy-guard">https://github.com/ReactivePay-Official/reactivepay-flexy-guard</a></p><p>2) Dynamic fees and commission logic — please find more at <a href="https://reactivepay-docs.readthedocs.io/en/latest/usage.html#adjusting-commission">https://reactivepay-docs.readthedocs.io/en/latest/usage.html#adjusting-commission</a></p><p>Source code: <a href="https://github.com/ReactivePay-Official/reactivepay-flexy-commission">https://github.com/ReactivePay-Official/reactivepay-flexy-commission</a></p><p>3) Transaction request routing to a specific bank or payment gateway (beta now). Routes could be set for any number and combination of incoming request parameters.</p><p>ReactivePay Rule Engine shows great performance: 15 TPS running on one AWS c5.large. The average response time is 130 ms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*di4irIcrkWSBD_MZ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FXLkhyIlbTHFYyZX" /></figure><p><strong>Roadmap</strong></p><p>We are continuously developing Flexy. There are several major pieces we’re working on:</p><p>1) Scoring system: Decision-making and assessment system based on collected stats and historical data. Required changes in design:</p><ul><li>Implement statistical and historical entities in any combination of request parameters. For example: Collect stats about declined operations and their geo-distribution</li><li>Enhance the rule engine syntax and filter response with scoring and decision-making results such as statistical matching, average values, relative change, etc.</li></ul><p>2) Admin app UI redesign — to make it even easier to use, add webform-like templates</p><p>3) Machine learning with the support of major pattern and assessment algorithms</p><p>4) The interface for collecting data from external sources using pulling and pushing methods</p><h4>We invite fintech developers to try Flexy!</h4><p>This is a fast and flexible rule engine that you can use not only in fintech but also in e-commerce and telecom applications.</p><blockquote>If you like what you just read, please hit the the clap button and follow ReactivePay.</blockquote><blockquote>Visit our website for more info: <a href="https://reactivepay.com/">https://reactivepay.com/</a></blockquote><blockquote>ReactivePay on <a href="https://www.facebook.com/reactivepay/">Facebook </a>and <a href="https://t.me/reactivepay">Telegram</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54b78825feef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enter the mobile wallet]]></title>
            <link>https://medium.com/@skoskov/enter-the-mobile-wallet-9fd29a0eee1e?source=rss-67a0d2ada982------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fd29a0eee1e</guid>
            <category><![CDATA[payments-technology]]></category>
            <category><![CDATA[e-wallet]]></category>
            <category><![CDATA[fintech-startups]]></category>
            <category><![CDATA[mobilepay]]></category>
            <dc:creator><![CDATA[Sergey Koskov]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 11:22:32 GMT</pubDate>
            <atom:updated>2020-03-08T12:59:25.979Z</atom:updated>
            <content:encoded><![CDATA[<p>US consumers typically pay 13 bills per month* with the most common being mortgage, phone, insurance, auto payments, utilities, and tuition — *according to Bureau of Consumer Financial Protection. Today consumers pay bills via banks and direct billers sites.</p><p>But stemming from an increased preference for payments toward mobile wallets, such as Apple Pay, Google Pay, Samsung Pay, Venmo, Square (Cash), and Zelle, (used primarily for peer-to-peer or b2c payments), it is reasonable to expect that mobile wallets will become the go-to for ‘bill-pay’ as well.</p><p>The research indicates that in order to create a seamless mobile wallet, mobile-first bill-pay, the key players are partnering with Fintech’s.</p><p>In 2019 ApplePay partnered with Doxo, PayPal partnered with Paymentus, and at the start of 2020, Visa bought Plaid for $5.3B, all enabling new payment and bill-pay transaction flows.</p><p>And along with this thinking, they predict that monthly bill paying will be replaced by real-time payments.</p><p>US mobile wallet volume is set to swell from an estimated $662.3 billion in 2019 to an estimated $1.33 trillion in 2023 across mobile commerce, mobile P2P payments, and mobile proximity payments, according to eMarketer.</p><ul><li>Mobile proximity payments are set to grow the fastest, with an increase in contactless penetration and familiarity combined with a wide untapped addressable base giving it a boost.</li><li>Mobile P2P payments will represent the largest share of volume, with transactions exceeding $600 billion in 2023, thanks to rapidly increasing engagement from existing customers who will replace more cash transactions with digital providers.</li><li>Eight key players lead the mobile wallet market and have the best shot at obtaining primary wallet status as they expand to offer new payment types: Apple, Google, Samsung, Starbucks, Venmo, Zelle, Square Cash, and Amazon.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*98BzO9Br9tGdcfIw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fd29a0eee1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>