Skip to content

Commit

Permalink
Merge pull request #31 from dushansilva/1.2.x
Browse files Browse the repository at this point in the history
1Fix workflow issue in subscribing a monetized API & update readme
  • Loading branch information
chamindias authored Jul 6, 2021
2 parents 5165155 + 0a23e92 commit 89e4c9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,16 @@ public List<WorkflowDTO> 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;
}

/**
Expand Down Expand Up @@ -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()),
Expand Down

0 comments on commit 89e4c9b

Please sign in to comment.