GithubHelp home page GithubHelp logo

wso2-am-stripe-plugin's Issues

Unable to Monetize API Product with WSO2 API Manager 4.2.0

Description:

I am experiencing an issue with WSO2 API Manager 4.2.0 where I am unable to monetize an API product. Despite following the documentation and ensuring all configurations are correct, the monetization feature does not seem to work as expected. Below are the steps I have taken and the problems encountered.

Solution:

Requesting to support Monetize API product with WSO2 APIM 4.2.0 .

Affected Component:
APIM

Version:
4.2.0

Steps to reproduce:

  • Installed and configured WSO2 API Manager 4.2.0 following the official documentation.
  • Created an API Product and published it successfully.
  • Enabled monetization for the API product as per the guidelines in the WSO2 Monetization documentation.
  • Attempted to configure the ConnectedKey and attach it to the API product.

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.