Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vrp submission flow #58

Merged
merged 25 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
57eccec
Implementation of VRP service class
kalpanakanagasabai Apr 29, 2024
a0efde6
Implementation of VRP submission flow
kalpanakanagasabai Apr 29, 2024
b5975f0
Implementation of unit test for VRP submission flow
kalpanakanagasabai Apr 29, 2024
b6f317b
Resolving the comments
kalpanakanagasabai May 8, 2024
493c35e
Commits of vrp submission flow
kalpanakanagasabai May 15, 2024
7301826
Commits of vrp submission flow
kalpanakanagasabai May 15, 2024
273c2a4
Commits of vrp submission flow Unit test
kalpanakanagasabai May 15, 2024
a2cbe69
Commits
kalpanakanagasabai May 17, 2024
87fc7fd
Merge branch 'main' of https://github.com/wso2/financial-open-banking…
kalpanakanagasabai May 17, 2024
547c513
Merge branch 'main' of https://github.com/wso2/financial-open-banking…
kalpanakanagasabai May 20, 2024
991e96c
Resolving comments
kalpanakanagasabai May 29, 2024
8362873
Resolving comments
kalpanakanagasabai May 31, 2024
dc8a94b
Resolving comments
kalpanakanagasabai May 31, 2024
983db07
Resolving comments - adding inline comments and method comments
kalpanakanagasabai May 31, 2024
a613632
Resolving comments
kalpanakanagasabai Jun 19, 2024
111dea6
Removed additional lines
kalpanakanagasabai Jun 19, 2024
1b1d6a5
Unit test for vrp submission flow
kalpanakanagasabai Jun 19, 2024
001c042
Unit test for vrp submission flow
kalpanakanagasabai Jun 19, 2024
1181096
resolving comments
kalpanakanagasabai Jun 25, 2024
af24a0c
Unit test of submission flow
kalpanakanagasabai Jun 25, 2024
b922317
resolving comments
kalpanakanagasabai Jun 25, 2024
620c1b6
resolving comments
kalpanakanagasabai Jun 25, 2024
4cf2bb6
unit test
kalpanakanagasabai Jun 25, 2024
bfaf99e
Resolving comments
kalpanakanagasabai Jun 26, 2024
2465fd1
Resolving comments
kalpanakanagasabai Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
*
* <p>
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -142,7 +142,7 @@ public class ErrorConstants {
+ ErrorConstants.PATH_ACCESS_TOKEN;
public static final String PATH_ACCESS_TOKEN = "Header.AccessToken";
public static final String MSG_INVALID_CLIENT_ID = "The client Id related the consent does not match with the " +
"client id bound to token:" + ErrorConstants.PATH_CLIENT_ID;
"client id bound to token:" + ErrorConstants.PATH_CLIENT_ID;
public static final String PATH_CLIENT_ID = "Header.Client-id";
public static final String UNEXPECTED_ERROR = "OB.UnexpectedError";
public static final String INVALID_CONSENT_TYPE = "Invalid Consent Type found in the request";
Expand All @@ -162,63 +162,50 @@ public class ErrorConstants {
"initiated amount:" + ErrorConstants.PATH_INSTRUCTED_AMOUNT_AMOUNT;
public static final String PATH_INSTRUCTED_AMOUNT_AMOUNT = "Data.Initiation.InstructedAmount.Amount";
public static final String INSTRUCTED_AMOUNT_AMOUNT_NOT_FOUND = "Instructed Amount Amount isn't present in the " +
"payload:" + ErrorConstants.PATH_INSTRUCTED_AMOUNT;
"payload:";
public static final String INSTRUCTED_AMOUNT_CURRENCY_MISMATCH = "Instructed Amount currency does not match the " +
"initiated amount or currency:" + ErrorConstants.PATH_INSTRUCTED_AMOUNT_CURRENCY;
public static final String PATH_INSTRUCTED_AMOUNT_CURRENCY = "Data.Initiation.InstructedAmount.Currency";
public static final String INSTRUCTED_AMOUNT_CURRENCY_NOT_FOUND = "Instructed Amount Currency isn't present in " +
"the payload:" + ErrorConstants.PATH_INSTRUCTED_AMOUNT;
public static final String INSTRUCTED_AMOUNT_NOT_FOUND = "Instructed Amount isn't present in the payload:" +
ErrorConstants.PATH_INSTRUCTED_AMOUNT;
public static final String CREDITOR_ACC_SCHEME_NAME_MISMATCH = "Creditor Accounts Scheme does not match:" +
ErrorConstants.PATH_CREDIT_ACCOUNT_SCHEME;
"the payload:";
public static final String INSTRUCTED_AMOUNT_NOT_FOUND = "Instructed Amount isn't present in the payload";
public static final String CREDITOR_ACC_SCHEME_NAME_MISMATCH = "Creditor Accounts Scheme does not match";
public static final String CREDITOR_ACC_SCHEME_NAME_NOT_FOUND = "Creditor Accounts Scheme isn't present in the" +
" request or in the consent.:" + ErrorConstants.PATH_CREDIT_ACCOUNT_SCHEME;
public static final String CREDITOR_ACC_IDENTIFICATION_MISMATCH = "Creditor Account Identification does not match:"
+ ErrorConstants.PATH_CREDIT_ACCOUNT_IDENTIFICATION;
" request or in the consent.";
public static final String CREDITOR_ACC_IDENTIFICATION_MISMATCH = "Creditor Account Identification does not match";
public static final String CREDITOR_ACC_IDENTIFICATION_NOT_FOUND = "Creditor Account Identification isn't " +
"present in the request or in the consent.:" + ErrorConstants.PATH_CREDIT_ACCOUNT_IDENTIFICATION;
public static final String CREDITOR_ACC_NAME_MISMATCH = "Creditor Account Name does not match:" +
ErrorConstants.PATH_CREDIT_ACCOUNT_NAME;
"present in the request or in the consent.";
public static final String CREDITOR_ACC_NAME_MISMATCH = "Creditor Account Name does not match";
public static final String CREDITOR_ACC_SEC_IDENTIFICATION_MISMATCH = "Creditor Account Secondary Identification" +
" does not match:" + ErrorConstants.PATH_CREDIT_ACCOUNT_SEC_IDENTIFICATION;
" does not match";

public static final String DEBTOR_ACC_SCHEME_NAME_MISMATCH = "Debtor Account Scheme name does not " +
"match:" + ErrorConstants.PATH_DEBTOR_ACCOUNT_SCHEME;
public static final String DEBTOR_ACC_SCHEME_NAME_MISMATCH = "Debtor Account Scheme name does not ";
public static final String DEBTOR_ACC_SCHEME_NAME_NOT_FOUND = "Debtor Account Scheme name isn't present in the " +
"request or in the consent:" + ErrorConstants.PATH_DEBTOR_ACCOUNT_SCHEME;
"request or in the consent";
public static final String DEBTOR_ACC_IDENTIFICATION_MISMATCH = "Debtor Account Identification does " +
"not match:" + ErrorConstants.PATH_DEBTOR_ACCOUNT_IDENTIFICATION;
"not match:";
public static final String DEBTOR_ACC_IDENTIFICATION_NOT_FOUND = "Debtor Account Identification isn't present " +
"in the request or in the consent:" + ErrorConstants.PATH_DEBTOR_ACCOUNT_IDENTIFICATION;
public static final String DEBTOR_ACC_NAME_MISMATCH = "Debtor Account Name does not match:" +
ErrorConstants.PATH_DEBTOR_ACCOUNT_NAME;
"in the request or in the consent";
public static final String DEBTOR_ACC_NAME_MISMATCH = "Debtor Account Name does not match";
public static final String DEBTOR_ACC_SEC_IDENTIFICATION_MISMATCH = "Debtor Account Secondary Identification" +
" does not match:" + ErrorConstants.PATH_DEBTOR_ACCOUNT_SECOND_IDENTIFICATION;
" does not match";
public static final String PATH_DEBTOR_ACCOUNT_SECOND_IDENTIFICATION =
"Data.Initiation.DebtorAccount.SecondaryIdentification";
public static final String CREDITOR_ACC_NOT_FOUND = "Creditor Account isn't present in the request.:" +
ErrorConstants.PATH_CREDIT_ACCOUNT;
public static final String DEBTOR_ACC_MISMATCH = "Debtor Account isn't present in the request " +
"or in the consent:" + ErrorConstants.PATH_DEBTOR_ACCOUNT;
public static final String LOCAL_INSTRUMENT_MISMATCH = "Local Instrument Does Not Match:" +
public static final String CREDITOR_ACC_NOT_FOUND = "Creditor Account isn't present in the request.";
public static final String DEBTOR_ACC_MISMATCH = "Debtor Account mismatch";
public static final String LOCAL_INSTRUMENT_MISMATCH = "Local Instrument Does Not Match" +
ErrorConstants.PATH_LOCAL_INSTRUMENT;
public static final String TOKEN_REVOKE_ERROR = "Token revocation unsuccessful. :" +
ErrorConstants.PATH_CUTOFF_DATE;
public static final String CUT_OFF_DATE_ELAPSED = "Cut off time has elapsed :" +
ErrorConstants.PATH_CUTOFF_DATE;
public static final String MSG_INVALID_CONSENT_ID = "The requested consent-Id does not match with the consent-Id" +
" bound to token:" + ErrorConstants.PATH_CONSENT_ID;
" bound to token";
public static final String PAYMENT_CONSENT_STATE_INVALID = "Payment validation failed due to invalid consent" +
" state.:" + ErrorConstants.PATH_STATUS;
public static final String DATA_NOT_FOUND = "Data is not found or empty in the request.:" +
ErrorConstants.PATH_DATA;
public static final String INITIATION_NOT_FOUND = "Initiation is not found or empty in the request.:" +
ErrorConstants.PATH_INITIATION;
public static final String RISK_MISMATCH = "RISK Does Not Match.:" + ErrorConstants.PATH_RISK;
public static final String RISK_NOT_FOUND = "RISK is not found or empty in the request.:" +
ErrorConstants.PATH_RISK;

" state.";
public static final String DATA_NOT_FOUND = "Data is not found or empty in the request.";
public static final String INITIATION_NOT_FOUND = "Initiation is not found or empty in the request.";
public static final String RISK_MISMATCH = "RISK Does Not Match.";
public static final String INVALID_URI_ERROR = "Path requested is invalid. :" + ErrorConstants.PATH_URL;
public static final String COF_CONSENT_STATE_INVALID = "Confirmation of Funds validation failed due to invalid" +
" consent state.:" + ErrorConstants.PATH_STATUS;
Expand All @@ -237,7 +224,6 @@ public class ErrorConstants {

public static final String VRP_INITIATION_HANDLE_ERROR = "Error occurred while handling the VRP " +
"initiation request";

public static final String VRP_INITIATION_RETRIEVAL_ERROR = "Error occurred while handling the VRP initiation" +
" retrieval request";
public static final String PAYLOAD_FORMAT_ERROR_VALID_FROM_DATE = "Request Payload is not in correct JSON format" +
Expand Down Expand Up @@ -279,7 +265,6 @@ public class ErrorConstants {
public static final String DATE_INVALID_PARAMETER_MESSAGE = "Invalid date-time range for ValidToDateTime ";



// vrp path parameters
public static final String PATH_VALID_TO_DATE = "Data.ControlParameters.ValidToDateTime";
public static final String PATH_VALID_FROM_DATE = "Data.ControlParameters.ValidFromDateTime";
Expand All @@ -299,5 +284,51 @@ public class ErrorConstants {
public static final String PERIOD_ALIGNMENT_NOT_STRING_ERROR = "Parameter Period Alignment is not a String";
public static final String PERIOD_TYPE_NOT_STRING_ERROR = "Parameter Period Type is not a String";
public static final String NOT_STRING_ERROR = "Parameter amount or currency is not a String";

// VRP Submission flow
public static final String REMITTANCE_INFO_NOT_FOUND = "Remittance info is not present in the request.";
public static final String INSTRUCTION_IDENTIFICATION_NOT_FOUND = "Instruction Identification isn't present" +
" in the request";
public static final String END_TO_END_IDENTIFICATION_PARAMETER_NOT_FOUND = "End to End Identification isn't" +
" present in the request";
public static final String RISK_PARAMETER_MISMATCH = "RISK does not match";
public static final String INSTRUCTED_AMOUNT_PARAMETER_NOT_FOUND = "Instructed Amount isn't present in the payload";
public static final String INITIATION_REMITTANCE_INFO_PARAMETER_NOT_FOUND = "Remittance ifo present under" +
" initiation isn't present in the request";
public static final String INSTRUCTION_REMITTANCE_INFO_PARAMETER_NOT_FOUND = "Remittance ifo present under" +
" instruction isn't present in the request";
public static final String REMITTANCE_INFO_MISMATCH = "Remittance info does not match";
public static final String REMITTANCE_UNSTRUCTURED_MISMATCH = "Remittance Information Unstructured does not " +
"match";
public static final String INVALID_SUBMISSION_TYPE = "Value associated with INSTRUCTION_IDENTIFICATION key is " +
"not a String instance";
public static final String INVALID_TYPE = "Value associated with END_TO_END_IDENTIFICATION key is " +
"not a String instance";
public static final String RISK_NOT_FOUND = "Risk is not found or empty in the request.";
public static final String RISK_NOT_JSON_ERROR = "Risk parameter is not in the correct JSON format";
public static final String INSTRUCTION_NOT_FOUND = "Instruction is not found or empty in the request.";
public static final String INVALID_REQUEST_CONSENT_ID = "The consent-Id is not present in the request" +
" or it is not a String instance or there is a consentId mismatch";
public static final String INSTRUCTION_CREDITOR_ACC_NOT_JSON_ERROR = "Creditor Account present under instruction" +
" isn't present in the correct JSON format in the request.";
public static final String INITIATION_CREDITOR_ACC_NOT_JSON_ERROR = "Creditor Account present under initiation" +
" isn't present in the correct JSON format in the request.";
public static final String DEBTOR_ACC_NOT_JSON_ERROR = "Debtor Account isn't present in the correct JSON format " +
"in the request.";
public static final String INITIATION_REMITTANCE_INFO_NOT_JSON_ERROR = "Remittance info of initiation is not " +
"present in the correct JSON format in the request.";
public static final String INSTRUCTION_REMITTANCE_INFO_NOT_JSON_ERROR = "Remittance info of instruction is not" +
" present in the correct JSON format in the request.";
public static final String DEBTOR_ACC_NOT_FOUND = "Debtor Account isn't present in the request.";
public static final String DATA_NOT_JSON_ERROR = "Data parameter is not in the correct JSON format in the request";
public static final String INSTRUCTED_AMOUNT_NOT_STRING = "Value associated with Amount key is " +
"not a String instance";
public static final String INSTRUCTED_AMOUNT_CURRENCY_NOT_STRING = "Value associated with Currency key is " +
"not a String instance";
public static final String INSTRUCTED_AMOUNT_NOT_JSON_ERROR = "Instructed Amount is not in the correct JSON " +
"format in the request";
public static final String INITIATION_NOT_JSON = "Initiation is not in the correct JSON " +
"format in the request";
public static final String INSTRUCTION_NOT_JSON = "Instruction is not in the correct JSON format in the request";
}

Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,15 @@ public class ConsentExtensionConstants {
public static final Object CONTROL_PARAMETER_AMOUNT_TITLE = "Maximum payment amount per ";
public static final String VRP_ACCOUNT = "vrpAccount";
public static final Object CONTROL_PARAMETER_VALID_FROM_DATE_TITLE = "Valid from date and time";

// VRP submission flow
public static final String ACCOUNT_IDS = "accountIds";
public static final String INSTRUCTION = "Instruction";
public static final String REMITTANCE_INFO = "RemittanceInformation";
public static final String REFERENCE = "Reference";
public static final String UNSTRUCTURED = "Unstructured";
public static final String CONTEXT_CODE = "PaymentContextCode";
public static final String PAYMENT_TYPE = "PaymentType";
public static final String PREVIOUS_PAID_AMOUNT = "prevPaidAmount";
public static final String PREVIOUS_LAST_PAYMENT_DATE = "prevLastPaymentDate";
}
Loading
Loading