-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from KaveeshBaddage/master
PDORNG - 1146 , Publish Revenue data in Mobile Money Payments
- Loading branch information
Showing
7 changed files
with
168 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
bizao-revenue-publisher/src/main/synapse-config/api/DataPublishAPI.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
bizao-revenue-publisher/src/main/synapse-config/endpoints/RevenuePublishEndpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<endpoint name="RevenuePublishEndpoint" xmlns="http://ws.apache.org/ns/synapse"> | ||
<default> | ||
<timeout> | ||
<duration>30000</duration> | ||
<responseAction>fault</responseAction> | ||
</timeout> | ||
<suspendOnFailure> | ||
<errorCodes>-1</errorCodes> | ||
<initialDuration>0</initialDuration> | ||
<progressionFactor>1.0</progressionFactor> | ||
<maximumDuration>0</maximumDuration> | ||
</suspendOnFailure> | ||
<markForSuspension> | ||
<errorCodes>-1</errorCodes> | ||
</markForSuspension> | ||
</default> | ||
</endpoint> |
33 changes: 32 additions & 1 deletion
33
...her/src/main/synapse-config/sequences/com.apigate.bizao.revenue.publish.main.sequence.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<sequence name="com.apigate.bizao.revenue.publish.main.sequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse"/> | ||
<sequence name="com.apigate.bizao.revenue.publish.main.sequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse"> | ||
|
||
<log level="custom"> | ||
<property name="DIRECTION" value="REQUEST-IN"/> | ||
<property name="APP" value="REVENUE-PUBLISH"/> | ||
<property name="TRACE_ID" expression="$ctx:TRANSACTION_ID" scope="default" type="STRING"/> | ||
<property name="COUNTRY_CODE" expression="json-eval($.county_code)" type="STRING" scope="default"/> | ||
<property name="MNO_NAME" expression="json-eval($.mno_name)" type="STRING" scope="default"/> | ||
<property name="ORDER_ID" expression="json-eval($.order_id)" type="STRING" scope="default"/> | ||
<property name="AMOUNT" expression="json-eval($.amount)" type="STRING" scope="default"/> | ||
<property name="PAYMENT_STATUS" expression="json-eval($.status)" type="STRING" scope="default"/> | ||
</log> | ||
|
||
<payloadFactory media-type="json"> | ||
<format> | ||
{ | ||
"status":"published" | ||
} | ||
</format> | ||
</payloadFactory> | ||
|
||
<property name="HTTP_SC" value="201" scope="axis2" type="STRING"/> | ||
|
||
<log level="custom"> | ||
<property name="DIRECTION" value="RESPONSE-OUT"/> | ||
<property name="APP" value="REVENUE-PUBLISH"/> | ||
<property name="TRACE_ID" expression="$ctx:TRANSACTION_ID" scope="default" type="STRING"/> | ||
</log> | ||
|
||
<respond/> | ||
|
||
</sequence> |
85 changes: 84 additions & 1 deletion
85
...her/src/main/synapse-config/templates/com.apigate.bizao.revenue.publish.call.Template.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,87 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<template name="com.apigate.bizao.revenue.publish.call.Template" xmlns="http://ws.apache.org/ns/synapse"> | ||
<sequence/> | ||
<sequence> | ||
|
||
<log level="custom"> | ||
<property name="DIRECTION" value="REQUEST-IN"/> | ||
<property name="APP" value="REVENUE-CALL"/> | ||
<property name="TRACE_ID" expression="$ctx:TRANSACTION_ID" scope="default" type="STRING"/> | ||
<property name="COUNTRY_CODE" expression="$ctx:COUNTRY"/> | ||
<property name="MNO_NAME" expression="$ctx:MNO"/> | ||
<property name="ORDER_ID" expression="$ctx:ORDER_ID"/> | ||
<property name="AMOUNT" expression="$ctx:AMOUNT"/> | ||
<property name="PAYMENT_STATUS" expression="$ctx:PAYMENT_STATUS"/> | ||
</log> | ||
|
||
<payloadFactory media-type="json"> | ||
<format> | ||
{ | ||
"type": "$1", | ||
"county_code": "$2", | ||
"mno_name": "$3", | ||
"status": "$4", | ||
"amount": "$5", | ||
"order_id": "$6", | ||
"currency": "$7", | ||
"reference": "$8", | ||
"date": "$9", | ||
"state": "$10", | ||
"intTransaction-id": "$11", | ||
"extTransaction-id ": "$12", | ||
"channel": "$13", | ||
"service_provider": "$14" | ||
} | ||
</format> | ||
<args> | ||
<arg evaluator="xml" expression="$ctx:TYPE"/> | ||
<arg evaluator="xml" expression="$ctx:COUNTRY"/> | ||
<arg evaluator="xml" expression="$ctx:MNO"/> | ||
<arg evaluator="xml" expression="$ctx:PAYMENT_STATUS"/> | ||
<arg evaluator="xml" expression="$ctx:AMOUNT"/> | ||
<arg evaluator="xml" expression="$ctx:ORDER_ID"/> | ||
<arg evaluator="xml" expression="$ctx:CURRENCY"/> | ||
<arg evaluator="xml" expression="$ctx:REFERENCE"/> | ||
<arg evaluator="xml" expression="$ctx:DATE"/> | ||
<arg evaluator="xml" expression="$ctx:STATE"/> | ||
<arg evaluator="xml" expression="$ctx:INTERNAL_TRANSACTION_ID"/> | ||
<arg evaluator="xml" expression="$ctx:OPERATOR_TRANSACTION_ID"/> | ||
<arg evaluator="xml" expression="$ctx:CHANNEL"/> | ||
<arg evaluator="xml" expression="$ctx:SERVICE_PROVIDER"/> | ||
</args> | ||
</payloadFactory> | ||
|
||
<!--Get revenue publish URL--> | ||
<dblookup> | ||
<connection> | ||
<pool> | ||
<dsName>jdbc/MOBILE_MONEY_DB</dsName> | ||
</pool> | ||
</connection> | ||
<statement> | ||
<sql> | ||
<![CDATA[ SELECT revenue_publish_api_url,revenue_publish_api_bearer_token FROM global_settings WHERE id = 1 ]]></sql> | ||
<result column="revenue_publish_api_url" name="REVENUE_PUBLISH_API_URL"/> | ||
<result column="revenue_publish_api_bearer_token" name="REVENUE_PUBLISH_API_BEARER_TOKEN"/> | ||
</statement> | ||
</dblookup> | ||
|
||
<!-- Call revenue publish endpoint--> | ||
<property name="Authorization" expression="fn:concat('Basic ', $ctx:REVENUE_PUBLISH_API_BEARER_TOKEN)" scope="transport" type="STRING"/> | ||
<property name="Content-Type" value="application/json" scope="transport" type="STRING"/> | ||
<header name="To" expression="$ctx:REVENUE_PUBLISH_API_URL" scope="default"/> | ||
<property action="remove" name="REST_URL_POSTFIX" scope="axis2"/> | ||
<property name="HTTP_METHOD" scope="axis2" type="STRING" value="POST"/> | ||
|
||
<call> | ||
<endpoint key="RevenuePublishEndpoint"/> | ||
</call> | ||
|
||
<log level="custom"> | ||
<property name="DIRECTION" value="RESPONSE-IN"/> | ||
<property name="APP" value="REVENUE-CALL"/> | ||
<property name="TRACE_ID" expression="$ctx:TRANSACTION_ID" scope="default" type="STRING"/> | ||
<property expression="$axis2:HTTP_SC" name="HTTP_STATUS"/> | ||
</log> | ||
|
||
</sequence> | ||
</template> |