This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Testing Payment Initiation flow
WSO2 Open Banking enables PISP to test with JMeter x-jws-signature in v.1.3.0 for the payment initiation flow. The steps are described below.
The handler for the x-jws-signature is set in the payment initiation API by default as below.
<handler class= "com.wso2.finance.open.banking.gateway.jws.UKJwsSignatureHandler"/>
In order to call the payment initiation API, it is required to pass the x-jws-signature as a header parameter in the request call. Following steps describe how it is done.
Build a jar file from
financial-open-banking/integration-tests/integration-jmeter-ext
directory and place thejwt-builder-jmeter-ext-1.3.0.jar
file in[JMETER_HOME]/lib/ext/
directory.Add new property Algorithm=PS256 to the
jwtbuilder.properties
file in[JMETER_HOME]/bin/jwtExtResources/
directory.Add the Payload Configuration and Generate x-jws Signed Request Object scripts to the relevant test scenario thread group in payment initiation as below. These scripts should be placed before the POST request. See Configuring Payload Configuration script for the steps to configure the Payload Configuration script.
Configuring Payload Configuration script
Configure Payload Configuration script for the required user parameters as below.
Include following parameters that are used to generate x-jws-signature.
payload POST request payload clientSubjectDN DN of the client certificate clientKeyId (kid) valid and a signing certificate with the specified key id can be retrieved from the OB directory Algorithm PS256 trustAnchorDns
Generate x-jws Signed Request Object
Configura Generate x-jws Signed Request Object script that is used to generate x-jws signature for the JSR223 PreProcessor as below.
- In order to sign the request with client keys, pass the header as defined in the script and the payload. Appropriate user parameters are passed via Payload Configuration script. Generated JWTValue will be passed to the header parameter of a POST request. See below for a sample Generate x-jws Signed Request Object script.
Select Payload Configuration script. Provide relevant values for the payload, clientSubjectDN and clientKeyId parameters that were included under Configuring Payload Configuration script. See the below example for sample values.
Select POST Payment Initiation Request. Add a header parameter named x-jws-signature and set the ${JWTValue} with the generated x-jws-signature.
The example is selected for the POST Payment Initiation of domestic payments. The jemeter script testing can be done for the following POST requests.
POST /domestic-scheduled-payments
POST /domestic-scheduled-payments
POST /international-payments
POST /international-scheduled-payments
POST /international-standing-orders
POST/file-paymentsLoad the payload for the POST request body from the parameter value that is defined in the Payload Configuration file. It eliminates an error that occurres due to a payload format mismatch.
- Then execute JMeter script.