From cee2603e33532bd0b0926c3b9410141312dc20f5 Mon Sep 17 00:00:00 2001 From: hisanhunais Date: Tue, 1 Jun 2021 15:41:00 +0530 Subject: [PATCH 1/2] Fix workflow issue in subscribing a monetized API --- .../StripeSubscriptionCreationWorkflowExecutor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org.wso2.apim.monetization/impl/workflow/StripeSubscriptionCreationWorkflowExecutor.java b/src/main/java/org.wso2.apim.monetization/impl/workflow/StripeSubscriptionCreationWorkflowExecutor.java index 4ff5584..03a277d 100644 --- a/src/main/java/org.wso2.apim.monetization/impl/workflow/StripeSubscriptionCreationWorkflowExecutor.java +++ b/src/main/java/org.wso2.apim.monetization/impl/workflow/StripeSubscriptionCreationWorkflowExecutor.java @@ -99,11 +99,16 @@ public List getWorkflowDetails(String workflowStatus) throws Workfl @Override public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { + SubscriptionWorkflowDTO subsWorkflowDTO = (SubscriptionWorkflowDTO) workflowDTO; + workflowDTO.setProperties("apiName", subsWorkflowDTO.getApiName()); + workflowDTO.setProperties("apiVersion", subsWorkflowDTO.getApiVersion()); + workflowDTO.setProperties("subscriber", subsWorkflowDTO.getSubscriber()); + workflowDTO.setProperties("applicationName", subsWorkflowDTO.getApplicationName()); super.execute(workflowDTO); workflowDTO.setStatus(WorkflowStatus.APPROVED); WorkflowResponse workflowResponse = complete(workflowDTO); - return new GeneralWorkflowResponse(); + return workflowResponse; } /** @@ -497,6 +502,8 @@ public MonetizationPlatformCustomer createMonetizationPlatformCutomer(Subscriber @Override public WorkflowResponse complete(WorkflowDTO workflowDTO) throws WorkflowException { + workflowDTO.setUpdatedTime(System.currentTimeMillis()); + super.complete(workflowDTO); ApiMgtDAO apiMgtDAO = ApiMgtDAO.getInstance(); try { apiMgtDAO.updateSubscriptionStatus(Integer.parseInt(workflowDTO.getWorkflowReference()), From 0a23e92954752603790165b9987760a934ad447e Mon Sep 17 00:00:00 2001 From: dushansilva Date: Tue, 6 Jul 2021 16:02:57 +0530 Subject: [PATCH 2/2] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f0deb21..51b68c9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This is a sample implementation to support usage based billing for a API subscri | :-------------: | :---------------:| | [1.0.x](https://github.com/wso2-extensions/wso2-am-stripe-plugin/tree/v1.0.0) | API Manager 3.0.0 | [1.1.x](https://github.com/wso2-extensions/wso2-am-stripe-plugin/tree/v1.1.1) | API Manager 3.1.0 +| [1.1.x](https://github.com/wso2-extensions/wso2-am-stripe-plugin/tree/v1.1.2) | API Manager 3.2.0 | [1.2.x](https://github.com/wso2-extensions/wso2-am-stripe-plugin/tree/v1.2.0) | API Manager 4.0.0