Skip to content

Instantly share code, notes, and snippets.

@cmwylie19
Created April 28, 2022 14:28
Show Gist options
  • Select an option

  • Save cmwylie19/9dea19703aca32b3ef0b7a7ce93a4b5a to your computer and use it in GitHub Desktop.

Select an option

Save cmwylie19/9dea19703aca32b3ef0b7a7ce93a4b5a to your computer and use it in GitHub Desktop.
Monetization in Kong/3scale

Gateway Monetization

Definition of Done:
Payment Gateway is one of the aspects of the monetization. Setting up the plan and metering is other aspect. In 3scale we definitely have these 3 capabilities. So, the first ask is how are all these features work in hypercurrent.io? Does it provides complete monetization features and how? Then, in 3scale how are providing this feature, are we using some kind of plugin or is it in built in?

TOC

3scale Monetization Capabilities

  • Provisioning Paid Plans by defining subscription fees based on usage. provisioning pricing tiers, and pricing rules
  • Configuring Billing Settings allows you to define billing modes (Prepaid/Postpaid), currency, credit card transactions, policies, invoices and payment gateways.

How 3scale Monetization Works

Stripe Credit Card Gateway Configuration:

  1. Generate Access Token in 3scale Admin Portal
  2. Obtaining the keys and the webhook secret from Stripe
  3. Configuring charging in the 3scale Admin Portal
  4. Editing Credit Card Details in 3scale Developer Portal
  5. Updating the text of unsuccessfully charged email response

Braintree Credit Card Gateway Configuration:

  1. Obtaining the keys and merchant identifier from Braintree
  2. Configuring charging in the 3scale Admin Portal
  3. Editing Credit Card Details in 3scale Developer Portal

Essentially to configure Braintree or Stripe you must create the appropriate credentials to interact with the payment provider, then update the Credit Card Gateway in the 3scale Admin Portal.

3scale Admin Portal

Code references to how 3scale uses payment gateways can be found:

HyperCurrent Monetization Capabilities

Documentation is sparse

How HyperCurrent Monetization Works

  1. From Billing and Usage page, click Go to billing portal.
  2. In Payment Methods, add:
  • Click + Add a payment method to set up a new card
  • Change the default payment method, or delete a payment method

This document explains also how to pay an invoice and view billing history.

img

Ways to Use HyperCurrent:

  • Frontend (React)
  • Command Line
  • Through SalesForce

Commonalities between 3scale and Kong Payments

Both projects appear to use payment gateways to monitize API usage with metrics and bundling options. They have the ability to create tiered and highly customized pricing plans and support analytics from the payment gateways regarding usage and performance.

Stripe, Braintree, and HyperCurrent all have flexible ways of interacting with the gateways including in JavaScript on the frontend, through CLI, and through the Product Portals.

Regarding are we using some type of plugin or is this built-in, it is built in, and code is built to support these functionalities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment