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/.
Payment Initiation Service Provider Flow v1.3.6
This document explains the flow of events related to the Payment Information Service that a Payment Initiation Service Provider (PISP) tries. For the Berlin specific solution, the Payment Information Service is exposed as an API resource in NextGenPSD2XS2AFramework of WSO2 Open Banking. In the Payment Information Service, a PISP initiates a payment submission on behalf of Payment Services Users (PSUs) and the PSU authorises the payment-initiation and payment-cancellation.
Before you begin,
You need to deploy the NextGenPSD2XS2A API v1.3.6.
You can try out the Payment Initiation flow in WSO2 Open Banking using the following steps:
Loading
Step 8 - Generate application access token
When invoking APIs, application access tokens must be generated using the client credential grant type. The generated application access token is used to invoke the NextGen PSD2 XS2A Framework API.
Step 9 - Initiate a payment
In this step, the TPP creates a request to get the consent of the PSU before a transaction is executed.
Step 10 - Authorise the payment
WSO2 Open Banking for Berlin Implementation supports both implicit and explicit authorization flows for transaction authorization. In both cases, TPP generates the authorization URL using the well-known configuration that is received from the ASPSP as scaOAuth link in the response.
Implicit authorisation
In this approach,
- ASPSP creates authorization sub-resources after the payment consent is received
- ASPSP replies with the well-known configuration of the Identity and Access Management module in the links section of the response
- TPP generates the authorization URL using the well-known URL
- PSU goes through the authorisation flow with that authorisation URL
Explicit authorisation
In this approach,
- TPP initiates the authorization flow by invoking the
POST /{payment-service}/{payment-product}/{paymentId}/authorisationsAPI resource - At this point, the ASPSP creates authorization sub-resources and reply with the well-known configuration of the Identity and Access Management module in the links section of the response
- TPP has to generate the authorization URL, which the PSU uses to go through the authorization flow later
Authorisation URL
The TPP uses the well-known URL regardless of the authorisation followed (Implicit/Explicit) to authorise payments as below:
Step 11 - Retrieve payment information/ status
This is only available as a WSO2 Update from WSO2 Open Banking Identity Server Level 2.0.0.227 and WSO2 Open Banking API Manager Level 2.0.0.215 onwards. For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
Before you begin,
- Update the following files with the files in the latest update level:
dynamic-endpoint-insequence-1.3.6.xmlinsequence file- OpenAPI File
- Redeploy the NextGenPSD2XS2A API.
GET /payments/{payment-product}/{paymentId}
- This response should be constructed by the core banking back end.
- The
transactionStatusproperty shows the status of the real payment at the time the request arrives at the bank backend. - The response to the request must comply with the response specified in the specification.
GET /bulk-payments/{payment-product}/{paymentId}
- This response is constructed by the core banking back end.
- The
transactionStatusproperty shows the status of the real payment at the time the request arrives at the bank backend. - The response to the request must comply with the response specified in the specification.
GET /periodic-payments/{payment-product}/{paymentId}
- This response is constructed by the core banking back end.
- The
transactionStatusproperty shows the status of the real payment at the time the request arrives at the bank backend. - The response to the request must comply with the response specified in the specification.
GET /{payment-service}/{payment-product}/{paymentId}/status
This request is applicable for instant payments, bulk payments, and periodic payments.
Given below is a sample request for a periodic payment:
- This response is constructed by the core banking back end.
- The
transactionStatusproperty shows the status of the real payment at the time the request arrives at the bank backend. - The response to the request must comply with the response specified in the specification.
Step 12 - Cancel a payment
This is only available as a WSO2 Update from WSO2 Open Banking Identity Server Level 2.0.0.227 and WSO2 Open Banking API Manager Level 2.0.0.215 onwards. For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
Before you begin,
- Update the following files with the files in the latest update level:
dynamic-endpoint-insequence-1.3.6.xmlinsequence file- OpenAPI File
- Redeploy the NextGenPSD2XS2A API.
- There are three types of payments.
- Instant payments
- Bulk payments
- Periodic payments
- Only bulk payments and periodic payments can be cancelled.
- The bank should decide whether the payment cancellation needs authorization or not.
DELETE /{payment-service}/{payment-product}/{paymentId}
To cancel an already submitted payment
- This will go to the core banking backend and respond accordingly.
- Successful response code will be either 204 or 202. This is decided by the bank.
- If you get 204 as the response code, it indicates that the bank does not need authorization to cancel this payment. Therefore, the payment status must be updated by the bank as
CANC. The consent status will be updated asCANC. - If you get 202 as the response code, it indicates that the bank needs the authorization to cancel this payment. Therefore, the payment status must be updated by the bank as
ACTC. The consent status will be updated toACTC.
Sample DELETE request for a bulk payment cancellation without authorization is given below:
If the bank decides not to require an authorization to cancel the payment, the response will be a 204 response code with no response body. The payment cancellation flow will end from there and the payment will be cancelled.
If the bank requires an authorization to cancel the payment, the core banking backend will return a 202 response code and the body must comply with the specification.
The
transactionStatusproperty must beACTC.
202 with the above payload for the DELETE request, the POST /{payment-service}/{payment-product}/{paymentId}/cancellation-authorisations request must be sent to create an authorization resource for the cancellation. This is indicated in the response of the DELETE request in the startAuthorisationWithPsuIdentification property. This request requires an application access token. POST cancellation-authorisations request is successful, the TPP should send the authorization request as follows to inform the bank to cancel the payment. Then the bank displays a page similar to the consent page asking the PSU to approve or deny the cancellation authorization.https://localhost:9446/oauth2/authorize/?scope=pis:<payment_id>&response_type=code&redirect_uri=<redirect_uri>&state=55e9d72a-218c-44bb-824e-cf0d61c3fdb1&code_challenge_method=S256&client_id=<client_id>&code_challenge=re6uXq06M40gS82XcmUM6s9SQVTxtY5bLSYCNLuS1XE
- If the PSU proceeds to the cancellation by selecting Confirm,
- The payment cancellation will be submitted to the core banking back end
- It will be cancelled by the bank.
- If the PSU selects Deny,
- The cancellation flow will end without submitting the payment cancellation
- The payment will not be cancelled.