Code Monkey home page Code Monkey logo

wso2-am-stripe-plugin's Introduction

Stripe Extension For WSO2 API Manager

The Stripe extension for WSO2 API Manager allows you to integrate Stripe as the billing engine for monetizing APIs.

This is a sample implementation to support usage based billing for a API subscription.

Compatibility

Stripe Extension Version Supported WSO2 APIM Version
1.0.x API Manager 3.0.0
1.1.x API Manager 3.1.0
1.1.x API Manager 3.2.0
1.2.x API Manager 4.0.0
1.3.x or 1.4.x API Manager 4.1.0

Getting Started

Using The Stripe Extension

To get started with Stripe extension and it's operations, see configuring API monetization.

Building From The Source

Follow the steps given below to build the Stripe extension from the source code:

  1. Get a clone or download the source from Github.
  2. Run the following maven command inside the wso2-am-stripe-plugin directory.

    mvn clean install

  3. The Stripe extension jar file is created in the wso2-am-stripe-plugin/target directory.

How You Can Contribute

As an open source project, WSO2 extensions welcome contributions from the community. Check the issue tracker for open issues that interest you. We look forward to receiving your contributions.

wso2-am-stripe-plugin's People

Contributors

anugayan avatar arshardh avatar arunans23 avatar chamindias avatar dushaniw avatar dushansilva avatar harsha89 avatar hisanhunais avatar isurumaduranga avatar jaadds avatar maheshika avatar mushir33 avatar npamudika avatar shilmyhasan avatar uvindra avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wso2-am-stripe-plugin's Issues

Publishing Usage Data to Stripe Fails

Description:
When I follow the monetization documentation at step 4, sub step 3 Publish usage data to the Stripe billing engine I get the following error:

ERROR {org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent} - Failed to publish monetization usage to billing Engine java.lang.NullPointerException
	at org.wso2.apim.monetization.impl.StripeMonetizationImpl.publishMonetizationUsageRecords(StripeMonetizationImpl.java:681)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run_aroundBody0(MonetizationUsagePublishAgent.java:62)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run(MonetizationUsagePublishAgent.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
  1. Note that since the documentation links to the Release v1.3.1, I used that jar.
  2. However, when I tried with v1.3.2 and tried to publish usage data I got the following different error:
Exception in thread "pool-320-thread-1" java.lang.NoClassDefFoundError: co/elastic/clients/util/ObjectBuilder
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassForName_aroundBody446(APIUtil.java:6592)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassForName(APIUtil.java:6589)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassInstance_aroundBody444(APIUtil.java:6576)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassInstance(APIUtil.java:6573)
	at org.wso2.carbon.apimgt.impl.APIAdminImpl.getMonetizationImplClass_aroundBody18(APIAdminImpl.java:269)
	at org.wso2.carbon.apimgt.impl.APIAdminImpl.getMonetizationImplClass(APIAdminImpl.java:256)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run_aroundBody0(MonetizationUsagePublishAgent.java:51)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run(MonetizationUsagePublishAgent.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: co.elastic.clients.util.ObjectBuilder cannot be found by org.wso2.apim.monetization.impl_1.3.2_1.0.0
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 13 more
  1. Then I tried to pull the latest from the repo and build locally and got the following error when repeating the publishing step:
Exception in thread "pool-316-thread-1" java.lang.NoClassDefFoundError: co/elastic/clients/json/JsonpMapper
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassForName_aroundBody446(APIUtil.java:6592)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassForName(APIUtil.java:6589)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassInstance_aroundBody444(APIUtil.java:6576)
	at org.wso2.carbon.apimgt.impl.utils.APIUtil.getClassInstance(APIUtil.java:6573)
	at org.wso2.carbon.apimgt.impl.APIAdminImpl.getMonetizationImplClass_aroundBody18(APIAdminImpl.java:269)
	at org.wso2.carbon.apimgt.impl.APIAdminImpl.getMonetizationImplClass(APIAdminImpl.java:256)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run_aroundBody0(MonetizationUsagePublishAgent.java:51)
	at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run(MonetizationUsagePublishAgent.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: co.elastic.clients.json.JsonpMapper cannot be found by org.wso2.apim.monetization.impl_1.3.2_1.0.0
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 13 more

Suggested Labels:
None

Suggested Assignees:
None

Affected Product Version:

  • WSO2 API Manager v4.1.0
  • org.wso2.apim.monetization.impl-1.3.1.jar
  • org.wso2.apim.monetization.impl-1.3.2.jar

OS, DB, other environment details and versions:

  • macOS 12.2.1
  • mysql Ver 8.0.29 for macos12.2 on arm64 (Homebrew) for WSO2AM_DB
  • Default H2 DB for WSO2SHARED_DB

Steps to reproduce:
Follow the monetization documentation and at step 4, sub step 3 Publish usage data to the Stripe billing engine you will get the error.

In case this is important: I connected the same platform account as the connected account in Stripe. But everything went as mentioned in the docs including creation of subscription plan, and creation of platform and shared customers on Stripe.

Related Issues:
None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.