Skip to content

Commit

Permalink
refactor: additional message to retrieve paymentId from reference
Browse files Browse the repository at this point in the history
  • Loading branch information
MLenterman committed Feb 1, 2024
1 parent 35c4aa3 commit f7f7d8d
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<xsl:stylesheet exclude-result-prefixes="xs xsl zgw" version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:zgw="http://google.com/zgw"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:payment="http://www.emaxx.org/functional/cases/payment"
xmlns:payments="http://www.emaxx.org/functional/cases/payments"
>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" exclude-result-prefixes="xsi"/>
<xsl:include href="../../BpelFunctionsBase.xslt" />

<!-- Map -->

<!-- Create/Enrich -->
<xsl:param name="LookUpPaymentsMessage" as="node()"><payments:lookUpPayments /></xsl:param>

<xsl:param name="Id" select="''" as="xs:string" />
<xsl:param name="Id_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="CaseId" select="''" as="xs:string" />
<xsl:param name="CaseId_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="ReferenceNumber" select="''" as="xs:string" />
<xsl:param name="ReferenceNumber_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="Description" select="''" as="xs:string" />
<xsl:param name="Description_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="Price" select="''" as="xs:string" />
<xsl:param name="Price_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="SetDate" select="''" as="xs:string" />
<xsl:param name="SetDate_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="EndDate" select="''" as="xs:string" />
<xsl:param name="EndDate_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="ExtReferenceNumber" select="''" as="xs:string" />
<xsl:param name="ExtReferenceNumber_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="ExtSystem_Code" select="''" as="xs:string" />
<xsl:param name="ExtSystem_Code_Operator" select="'EQUAL'" as="xs:string" />
<xsl:param name="ExtSystem_Description" select="''" as="xs:string" />
<xsl:param name="ExtSystem_Description_Operator" select="'EQUAL'" as="xs:string" />

<xsl:template match="/">
<payments:lookUpPayments>
<payment:paymentSearchMessage>
<payment:referenceNumber operator="EQUAL">
<xsl:copy-of select="zgw:FromOrderedSource(
$ReferenceNumber,
$LookUpPaymentsMessage//payment:referenceNumber,
'',
//payment:referenceNumber)"/>
</payment:referenceNumber>
</payment:paymentSearchMessage>
</payments:lookUpPayments>
</xsl:template>
</xsl:stylesheet>
2 changes: 2 additions & 0 deletions src/main/configurations/bpel/Configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<!ENTITY Bpel_Mtom_Mock SYSTEM "./Configuration_Bpel_Mtom_Mock.xml">
<!ENTITY Bpel_Mtom_PostAddDocument SYSTEM "./Configuration_Bpel_Mtom_PostAddDocument.xml">
<!ENTITY Bpel_Payment_PostAddPaymentStates SYSTEM "./Configuration_Bpel_Payment_PostAddPaymentStates.xml">
<!ENTITY Bpel_Payment_PostLookUpPayments SYSTEM "./Configuration_Bpel_Payment_PostLookUpPayments.xml">
<!ENTITY Notificaties_Subscribe SYSTEM "./Configuration_Notificaties_Subscribe.xml">
]>

Expand All @@ -35,5 +36,6 @@
&Bpel_Mtom_Mock;
&Bpel_Mtom_PostAddDocument;
&Bpel_Payment_PostAddPaymentStates;
&Bpel_Payment_PostLookUpPayments;
&Notificaties_Subscribe;
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,34 @@
javaListener="Bpel_Basic_PostRegister"
>
</IbisLocalSender>
<Forward name="success" path="CreateLookUpPaymentsMessage" />
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<XsltPipe
name="CreateLookUpPaymentsMessage"
getInputFromSessionKey="UnwrappedMessage"
styleSheetName="Bpel/Payment/Model/LookUpPaymentsMessage.xslt"
storeResultInSessionKey="LookUpPaymentsMessage"
onlyIfSessionKey="HasPayment"
onlyIfValue="true"
>
<Param name="ReferenceNumber" sessionKey="RegisterResponseMessage" xpathExpression="//*:referenceNumber" />
<Forward name="success" path="BpelPaymentPostLookUpPaymentsSender" />
<Forward name="error" path="EXCEPTION" />
</XsltPipe>

<SenderPipe
name="BpelPaymentPostLookUpPaymentsSender"
storeResultInSessionKey="LookUpPaymentsResponseMessage"
onlyIfSessionKey="HasPayment"
onlyIfValue="true"
>
<IbisLocalSender
name="BpelPaymentPostLookUpPaymentsLocalSender"
javaListener="Bpel_Payment_PostLookUpPayments"
>
</IbisLocalSender>
<Forward name="success" path="CreateAddPaymentStatesMessage" />
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>
Expand All @@ -242,7 +270,7 @@
onlyIfSessionKey="HasPayment"
onlyIfValue="true"
>
<Param name="PaymentId" xpathExpression="/ZgwObject/payment/public_order_ids" />
<Param name="PaymentId" sessionKey="LookUpPaymentsResponseMessage" xpathExpression="//*[local-name()='paymentId']" />
<Param name="StateCode" value="004" />
<Param name="ExtCode" value="9" />
<Param name="ExtMessage" value="Payment requested" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../FrankConfig.xsd">
<Adapter
name="Bpel_Payment_PostLookUpPayments"
active="${Bpel_Payment_PostLookUpPayments.Active}"
description=""
>

<Receiver name="Bpel_Payment_PostLookUpPayments">
<JavaListener name="Bpel_Payment_PostLookUpPayments" />
</Receiver>

<Pipeline>
<Exits>
<Exit name="EXIT" state="SUCCESS" />
<Exit name="EXCEPTION" state="ERROR" />
</Exits>

<SenderPipe
name="PostBpelPaymentLookUpPaymentsSender"
>
<SoapInputWrapper
direction="WRAP"
soapHeaderStyleSheet="Bpel/Documents/Model/Security.xslt"
>
<Param name="Username" pattern="{username}@MidOffice" authAlias="${openforms2bpel.bpel.basic-service.authAlias}" />
<Param name="Password" pattern="{password}" authAlias="${openforms2bpel.bpel.basic-service.authAlias}" hidden="true"/>
<Param name="Created" xpathExpression="string($NowDateTime)" >
<Param name="NowDateTime" pattern="{now}" type="DATETIME" />
</Param>
</SoapInputWrapper>
<WebServiceSender
name="PostBpelPaymentLookUpPaymentsWebServiceSender"
soap="false"
methodType="POST"
contentType="text/xml"
soapAction="payments:lookUpPayments"
verifyHostname="${openforms2bpel.bpel.payment-service.verify-hostname}"
allowSelfSignedCertificates="${openforms2bpel.bpel.payment-service.allow-self-signed-certs}"
ignoreCertificateExpiredException="${openforms2bpel.bpel.payment-service.ignore-expired-certs}"
timeout="${openforms2bpel.bpel.payment-service.timeout}"
throwApplicationFaults="false"
>
<Param name="url" value="${openforms2bpel.bpel.payment-service.endoint}" />
</WebServiceSender>
<Forward name="success" path="UnwrapResponse" />
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<SoapWrapperPipe
name="UnwrapResponse"
direction="UNWRAP"
/>

<!-- TODO: Error handling based on http code -->

</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Bpel_Documents_UploadAttachments.Active=true
Bpel_Mtom_Mock.Active=true
Bpel_Mtom_PostAddDocument.Active=true
Bpel_Payment_PostAddPaymentStates.Active=true
Bpel_Payment_PostLookUpPayments.Active=true
Notificaties_Subscribe.Active=true

# suppress warning keys
Expand Down

0 comments on commit f7f7d8d

Please sign in to comment.