You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用WSO2 APIM无法在Stripe中创建客户的技术求助

WSO2 APIM 对接Stripe计费引擎报错问题

我正在尝试使用WSO2 APIM的计费功能,默认采用Stripe作为计费引擎。已按照《WSO2 APIM Monetization》文档完成配置:注释原有SubscriptionCreation和SubscriptionDeletion工作流定义,替换为文档指定的实现。

更新后的工作流定义

<WorkFlowExtensions>
<ApplicationCreation executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationCreationSimpleWorkflowExecutor"/>
<!--ApplicationCreation executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationCreationApprovalWorkflowExecutor"/-->
<ProductionApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor"/>
<!--ProductionApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationApprovalWorkflowExecutor"/-->
<SandboxApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor"/>
<!--SandboxApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationApprovalWorkflowExecutor"/-->
<!--<SubscriptionCreation executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionCreationSimpleWorkflowExecutor"/>-->
<SubscriptionCreation executor="org.wso2.apim.monetization.impl.workflow.StripeSubscriptionCreationWorkflowExecutor"/>
<!--SubscriptionCreation executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionCreationApprovalWorkflowExecutor"/-->

Subscription Update 部分

<SubscriptionUpdate executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionUpdateSimpleWorkflowExecutor"/>
<!--SubscriptionUpdate executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionUpdateApprovalWorkflowExecutor"/-->
<!--SubscriptionUpdate executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionUpdateWSWorkflowExecutor">
     <Property name="serviceEndpoint">http://localhost:9765/services/SubscriptionApprovalWorkFlowProcess/</Property>
     <Property name="username">username</Property>
     <Property name="password">password</Property>
     <Property name="callbackURL">https://host:port/services/WorkflowCallbackService</Property>
</SubscriptionUpdate-->
<UserSignUp executor="org.wso2.carbon.apimgt.impl.workflow.UserSignUpSimpleWorkflowExecutor"/>
<!--UserSignUp executor="org.wso2.carbon.apimgt.impl.workflow.UserSignUpApprovalWorkflowExecutor"/-->

<!--
***NOTE:***
    Users of deletion workflows are expected to implement their own deletion workflow executors and services.
    By default API Manager only implements the core functionalities required to support deletion workflows and
    simple deletion workflow executors. Default WS deletion workflow implementations are not available with the
    distribution.
-->

<!--<SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionSimpleWorkflowExecutor"/>-->
<SubscriptionDeletion executor="org.wso2.apim.monetization.impl.workflow.StripeSubscriptionDeletionWorkflowExecutor"/>
<!--SubscriptionDeletion executor="org.wso2.carbon.apimgt.impl.workflow.SubscriptionDeletionSimpleWorkflowExecutor">
     <Property name="serviceEndpoint">http://host:port/services/SubscriptionApprovalWorkFlowProcess/</Property>
     <Property name="username">username</Property>
     <Property name="password">password</Property>
     <Property name="callbackURL">https://host:port/services/WorkflowCallbackService</Property>
</SubscriptionDeletion -->
<ApplicationDeletion executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationDeletionSimpleWorkflowExecutor"/>
<!--ApplicationDeletion executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationDeletionSimpleWorkflowExecutor">
     <Property name="serviceEndpoint">http://host:port/services/ApplicationApprovalWorkFlowProcess/</Property>
     <Property name="username">username</Property>
     <Property name="password">password</Property>
     <Property name="callbackURL">https://host:port/services/WorkflowCallbackService</Property>
</ApplicationDeletion-->

<!-- Publisher related workflows -->
<APIStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIStateChangeSimpleWorkflowExecutor" />
<!--APIStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIStateChangeApprovalWorkflowExecutor">
    <Property name="stateList">Created:Publish,Published:Block</Property>
</APIStateChange-->

<APIProductStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIProductStateChangeSimpleWorkflowExecutor" />
<!--APIProductStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIProductStateChangeApprovalWorkflowExecutor">
    <Property name="stateList">Created:Publish,Published:Block</Property>
</APIProductStateChange-->

报错信息

当尝试对策略启用计费,或使用已配置计费的策略将API订阅到应用时,出现如下错误:

ERROR - StripeSubscriptionCreationWorkflowExecutor Error while creating a customer in Stripe for username

ERROR - APIConsumerImpl Could not execute Workflow
org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error while creating a customer in Stripe for username

Caused by: com.stripe.exception.ApiConnectionException: IOException during API request to Stripe (https://api.stripe.com): HTTPS hostname wrong:  should be <api.stripe.com> Please check your internet connection and try again. If this problem persists,you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com.

问题似乎源于工作流更新,但无法确定具体原因。

更新

移除工作流修改后,能够创建API订阅(主机名错误偶尔出现),但即便订阅成功,关联客户也未在已连接的Stripe账户中创建。


内容的提问来源于stack exchange,提问作者Iam8139

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 21:25:16