<?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 Subomi Oluwalana on Medium]]></title>
        <description><![CDATA[Stories by Subomi Oluwalana on Medium]]></description>
        <link>https://medium.com/@subomiOluwalana?source=rss-f1c4f94ee134------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*q3xWGTshRfDigwQNa1tSeA.png</url>
            <title>Stories by Subomi Oluwalana on Medium</title>
            <link>https://medium.com/@subomiOluwalana?source=rss-f1c4f94ee134------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:35:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@subomiOluwalana/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[Introducing Convoy]]></title>
            <link>https://medium.com/frain-technologies/introducing-convoy-4a7c1e220fd9?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a7c1e220fd9</guid>
            <category><![CDATA[convoy]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Mon, 25 Oct 2021 10:22:53 GMT</pubDate>
            <atom:updated>2021-10-25T12:38:13.526Z</atom:updated>
            <content:encoded><![CDATA[<p>After weeks of work, I’m pleased to announce our new tool — built to send webhooks efficiently. While building out our initial API on third-party monitoring, every user we spoke to wanted asynchronous events — “Do you provide webhooks to notify us about downtime?”. We looked around, and sadly, we couldn’t find a great tool — language agnostic and cloud-native to build this. So we built it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LlrJI0W8XxNNrha1cpe_mg.png" /><figcaption>Convoy Dashboard</figcaption></figure><h3>Problems &amp; Our Solutions</h3><p>On the surface, when you think of webhooks it is simply HTTP Push. If you think this, you might be partly correct, but the story doesn’t end there. Let’s explore:</p><h4>Reliability</h4><p>Essentially, a failed webhooks event has a direct customer impact. A failed event from Paystack means a customer won’t receive value for their purchase on Domino’s while the customer has received a debit alert. It means a Piggyvest customer will not see their top-up while the customer has received a debit alert. A failed webhooks event from Termii means you can’t show your beautiful UX of successful OTP delivery. A failed webhooks event from Mono means you cannot notify your customers of a successful account integration even when you’ve received an authentication token. For the non-technical, webhooks are the glue that ties modern apps together to create endless possibilities. We choose to build Convoy in Golang, and distribute binaries &amp; docker images. Go is more or less the “de-facto language<em>”</em> for building highly available and reliable services in the Cloud.</p><figure><img alt="Golang and Docker" src="https://cdn-images-1.medium.com/max/1024/1*xR4T978ZKbQUDORnx0w1KQ.jpeg" /><figcaption>Golang and Docker</figcaption></figure><h4>Developer Experience</h4><p>Ok, let’s be honest. In the cloud, everything fails — I mean literally [Looking at Facebook :( ]. The question is; what is our mean time to recovery (MTTR). How fast can we resend failed events? Do we have to reach out to Paystack to resend events that didn’t make it? Or events that were sent but we didn’t handle properly? Oh. Flutterwave is sending the wrong data format? How do we verify this hypothesis fast? Can we see what was sent &amp; what our server’s response body is? Who’s the culprit — DNS? Nginx? Essentially, the developer experience around your webhooks infrastructure becomes critical to debugging and recovery. We built Convoy with a web interface, that should enable both Paystack &amp; Paystack’s customers to filter through event logs and resend events easily and fast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTpTVnnR_EXUSrfimzOXFw.png" /><figcaption>Convoy dashboard with retry button enabled</figcaption></figure><h4>Monitoring and Alerts</h4><p>Alright, we get it. I can search my event logs and debug fast. What’s left in webhooks. You see, a successful event means your servers respond with a 200. If your server consistently fails to return a 200 for whatever reason, there’s no reason to continue bombarding the endpoint with more events; It’s a dead endpoint. But how do you know &amp; triage quickly? Essentially, you can implement different solutions — uptime monitoring, monitor average request/minute on your webhooks route, and flag it when you’re below a certain threshold. But obviously, the webhooks provider can see the failed delivery attempts over x time or x events. Without a monitoring and alerts solution, your customers become your Prometheus ( ._.). With Convoy after an endpoint consistently fails we disable the endpoint and send an email to the developers to triage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8as-x-tv8n8Kh677FgEJpQ.png" /></figure><h4>Other Problems</h4><blockquote>It is common to believe we need Stripe quality webhooks. But I disagree, what we need is Quality webhooks for everyone. Stripe’s webhooks is optimised largely for Security and Developer Experience. Twilio is optimised for performance. PagerDuty is optimised for flexibility. Convoy democratises all these complexities in a single binary.</blockquote><p>Honestly, I can go on and on, because I’m so excited about this release. You see, there exist a myriad of other problems around a proper webhook delivery infrastructure. It is common to believe we need Stripe quality webhooks. But I disagree, what we need is Quality webhooks for everyone. Stripe’s webhooks are optimized largely for Security and Developer Experience. Twilio is optimized for performance. PagerDuty is optimised for flexibility. Convoy democratises all these complexities in a single binary.</p><h3>The Future</h3><p>Essentially, just like Redis is to key-value storage, and Gitlab is to DevOps, Convoy is to webhooks. We think it’s possible, and we’re yet to scratch the surface of the experience we want to achieve/is needed, but we think we’re off to a good start and we’re willing to share with the community. This future includes but is not limited to — Rate limiting, Static IP, High availability, Headless (i.e. run Convoy without a third-party queue &amp; storage). Convoy has been running in production in <a href="https://buycoins.africa/">Buycoins</a> for the past month, and a few folks are deploying e.g. <a href="https://termii.com/">Termii</a> &amp; <a href="https://www.getwallets.co/">GetWallets</a>.</p><p>Finally, we built Convoy as an <a href="https://github.com/frain-dev/convoy">open-source</a> project, distributed as Go binaries and a docker image. If you’d like to join the waitlist for Convoy Cloud, please head over to our <a href="https://getconvoy.io/">product site</a> and drop your email.</p><p>Cheers</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a7c1e220fd9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/frain-technologies/introducing-convoy-4a7c1e220fd9">Introducing Convoy</a> was originally published in <a href="https://medium.com/frain-technologies">Frain Publications</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Error Handling in GraphQL-Ruby using Union & Interface types]]></title>
            <link>https://medium.com/@subomiOluwalana/error-handling-in-graphql-ruby-using-union-interface-types-d6706e84e73a?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6706e84e73a</guid>
            <category><![CDATA[graphql-ruby]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Sun, 02 Aug 2020 07:42:01 GMT</pubDate>
            <atom:updated>2020-08-02T07:42:01.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V4BZFgcusB_TieBD" /></figure><p>It is a known problem how GraphQL breaks the widely known HTTP status code for error handling. Everything either responds with a 200 or a 500. There are however, a couple of clever ways to go around this problem and utilise the GraphQL type system to properly handle errors. In this article, I will like to document how I handle errors in GraphQL in Ruby. This particular technique is in no way mine, the original source explaining the technique can be found <a href="https://blog.logrocket.com/handling-graphql-errors-like-a-champ-with-unions-and-interfaces/">here</a>. After trying to implement the same technique in Ruby, I came across several problems, then I decided to document &amp; share them through this article. For the purpose of this article, I will be building a hypothetical API to manage employees of a company.</p><h3>Defining your Union Classes</h3><p>Lets define our Union types to encapsulate an error type for a particular mutation or query resolver. For our employee resource, we define a EmployeeResult as below:</p><pre># app/graphql/types/unions/employee_result.rb <br>module Types <br>  module Unions <br>    class EmployeeResult &lt; BaseUnion <br>      description &#39;Employee possible responses&#39; possible_types     <br>        Types::Objects::EmploymentType, <br>        Types::Errors::CompanyNotFoundError,<br>        Types::Errors::BankNotFoundError,<br>        Types::Errors::EmploymentExistsError,<br>        Types::Errors::AuthenticationError <br>    end <br>  end <br>end</pre><pre># app/graphql/types/errors/company_not_found_error.rb <br>module Types <br>  module Errors <br>    class CompanyNotFoundError &lt; Types::Objects::BaseObject<br>      implements Types::Interfaces::ErrorType </pre><pre>      def message <br>         &#39;Company does not exist&#39; <br>      end <br>    end <br>  end <br>end</pre><p>Now, every mutation and resolver class that returns a Union type can potentially return all objects defined with the possible_types method above. However, when we return an object from our resolver classes, it is not enough for us to return a __typename field to specify the type the object should be resolved into. graphql-ruby provides us with a method it can hook into to provide this resolution of an object to it&#39;s concrete type, this method can be defined both on the actual union type class and the superclass. I define here it in the superclass, see below:</p><pre># app/graphql/types/unions/base_union.rb <br>module Types <br>  module Unions <br>    class BaseUnion &lt; GraphQL::Schema::Union <br>      def self.resolve_type(object, _context)<br>        name = object[:__typename] || object.class.name<br>        (&#39;Types::Objects::&#39; + name + &#39;Type&#39;).constantize <br>      rescue NameError =&gt; e <br>        (&#39;Types::Errors::&#39; +  object[:__typename]).constantize <br>      end <br>    end <br>  end <br>end</pre><p>The resolve_type function above defines the resolution logic. It should return the class object that defines the concrete type to be returned. For non-error types, it can either be defined in the __typename field as well as using the using the object class name to assume the type. For error types, it is totally dependent on the __typename field to resolve to its concrete type.</p><h3>Defining your Mutation</h3><p>For the mutation definition it changes from left to right:</p><pre># Non Union result. <br>module Mutations <br>  class CreateEmployee &lt; BaseMutation <br>    argument :name, String, &#39;Employee name&#39;, required: true <br>    ... </pre><pre>    field :company, Types::Objects::CompanyType, null: false <br>  <br>    def resolve(name:) <br>      ... <br>      # Create employee. <br>      { employee: employee } <br>    end <br>  end <br>end</pre><pre># Using Union. <br>module Mutations <br>  class CreateEmployee &lt; BaseMutation <br>    argument :name, String, &#39;Employee name&#39;, required: true <br>    ... </pre><pre>    payload_type Types::Unions::EmployeeResult </pre><pre>    def resolve(name:) <br>      ... <br>      # Create employee. <br>      return { __typename: &#39;CompanyNotFoundError&#39; } if company.nil?<br>      employee <br>    end <br>  end <br>end</pre><p>While the code on the left specifies the concrete type returned by the mutation resolver, the code on the right specifies the union type, and specifically can return an object specifying an error object or the object in itself.</p><h3>Defining your Resolvers</h3><p>For the query resolver classes, it changes from left to right:</p><pre>module Resolvers <br>  class GetEmployeesResolver &lt; Base <br>    type [Types::Objects::EmploymentType], null: false </pre><pre>    def resolve <br>      ... <br>      raise GraphQL::ExecutionError, &#39;Company does not exist&#39; unless company </pre><pre>      company.employments <br>    end <br>  end <br>end</pre><pre>module Resolvers <br>  class GetEmployeesResolver &lt; Base <br>    type [Types::Unions::EmployeeResult], null: false <br>    <br>    def resolve <br>      ... <br>      return { __typename: &#39;CompanyNotFoundError&#39; } unless company</pre><pre>      company.employments.where(is_active: true)<br>    end <br>  end <br>end</pre><p>Again, the code on the left specifies an array of concrete types to be resolved, while the code on the right resolves to an array of union types.</p><h3>Caveat on handling Authentication Errors.</h3><p>Everything up till now, works fine. But there is a caveat on handling authentication errors, <a href="https://twitter.com/timigod">@timigod</a> wrote a nice write up <a href="https://chunksofco.de/rails-graphql-server-tips-part-1-authentication-bced6cf7ac63">here</a> on write using an AuthorizeUser helper to handle authentication in Ruby GraphQL. This solution uses something similar to the below:</p><pre># app/graphql/helpers/authorize_user.rb<br>module Helpers<br>  class AuthorizeUser<br>    def initialize(resolve_func)<br>      @resolve_func = resolve_func<br>    end<br><br>    def call(ctx)<br>      if ctx[:current_user].nil?<br>      raise GraphQL::ExecutionError, &#39;Please login to perform this action&#39;<br>      else<br>        @resolve_func.call<br>      end<br>    end<br>  end<br>end</pre><pre># app/graphql/mutations/create_employee.rb<br>module Mutations<br>  class CreateEmployee &lt; BaseMutation<br>    argument :name, String, &#39;Employee name&#39;, required: true<br>    ...<br><br>    payload_type Types::Unions::EmployeeResult<br>    def resolve(name:)<br>      Helpers::AuthorizeUser.new(<br>        lambda {<br>          ...<br>          # Create employee.<br>	  return { __typename: &#39;CompanyNotFoundError&#39; } if company.nil?<br>          employee<br>        }<br>      ).call(context)<br>    end<br>  end<br>end</pre><p>This obviously breaks the interface we described in our type system, where our mutation class should be returning an AuthenticationError class. To fix this, I transform my AuthorizeUser helper class to the below:</p><pre># app/graphql/helpers/authorize_user.rb<br>module Helpers<br>  class AuthorizeUser<br>    def initialize(resolve_func)<br>      @resolve_func = resolve_func<br>    end<br><br>    def call(ctx)<br>      if ctx[:current_user].nil?<br>	{<br>	  __typename: &#39;AuthenticationError&#39;,<br>          message: &#39;Please login to perform this action&#39;<br>        }<br>      else<br>        @resolve_func.call<br>      end<br>    end<br>  end<br>end</pre><p>And just like you thought, the story ends there yeah? No! It doesn’t. 😭If you run this code, you’d easily run into a problem, where a particular mutation/resolver class returns an array of union types i.e. type [Types::Unions::EmployeeResult] but when the AuthenticationError is returned it tries to resolve an object rather than an array of objects. To fix this we transform our AuthorizeUser and how it is called to the below:</p><pre># app/graphql/helpers/authorize_user.rb<br>module Helpers<br>  class AuthorizeUser<br>    def initialize(resolve_func)<br>      @resolve_func = resolve_func<br>    end<br><br>    def call(resolver, ctx)<br>      if ctx[:current_user].nil?<br>        error_msg = {<br>          __typename: &#39;AuthenticationError&#39;,<br>          message: &#39;Please login to perform this action&#39;<br>        }<br><br>        resolver.class.type_expr.respond_to?(:each) ? [error_msg] : error_msg<br>      else<br>        @resolve_func.call<br>      end<br>    end<br>  end<br>end</pre><pre># app/graphql/mutations/create_employee.rb<br>module Mutations<br>  class CreateEmployee &lt; BaseMutation<br>    argument :name, String, &#39;Employee name&#39;, required: true<br>    ...<br><br>    payload_type Types::Unions::EmployeeResult<br>    <br>    def resolve(name:)<br>      Helpers::AuthorizeUser.new(<br>        lambda {<br>          ...<br>	  # Create employee.<br>	  return { __typename: &#39;CompanyNotFoundError&#39; } if company.nil?<br>          employee<br>	}<br>      ).call(self, context)<br>    end<br>  end<br>end</pre><p>What changed? In the AuthorizeUser class we pass in the resolver class, and use the type_expr method to determine if the response type is an array or an object and determine how the error message will be resolved back. In conclusion our error shows in two possible ways below:</p><pre># For an array response.<br>{<br>  &quot;data&quot;: {<br>    &quot;getEmployees&quot;: [<br>      {<br>        &quot;__typename&quot;: &quot;AuthenticationError&quot;,<br>        &quot;message&quot;: &quot;Please login to perform this action&quot;<br>      }<br>    ]<br>  }<br>}</pre><pre># For an object response.<br>{<br>  &quot;data&quot;: {<br>    &quot;createEmployee&quot;: {<br>      &quot;__typename&quot;: &quot;AuthenticationError&quot;,<br>      &quot;message&quot;: &quot;Please login to perform this action&quot;<br>    }<br>  }<br>}</pre><h3>Conclusion</h3><p>In conclusion, I believe there might/should be betters way to solve this problem, and/or I should extract this logic into a gem, if you have faced similar problems and have cleaner solutions to this problem, you can reach out to me on twitter <a href="https://twitter.com/subomiOluwalana">@subomiOluwalana</a>. I’d love to hear feedback from fellow Rubyists.</p><p>Cheers 🎉</p><p><em>Originally published at </em><a href="https://www.notion.so/subomioluwalana/Error-Handling-in-GraphQL-Ruby-using-Union-Interface-types-8765623e60b744dc9af5982a532f7c75"><em>https://www.notion.so</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6706e84e73a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Feature Flags with Flipper into Your Rails Application. — GraphQL Edition]]></title>
            <link>https://medium.com/@subomiOluwalana/integrating-feature-flags-with-flipper-into-your-rails-application-graphql-edition-51c1cb925858?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/51c1cb925858</guid>
            <category><![CDATA[feature-flags]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Mon, 11 Mar 2019 19:04:26 GMT</pubDate>
            <atom:updated>2019-03-11T19:04:26.766Z</atom:updated>
            <content:encoded><![CDATA[<h3>Integrating Feature Flags with Flipper into Your Rails Application. — GraphQL Edition</h3><p>Before everything starts tunioniown — Switch em off!</p><p><strong>Feature Flags</strong></p><p>Feature flags otherwise known as feature toggles are software development techniques that allow software development teams to change software behavior without touching a single line of code. Say, for example, your application relies on Paystack for payment processing or whatever third-party system for whatever service, and all of a sudden that third-party system is experiencing an outage; which could go on to cause unwanted issues on your system behavior. This technique can be used to turn off any/every part of your application that relies on that third-party application and simply respond with a service unavailable error message rather than having network timeout issues and your end users having a poor experience.</p><p>This technique was discussed in more detail on the legendary <a href="https://martinfowler.com/aboutMe.html">Martin Fowler</a> blog at <a href="https://martinfowler.com/articles/feature-toggles.html">here</a>.</p><p>Without further theory, I would like to show you how I implemented this technique on a GraphQL API with the <a href="https://github.com/jnunemaker/flipper">Flipper </a>gem in Ruby. The endgame is so as to have a simple Web UI, where we can turn on &amp; off specific GraphQL queries and turn them back on at will, and also a query where the frontend can check-in to see which and which features are on or off.</p><blockquote><em>Let’s get started</em></blockquote><h4>Configuration &amp; Setup with Flipper</h4><p>The Flipper gem was designed with a top-down approach. Where we set up the high-level interface without initially bothering about hooking up the enabled/disabled state with the application’s controller or flow. Flipper can also persist, meaning the state of the features; enabled or disabled can exist after being shut down. Different adapters exist to enable this which can be found <a href="https://github.com/jnunemaker/flipper/blob/master/docs/Adapters.md">here</a>. In this blog post, we’re using the ActiveRecord adapter on a PostgresDB.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/888b96a7fe99f48ea52176c003734eb6/href">https://medium.com/media/888b96a7fe99f48ea52176c003734eb6/href</a></iframe><p>This file creates a global instance of Flipper that can be accessed anywhere else to check if a feature is enabled or not. The last if block is a hack; it is used to ensure the DB is properly set up before trying to access it and persist the features on it.</p><h4>Setting up Hooks/Controls</h4><p>Now that we have set up a global flipper instance, we can now access it from anywhere and disable a feature or not — Which was the initial goal anyway. We need some form of mechanism to tie together the enabled/disabled feature on Flipper to the application’s functionality.</p><blockquote>When I told a friend of mine, I was writing a post on Feature flags, he replied to me saying so quickly you want to teach us if… else, if else… :( But yeah, na still if… else, if else…But it can be done properly.</blockquote><p>After such a setup above, one can think its ok to setup conditionals anywhere across the application to disable a feature or not. I strongly disagree with this approach. I think some form of middleware approach should be used, and that’s what I want to show how I achieved that in a GraphQL API.</p><blockquote>The middleware approach is such that upon any request from any client. The feature flags system drops in its track and asserts if this feature is permitted else it responds with an error.</blockquote><p>I think recent versions of graphql-ruby as a concept of middlewares. But graphql-ruby 1.8.11 was used in this blog post and the instrumentation mechanism was used here in the place of a proper middleware.</p><p>The instrumentation Object must implement a before_query(query) and after_query(query) functions. You can read more on it here. Below we linked every query &amp; mutation to go through the FeatureFlags::Instrumentation module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73529c0ad637a5533928795f3418d0ab/href">https://medium.com/media/73529c0ad637a5533928795f3418d0ab/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53f81d6b9e9a33c35cd064fb4488e420/href">https://medium.com/media/53f81d6b9e9a33c35cd064fb4488e420/href</a></iframe><p>In the above, we set up the before_query to get the operation names in a particular query, this is because a particular GraphQL query request can have multiple operation names and catching only the first one will allow other ones slip through and perform actions that are currently disabled. <strong>With this approach anytime we have a new flag and we want to hook it onto the request/response cycle to check if the feature is enabled or not, we simply add a when clause and do the check- Then we can either allow it to pass or raise an error.</strong></p><p>This as a number of advantages;</p><p>(a) It enables us to have a single source of reference to where all features exist, and can even be refactored to allow features to be imported from a sub-folder for bigger applications to keep the check_flags function small.</p><p>(b)We can stop a request early in its track before it gets to the controller/interactor/service object or wherever your business logic is implemented.</p><p>©Debugging Feature flags becomes easier because we have a single point of reference when looking out of feature flags failure problems.</p><h4>Web UI/Control</h4><p>So Flipper comes with its own UI, and also allows users to hook an authentication layer on top of that UI to provide some form of security. A quick and implementation of this show below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33a5cb4104abf365285fd751387a4203/href">https://medium.com/media/33a5cb4104abf365285fd751387a4203/href</a></iframe><p>A view of the UI below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*auPqQoaiYBRCB8_cT3cbJw.jpeg" /><figcaption>A view of the Features and the gates activated on it. To know more about gates on Flipper check <a href="https://johnnunemaker.com/flipper/">here</a></figcaption></figure><h4>Final Thoughts</h4><p>This is my first time learning and doing feature flags and am fascinated about it as simple as it is though. I hope to write more on this alongside different implementation patterns and complexities to watch out for. As well as proper implementations on REST API’s (LOL… They’re still a thing for you GraphQL fanboys) etc.</p><p>Please drop me your thoughts what you think and your experience with Feature Flags. Bye for now. 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51c1cb925858" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[USING PAYSTACK STANDARD]]></title>
            <link>https://medium.com/@subomiOluwalana/paystack-standard-4660a414957?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/4660a414957</guid>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[paystack]]></category>
            <category><![CDATA[payments]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Thu, 01 Dec 2016 09:02:41 GMT</pubDate>
            <atom:updated>2016-12-14T08:19:34.075Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Introduction</li><li>Demystifying the Flow</li><li>Conclusion</li></ul><h4>INTRODUCTION</h4><p>Paystack standard as it sounds is the standard methodology of integrating the paystack API. It as a more complex data flow and has more features than any other integration model. It allows you pull so much more information and take more actions on your paystack account.</p><h4>DEMYSTIFYING THE FLOW</h4><blockquote>To integrate this model, you must understand that unlike the paystack inline that you’re communicating directly to paystack servers from your frontend with your public key. In this model, you are going to be communicating with the paystack servers through your backend with your private key. This where the true power of your backend comes in unlike paystack inline where you use a public key. Public Keys can only initialize transactions to you. Private Keys can make any goddamn changes to your account.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuqrglpDb2npWZItbQkFDw.jpeg" /></figure><ul><li><strong>PAY:</strong> On your client(i.e. your frontend), create a button or a link, whatever it is to start payment. It is most important to note that this <strong>MUST </strong>be an ajax request because, you’ll get a json response as below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*gBh5lBkf3g3ZB1cmXqSmMw.png" /><figcaption>retrieved from paystack documentation</figcaption></figure><p>I recommend you use the function i defined in my sample code on <a href="https://github.com/Subomi/Paystack-Integration-Samples/tree/master/paystack-standard">github</a>. See snapshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*Oj7CNvd24pw-GyZJxVYf1g.png" /></figure><p>Redirecting to that page, gives us a payment page, which in turns, tell us something, that paystack standard is a bunch of sugar on top of paystack pages. The redirected page is for one-time usage and should be generated newly for every new transaction.</p><ul><li><strong>MAKE PAYMENT: </strong>Your backend server (in my case nodejs) makes a request for a new authorization url.</li><li><strong>AUTH_URL:</strong> Paystack forwards a newly generated url to your backend server, in a json format.</li><li><strong>AUTH URL:</strong> You likewise forward the url back to your client.</li><li><strong>OPEN URL:</strong> That is the work of the makePayment function above, to open the url, its either you open it in a new window or you do that in the same window (the function above opens it in another window).</li><li><strong>ACTUAL PAYMENT:</strong> At this point, the real transaction occurs as the customer inputs his/her card details etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*nEjk6x5HShXqGZQZRYSb1w.png" /><figcaption>A snippet of the server code at the <a href="https://github.com/Subomi/Paystack-Integration-Samples/tree/master/paystack-standard">repo</a></figcaption></figure><ul><li><strong>WEBHOOK UPDATE:</strong> On successful transaction, paystack forwards this event to your webhook url, to keep you informed.</li><li><strong>CALLBACK URL:</strong> Your callback url is forwarded down to the client and the page is automatically reloaded to the callback url.</li></ul><h4>CONCLUSION</h4><p>In conclusion, paystack standard is the standard methodology of integrating the paystack API, and initiating transactions. But this is a small fraction of what can be achieved with paystack standard, with it you can pull down any information about your account, customers list, create a new paystack page etc.</p><p>Full code is <a href="https://github.com/Subomi/Paystack-Integration-Samples/tree/master/paystack-standard">here</a></p><p>Check <a href="https://developers.paystack.co/docs">paystack documentation</a> for further reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4660a414957" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[USING PAYSTACK PAGES]]></title>
            <link>https://medium.com/@subomiOluwalana/paystack-pages-464f591d995?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/464f591d995</guid>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[paystack]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Tue, 29 Nov 2016 11:42:21 GMT</pubDate>
            <atom:updated>2016-11-30T14:03:01.729Z</atom:updated>
            <content:encoded><![CDATA[<ul><li>Introduction</li><li>Demystifying the Flow</li><li>Conclusion</li></ul><h4>INTRODUCTION</h4><p>Well if you’ve thought that paystack inline and paystack standard are the only methodologies of integrating and receiving payments on your platforms, well you have thought wrongly.</p><p>Paystack pages is one of the legit ways of integrating paystack, and by far the easiest, without even worrying much about either private or public keys. Simple and short, what are paystack pages?</p><p>Paystack pages are payment pages created at your dashboard to receive payments from your customers.</p><h4>DEMYSTIFYING THE FLOW</h4><blockquote>To use this model of payment, first thing is to create the payment page at your dashboard</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rrMWYubniXWENsQxZ-gwg.jpeg" /><figcaption>The Architecture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*heYoweFfc_mqSdecHiaBig.png" /><figcaption>Creating the Page that your Dashboard, Use the green button at the Upper Right Angle — Add Page</figcaption></figure><ul><li>REDIRECT: Once you’ve created the link, it means anytime you want to receive payment you have to redirect to the payment page, you can either use it to overthrow the current page or throw it into a new window. (In our model, we assume you are using a new window, for convenience)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*mvhOJXOYjC8bYiWGffTSFQ.png" /><figcaption>Rendered Page view</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*M-rwQ9q1ev06hDrUrMoM8w.png" /><figcaption>Code</figcaption></figure><blockquote>Notice: i use a target attribute to send it into another page. Removing that attribute it would load the page in the same window and replace this page.</blockquote><ul><li>MAKE PAYMENT: On the redirected page, the prospective customer can then make payment inputting his/her card details and all other other fields as you’ve customized it at your dashboard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*azEccT4ZLAc_4Hy92I7k6Q.png" /><figcaption>Setting Webhooks at the Dashboard</figcaption></figure><ul><li>WEB HOOK UPDATE: Once payment is successful, paystack sends to your webhook url an a successful event update (if you actually specified a url in there).</li><li>CALLBACK URL: As well as the web hook update, paystack returns the specified callback url, if any. To the web page which overthrows the current window.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tpm2sRq1bhSz8isddoQZSg.png" /><figcaption>Callback Loaded in the same window.</figcaption></figure><h4>CONCLUSION</h4><p>Payment pages are really an easy and highly recommend methodology of integrating and receiving payments with paystack especially when you are dealing with just a small number of products that a payment page can be created for each of them. The Full code is stored at <a href="https://github.com/Subomi/Paystack-Integration-Samples/tree/master/paystack-page">this repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=464f591d995" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paystack Payment Models]]></title>
            <link>https://medium.com/@subomiOluwalana/paystack-payment-models-17fd671f01aa?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/17fd671f01aa</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[paystack]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Mon, 28 Nov 2016 12:57:21 GMT</pubDate>
            <atom:updated>2016-11-29T10:30:11.603Z</atom:updated>
            <content:encoded><![CDATA[<p>When one wants to sell online or receive payments online through some client (this could be a website, mobile app or even a point-of-sale) The question about how to go about this starts coming with different options such as:</p><ol><li>Do i integrate directly to the Bank?</li><li>Are there any payment processing companies etc.</li><li>What are the pros and cons of each payment processing company?</li></ol><p>It would be extremely expensive and difficult to integrate directly to all banks, and would even be useless, as payment processing companies exist already that do this mainstream, and there would be no need to re-invent such a wheel (which you might not be able to pull off afterwards). Now, when using a payment processing company to process transactions online and receive payments. The crucial question to ask before trying to integrate is</p><ol><li>What is the architecture</li><li>What is the data flow?</li></ol><p>In this article, i want to discuss explicitly the available models of integrating the paystack API into your platform to receive payments, as this is an easy task to do. The images of the data flows are for your consumption and tearing apart.</p><p>Paystack is an online payment processing company that provides you this functionality with ease and a simple API to use.</p><p><strong>INTRODUCTION TO MODELS</strong></p><p>Before diving into the details of paystack’s model. I want to say little about the traditional client server architecture and REST API’s</p><p>Basically this is what you currently have, or something similar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*XxQCAlis9y0WdiFfvpL5ZQ.png" /></figure><p>The client server architecture is e traditional model of networking where you have a simple request and response model. A client requests for some resources from the server and the server responds with a response.</p><p>On the other hand, a REST API simply put is an interface to a web service. It provides you access to some functionality through an endpoint url. In the case of paystack, they provide an api access at http://api.paystack.co/. The very beauty of API’s is the core functionality can span thousands of lines even millions, but this really does not concern us, what is of concern to us is a simply API (Application Program Interface). For example to initialize a transaction i could just call http://api.paystack.co/initialize and set some other parameters in a json body and thats all i receive some response that <strong><em>transaction initialized!</em></strong></p><p>Now, with our trivial model 1: client server architecture. How do we integrate paystack’s core functionality to receive payments.</p><h4>PAYSTACK PAGES</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*6ON9gf3FowZhP0aJQIaMdw.jpeg" /></figure><h4>PAYSTACK INLINE</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*dC3q_fFjbdicOsCa74tRlw.jpeg" /></figure><h4>PAYSTACK STANDARD</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuqrglpDb2npWZItbQkFDw.jpeg" /></figure><h4>CONCLUSION</h4><p>What is most important when integrating a REST API is the underlying architecture and data flow. This would diagrammatically help you understand the whole flow, get your team up speed with you quickly and know your exact needs when integrating. From the above we can see that we can integrate paystack without a nodejs or php server at all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17fd671f01aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using the Paystack Payment API — Part I]]></title>
            <link>https://medium.com/@subomiOluwalana/using-the-paystack-payment-api-part-i-f621a7bbe6b5?source=rss-f1c4f94ee134------2</link>
            <guid isPermaLink="false">https://medium.com/p/f621a7bbe6b5</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[paystack]]></category>
            <dc:creator><![CDATA[Subomi Oluwalana]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 13:44:01 GMT</pubDate>
            <atom:updated>2016-11-23T12:07:12.531Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, I want to share how to use the paystack payment API, which i believe to be very easy to use. The best part is paystack, to a large extent is an indigenous company, and it’s third party API for various platforms are maintained by nigerian developers … how cool is that?</p><p>So, lets jump in</p><p>There are 3 major ways of communicating with the API, which are:</p><ol><li>Paystack Inline</li><li>Paystack Standard</li><li>Paystack Pages</li></ol><p>Understand that the paystack api is a restful api that lives at <a href="https://api.paystack.co/">https://api.paystack.co</a></p><p>To walk through this tutorial, you’ll majorly one thing — a paystack account, which is free, LoL … so head over to <a href="https://paystack.co/">https://paystack.co</a> and create an account.</p><p>PAYSTACK INLINE</p><p>Paystack inline is communicating with the paystack api from the frontend of your code. It is the easiest methodology of integrating the api. To integrate is simple:</p><p>On your frontend attach this js code for integration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/20be217ce452149dcfcd484d62ac0be3/href">https://medium.com/media/20be217ce452149dcfcd484d62ac0be3/href</a></iframe><p>In that js library, just one function does the trick: paystackpop.setup</p><p>paystackpop.setup receives a object of parameters and returns an object, and on that object you fire your request. Lets see the example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a5f7e5b2a2f930f473460955831de940/href">https://medium.com/media/a5f7e5b2a2f930f473460955831de940/href</a></iframe><p><strong>Note: </strong>When you create an account, paystack generates two keys for you public key and secret key. In the key property of the object, you are to use only your public key. Never ever fix in there your secret key.</p><p>And off you go, the paystack api responds with some form to input card details etc.</p><p>The important part of this model of payment, is the callback property of the object passed into the paystackpop.setup function. After payment is made a response Json object is returned containing details about a successful transaction</p><p>With this callback, you can then show your customers their invoice.</p><p><strong>NOT BLINDSIDING YOUR BACKEND APPLICATION</strong></p><p>In this manner, transaction has been made, but then your actual backend server is not aware of this, but below are two models of updating your backend application:</p><ol><li>Manual Update in Callback: You could update it when your callback function is called. This can be stressful for your client app.</li><li>Webhooks: I would specifically talk about webhooks later in this series, but to say a little, you can input a webhook url (A simple link or route to your backend server) at your paystack dashboard and once this event occurs, it would the information automatically to your server.</li></ol><p>Use the image below to grasp it better:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*dC3q_fFjbdicOsCa74tRlw.jpeg" /></figure><p>Would continue form here, from paystack redirect, next post. Please drop your questions, comments and don’t forget to like and follow on twitter @_subomijs</p><p>The full code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0ec747ccef9abe6bc0ff009b453789c/href">https://medium.com/media/f0ec747ccef9abe6bc0ff009b453789c/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f621a7bbe6b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>