diff --git a/collections/dfsp/provisioning/proxy_testing/proxy1.json b/collections/dfsp/provisioning/proxy_testing/proxy1.json new file mode 100644 index 00000000..a460407e --- /dev/null +++ b/collections/dfsp/provisioning/proxy_testing/proxy1.json @@ -0,0 +1,1376 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Setup Accounts and Limits", + "meta": { + "info": "DFSP account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP" + }, + "description": "Add DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PROXY1_DFSP_ID}", + "currency": "{$inputs.currency}", + "isProxy": true + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits - DFSP" + }, + "description": "Add initial position and limits - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 10000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "DFSP Get Status Request before deposit" + }, + "description": "DFSP Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"dfspSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "meta": { + "info": "Deposit Funds in Settlement Account - DFSP" + }, + "description": "Deposit Funds in Settlement Account - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/accounts/{$environment.dfspSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}", + "id": "{$environment.dfspSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.dfspfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.dfspfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('dfspfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('dfspfundsInPrepareAmount', 5000);" + ] + } + } + }, + { + "id": 5, + "meta": { + "info": "DFSP Get Status Request after deposit" + }, + "description": "DFSP Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "DFSP Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.dfspSettlementAccountBalanceAfterFundsIn).to.equal(+environment.dfspSettlementAccountBalanceBeforeFundsIn - +environment.dfspfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "1000", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 2, + "name": "Setup Callback Endpoints", + "meta": { + "info": "DFSP callbacks" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP callback - AUTHORIZATIONS" + }, + "description": "Add DFSP callback - AUTHORIZATIONS", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_AUTHORIZATIONS", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT" + }, + "description": "Add DFSP callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add DFSP callback - PARTIES GET" + }, + "description": "Add DFSP callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add DFSP callback - PARTIES PUT" + }, + "description": "Add DFSP callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add DFSP callback - PARTIES PUT Error" + }, + "description": "Add DFSP callback - PARTIES PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add DFSP callback - QUOTES" + }, + "description": "Add DFSP callback - QUOTES", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add DFSP callback - TXN REQUEST" + }, + "description": "Add DFSP callback - TXN REQUEST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add DFSP callback - TRANSFERS POST" + }, + "description": "Add DFSP callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add DFSP callback - TRANSFERS PUT" + }, + "description": "Add DFSP callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add DFSP callback - TRANSFERS ERROR" + }, + "description": "Add DFSP callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER POST" + }, + "description": "Add DFSP callback - BULK-TRANSFER POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER PUT" + }, + "description": "Add DFSP callback - BULK-TRANSFER PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER ERROR" + }, + "description": "Add DFSP callback - BULK-TRANSFER ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID GET" + }, + "description": "Add DFSP callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 3, + "name": "Setup Notification Emails", + "meta": { + "info": "DFSP notification_emails" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY1_DFSP_ID}" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY1_DFSP_ID}" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + } + ] +} \ No newline at end of file diff --git a/collections/dfsp/provisioning/proxy_testing/proxy2.json b/collections/dfsp/provisioning/proxy_testing/proxy2.json new file mode 100644 index 00000000..1dd6b4fb --- /dev/null +++ b/collections/dfsp/provisioning/proxy_testing/proxy2.json @@ -0,0 +1,1376 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Setup Accounts and Limits", + "meta": { + "info": "DFSP account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP" + }, + "description": "Add DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PROXY2_DFSP_ID}", + "currency": "{$inputs.currency}", + "isProxy": true + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits - DFSP" + }, + "description": "Add initial position and limits - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 10000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "DFSP Get Status Request before deposit" + }, + "description": "DFSP Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"dfspSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "meta": { + "info": "Deposit Funds in Settlement Account - DFSP" + }, + "description": "Deposit Funds in Settlement Account - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/accounts/{$environment.dfspSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}", + "id": "{$environment.dfspSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.dfspfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.dfspfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('dfspfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('dfspfundsInPrepareAmount', 5000);" + ] + } + } + }, + { + "id": 5, + "meta": { + "info": "DFSP Get Status Request after deposit" + }, + "description": "DFSP Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "DFSP Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.dfspSettlementAccountBalanceAfterFundsIn).to.equal(+environment.dfspSettlementAccountBalanceBeforeFundsIn - +environment.dfspfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "1000", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 2, + "name": "Setup Callback Endpoints", + "meta": { + "info": "DFSP callbacks" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP callback - AUTHORIZATIONS" + }, + "description": "Add DFSP callback - AUTHORIZATIONS", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_AUTHORIZATIONS", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT" + }, + "description": "Add DFSP callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add DFSP callback - PARTIES GET" + }, + "description": "Add DFSP callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add DFSP callback - PARTIES PUT" + }, + "description": "Add DFSP callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add DFSP callback - PARTIES PUT Error" + }, + "description": "Add DFSP callback - PARTIES PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add DFSP callback - QUOTES" + }, + "description": "Add DFSP callback - QUOTES", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add DFSP callback - TXN REQUEST" + }, + "description": "Add DFSP callback - TXN REQUEST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add DFSP callback - TRANSFERS POST" + }, + "description": "Add DFSP callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add DFSP callback - TRANSFERS PUT" + }, + "description": "Add DFSP callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add DFSP callback - TRANSFERS ERROR" + }, + "description": "Add DFSP callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER POST" + }, + "description": "Add DFSP callback - BULK-TRANSFER POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER PUT" + }, + "description": "Add DFSP callback - BULK-TRANSFER PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER ERROR" + }, + "description": "Add DFSP callback - BULK-TRANSFER ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PROXY1_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID GET" + }, + "description": "Add DFSP callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.PROXY1_CALLBACK_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.PROXY1_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 3, + "name": "Setup Notification Emails", + "meta": { + "info": "DFSP notification_emails" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY2_DFSP_ID}" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY2_DFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY2_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY2_DFSP_ID}" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + } + ] +} \ No newline at end of file diff --git a/collections/dfsp/provisioning/proxy_testing/testdfsp.json b/collections/dfsp/provisioning/proxy_testing/testdfsp.json new file mode 100644 index 00000000..5bec6d98 --- /dev/null +++ b/collections/dfsp/provisioning/proxy_testing/testdfsp.json @@ -0,0 +1,1427 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Setup Accounts and Limits", + "meta": { + "info": "DFSP account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP" + }, + "description": "Add DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits - DFSP" + }, + "description": "Add initial position and limits - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 10000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "DFSP Get Status Request before deposit" + }, + "description": "DFSP Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"dfspSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "meta": { + "info": "Deposit Funds in Settlement Account - DFSP" + }, + "description": "Deposit Funds in Settlement Account - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/accounts/{$environment.dfspSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}", + "id": "{$environment.dfspSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.dfspfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.dfspfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('dfspfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('dfspfundsInPrepareAmount', 5000);" + ] + } + } + }, + { + "id": 5, + "meta": { + "info": "DFSP Get Status Request after deposit" + }, + "description": "DFSP Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "DFSP Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.dfspSettlementAccountBalanceAfterFundsIn).to.equal(+environment.dfspSettlementAccountBalanceBeforeFundsIn - +environment.dfspfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "1000", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 2, + "name": "Setup Callback Endpoints", + "meta": { + "info": "DFSP callbacks" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP callback - AUTHORIZATIONS" + }, + "description": "Add DFSP callback - AUTHORIZATIONS", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_AUTHORIZATIONS", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT" + }, + "description": "Add DFSP callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add DFSP callback - PARTIES GET" + }, + "description": "Add DFSP callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add DFSP callback - PARTIES PUT" + }, + "description": "Add DFSP callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add DFSP callback - PARTIES PUT Error" + }, + "description": "Add DFSP callback - PARTIES PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add DFSP callback - QUOTES" + }, + "description": "Add DFSP callback - QUOTES", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add DFSP callback - TXN REQUEST" + }, + "description": "Add DFSP callback - TXN REQUEST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add DFSP callback - TRANSFERS POST" + }, + "description": "Add DFSP callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add DFSP callback - TRANSFERS PUT" + }, + "description": "Add DFSP callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add DFSP callback - TRANSFERS ERROR" + }, + "description": "Add DFSP callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER POST" + }, + "description": "Add DFSP callback - BULK-TRANSFER POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER PUT" + }, + "description": "Add DFSP callback - BULK-TRANSFER PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER ERROR" + }, + "description": "Add DFSP callback - BULK-TRANSFER ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID GET" + }, + "description": "Add DFSP callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 3, + "name": "Setup Notification Emails", + "meta": { + "info": "DFSP notification_emails" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY_PAYEEFSP_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning_dfsp/newdfsp.json" + } + }, + { + "id": 4, + "type": "Oracle Onboarding", + "name": "Oracle Onboarding", + "requests": [ + { + "id": 1, + "meta": { + "info": "Register MSISDN Oracle" + }, + "description": "Register MSISDN Oracle", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "als_admin" + }, + "url": "{$inputs.HOST_ORACLE}", + "operationPath": "/participants/{Type}/{ID}", + "method": "post", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID}" + }, + "body": { + "fspId": "{$inputs.PROXY_PAYEEFSP_ID}" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.participants+json;version=1.0", + "Accept": "application/vnd.interoperability.participants+json;version=1", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 or errorCode 2001 already exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.body.errorInformation.errorCode).to.equal(\"2001\")", + "} else {", + " expect(response.status).to.equal(200)", + "}" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning/MojaloopHub_Setup/hub.json" + } + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/api-tests/Quotes/quotes-negative-scenarios.json b/collections/hub/golden_path/api-tests/Quotes/quotes-negative-scenarios.json index 38739aa2..3fe3ce0e 100644 --- a/collections/hub/golden_path/api-tests/Quotes/quotes-negative-scenarios.json +++ b/collections/hub/golden_path/api-tests/Quotes/quotes-negative-scenarios.json @@ -33,8 +33,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -166,7 +166,7 @@ }, { "id": 14, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')", "" @@ -276,8 +276,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -409,7 +409,7 @@ }, { "id": 14, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')", "" @@ -519,8 +519,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -633,8 +633,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -760,7 +760,7 @@ }, { "id": 14, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')", "" @@ -871,8 +871,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1005,7 +1005,7 @@ }, { "id": 14, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')", "" @@ -1140,8 +1140,8 @@ ] }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1241,8 +1241,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1358,8 +1358,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1475,8 +1475,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1592,8 +1592,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1707,8 +1707,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1822,8 +1822,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1937,8 +1937,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2052,8 +2052,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/bug fixes/Test for 4 decimal points #949.json b/collections/hub/golden_path/bug fixes/Test for 4 decimal points #949.json index d7697fe1..11c4d367 100644 --- a/collections/hub/golden_path/bug fixes/Test for 4 decimal points #949.json +++ b/collections/hub/golden_path/bug fixes/Test for 4 decimal points #949.json @@ -31,8 +31,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/bug fixes/Test for Bugfix #1378 - extension list missing.json b/collections/hub/golden_path/bug fixes/Test for Bugfix #1378 - extension list missing.json index d845ca42..b9b5aae8 100644 --- a/collections/hub/golden_path/bug fixes/Test for Bugfix #1378 - extension list missing.json +++ b/collections/hub/golden_path/bug fixes/Test for Bugfix #1378 - extension list missing.json @@ -31,8 +31,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -135,8 +135,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/bug fixes/Test for Bugfix #2697 - Central-Ledger Fulfil Handler does not correctly invalidate requests with an incorrect-non-existent FSP-ID in the FSPIOP-Destination header.json b/collections/hub/golden_path/bug fixes/Test for Bugfix #2697 - Central-Ledger Fulfil Handler does not correctly invalidate requests with an incorrect-non-existent FSP-ID in the FSPIOP-Destination header.json index 1ab87491..76841b11 100644 --- a/collections/hub/golden_path/bug fixes/Test for Bugfix #2697 - Central-Ledger Fulfil Handler does not correctly invalidate requests with an incorrect-non-existent FSP-ID in the FSPIOP-Destination header.json +++ b/collections/hub/golden_path/bug fixes/Test for Bugfix #2697 - Central-Ledger Fulfil Handler does not correctly invalidate requests with an incorrect-non-existent FSP-ID in the FSPIOP-Destination header.json @@ -239,7 +239,7 @@ "id": 6, "description": "Payer Callback content-type to be transfers", "exec": [ - "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version=1.1')" + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')" ] }, { @@ -605,7 +605,7 @@ "id": 6, "description": "Payer Callback content-type to be transfers", "exec": [ - "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version=1.1')" + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')" ] }, { diff --git a/collections/hub/golden_path/bug fixes/Test for Bugfix #742 - Error code check.json b/collections/hub/golden_path/bug fixes/Test for Bugfix #742 - Error code check.json index bcbfdf9d..0e0fbc48 100644 --- a/collections/hub/golden_path/bug fixes/Test for Bugfix #742 - Error code check.json +++ b/collections/hub/golden_path/bug fixes/Test for Bugfix #742 - Error code check.json @@ -142,7 +142,7 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "transferId": "{$function.generic.generateUUID}+´+1´", + "transferId": "{$function.generic.generateID}+´+1´", "payerFsp": "{$inputs.fromFspId}", "payeeFsp": "{$inputs.payeefsp}", "amount": { diff --git a/collections/hub/golden_path/bug fixes/Tests for Bugfix #990 and #1016 - Quotes.json b/collections/hub/golden_path/bug fixes/Tests for Bugfix #990 and #1016 - Quotes.json index a2085fa6..e89c9d4d 100644 --- a/collections/hub/golden_path/bug fixes/Tests for Bugfix #990 and #1016 - Quotes.json +++ b/collections/hub/golden_path/bug fixes/Tests for Bugfix #990 and #1016 - Quotes.json @@ -31,8 +31,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -197,7 +197,7 @@ }, "body": { "quoteId": "{$environment.quoteidx}", - "transactionId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -307,7 +307,7 @@ }, "body": { "quoteId": "{$environment.quoteidx}", - "transactionId": "{$function.generic.generateUUID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -431,8 +431,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -518,8 +518,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -605,8 +605,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -692,8 +692,8 @@ "FSPIOP-Destination": "payeefspNOTFOUND" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -779,8 +779,8 @@ "FSPIOP-Destination": "{$inputs.payeefsp}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -873,8 +873,8 @@ "FSPIOP-Destination": "{$inputs.payeefsp}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -948,10 +948,10 @@ "asynchronous": true }, "operationPath": "/quotes/{ID}", - "path": "/quotes/{$function.generic.generateUUID}", + "path": "/quotes/{$function.generic.generateID}", "method": "put", "params": { - "ID": "{$function.generic.generateUUID}" + "ID": "{$function.generic.generateID}" }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "headers": { @@ -1009,10 +1009,10 @@ "asynchronous": true }, "operationPath": "/quotes/{ID}", - "path": "/quotes/{$function.generic.generateUUID}", + "path": "/quotes/{$function.generic.generateID}", "method": "get", "params": { - "ID": "{$function.generic.generateUUID}" + "ID": "{$function.generic.generateID}" }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "headers": { @@ -1061,10 +1061,10 @@ "asynchronous": true }, "operationPath": "/quotes/{ID}", - "path": "/quotes/{$function.generic.generateUUID}", + "path": "/quotes/{$function.generic.generateID}", "method": "get", "params": { - "ID": "{$function.generic.generateUUID}" + "ID": "{$function.generic.generateID}" }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "headers": { @@ -1136,10 +1136,10 @@ "asynchronous": true }, "operationPath": "/quotes/{ID}", - "path": "/quotes/{$function.generic.generateUUID}", + "path": "/quotes/{$function.generic.generateID}", "method": "get", "params": { - "ID": "{$function.generic.generateUUID}" + "ID": "{$function.generic.generateID}" }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "headers": { diff --git a/collections/hub/golden_path/bug fixes/Tests for Bugfix #998 - Quoting service not using most recent endpoint.json b/collections/hub/golden_path/bug fixes/Tests for Bugfix #998 - Quoting service not using most recent endpoint.json index 34c3140e..8d0e08bf 100644 --- a/collections/hub/golden_path/bug fixes/Tests for Bugfix #998 - Quoting service not using most recent endpoint.json +++ b/collections/hub/golden_path/bug fixes/Tests for Bugfix #998 - Quoting service not using most recent endpoint.json @@ -88,8 +88,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -249,8 +249,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/bug fixes/other-bug-fixes.json b/collections/hub/golden_path/bug fixes/other-bug-fixes.json index f6491d0c..40edcd02 100644 --- a/collections/hub/golden_path/bug fixes/other-bug-fixes.json +++ b/collections/hub/golden_path/bug fixes/other-bug-fixes.json @@ -1,5 +1,6 @@ { - "name": "multi", + "options": {}, + "name": "hub_golden_path_bug fixes_other-bug-fixes", "test_cases": [ { "id": 1, @@ -7,6 +8,9 @@ "meta": { "info": "Check Settlements Error #956" }, + "fileInfo": { + "path": "hub/golden_path/bug fixes/other-bug-fixes.json" + }, "requests": [ { "id": 6, @@ -58,83 +62,6 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" } }, - { - "id": 7, - "meta": { - "info": "Check FSPIOP Headers from Switch #883" - }, - "description": "Check FSPIOP Headers from Switch #883", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "operationPath": "/parties/{Type}/{ID}", - "path": "/parties/MSISDN/{$environment.msisdnid}", - "method": "get", - "params": { - "Type": "MSISDN", - "ID": "{$environment.msisdnid}" - }, - "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", - "ignoreCallbacks": true, - "headers": { - "Accept": "{$inputs.acceptParties}", - "Date": "{$function.generic.curDate}", - "FSPIOP-Source": "{$inputs.SIMPAYER_NAME}", - "Authorization": "{$inputs.PAYER_BEARER_TOKEN}", - "Content-Type": "{$inputs.contentTypeParties}" - }, - "scriptingEngine": "javascript", - "tests": { - "assertions": [ - { - "id": 1, - "description": "Response code status 202", - "exec": [ - "expect(response.status).to.equal(202)" - ] - }, - { - "id": 2, - "description": "Expected error code is 3204", - "exec": [ - "expect(environment.payercallbackx.data.errorInformation.errorCode).to.equal('3204');" - ] - }, - { - "id": 3, - "description": "Expected error description - party not Found", - "exec": [ - "expect(environment.payercallbackx.data.errorInformation.errorDescription).to.equal('Party not found');" - ] - } - ] - }, - "scripts": { - "preRequest": { - "exec": [ - "environment.msisdnid = 1999999;", - "", - "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " await websocket.connect(environment.PAYERFSP_SDK_TESTAPI_WS_URL + '/callbacks/'+environment.msisdnid, 'payercallback')", - "} ", - " console.log(environment.PAYERFSP_SDK_TESTAPI_WS_URL + '/callbacks/'+environment.msisdnid);" - ] - }, - "postRequest": { - "exec": [ - "if (environment.ENABLE_WS_ASSERTIONS===true) {", - "", - " ", - " environment.payercallbackx = await websocket.getMessage('payercallback', environment.WS_ASSERTION_TIMEOUT)", - "}", - "console.log(environment.payercallbackx);" - ] - } - } - }, { "id": 8, "meta": { @@ -163,7 +90,7 @@ "FSPIOP-HTTP-Method": "POST" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "payerFsp": "{$inputs.SIMPAYER_NAME}", "payeeFsp": "payeefspNOTFOUND", "amount": { @@ -193,13 +120,17 @@ }, { "id": 3, - "description": "Error code is 3100", + "description": "Error code is 3200", "exec": [ - "expect(environment.payercallbackx.data.errorInformation.errorCode).to.equal('3100');" + "expect(environment.payercallbackx.data.errorInformation.errorCode).to.equal('3200');" ] } ] }, + "params": { + "Type": "", + "ID": "" + }, "scripts": { "preRequest": { "exec": [ @@ -224,10 +155,7 @@ } } } - ], - "fileInfo": { - "path": "hub/golden_path/bug fixes/other-bug-fixes.json" - } + ] } ] } \ No newline at end of file diff --git a/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participant.json b/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participant.json index 90fabbe7..b6683eaf 100644 --- a/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participant.json +++ b/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participant.json @@ -70,8 +70,8 @@ "Authorization": "{$inputs.TESTFSP1_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "MSISDN", @@ -489,8 +489,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "MSISDN", diff --git a/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participants_accounts.json b/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participants_accounts.json index 097fc99f..f6870a0c 100644 --- a/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participants_accounts.json +++ b/collections/hub/golden_path/feature_tests/Active_Inactive_participants/active_and_inactive_participants_accounts.json @@ -107,8 +107,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "MSISDN", @@ -442,19 +442,19 @@ }, { "id": 12, - "description": "Payer side Callback Body - errorCode is 3100", + "description": "Payer side Callback Body - errorCode is 3200", "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.sim1Callback.data.errorInformation['errorCode']).to.equal('3100')", + " expect(requestVariables.sim1Callback.data.errorInformation['errorCode']).to.equal('3200')", "}" ] }, { "id": 13, - "description": "Payer side Callback Body - Error Description is Generic validation error", + "description": "Payer side Callback Body - Error Description is Generic ID not found", "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.sim1Callback.data.errorInformation['errorDescription']).to.include('Generic validation error - Participant')", + " expect(requestVariables.sim1Callback.data.errorInformation['errorDescription']).to.include('Generic ID not found - Payer proxy or payee proxy not found')", "}" ] } @@ -524,8 +524,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "MSISDN", diff --git a/collections/hub/golden_path/feature_tests/backward_compatibility/fspiop_protocol_validation.json b/collections/hub/golden_path/feature_tests/backward_compatibility/fspiop_protocol_validation.json index b6176f8a..f67e93ca 100644 --- a/collections/hub/golden_path/feature_tests/backward_compatibility/fspiop_protocol_validation.json +++ b/collections/hub/golden_path/feature_tests/backward_compatibility/fspiop_protocol_validation.json @@ -477,8 +477,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -681,8 +681,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -807,8 +807,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1069,8 +1069,8 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/block_transfer.json b/collections/hub/golden_path/feature_tests/block_transfer.json index e6ebb873..56fca652 100644 --- a/collections/hub/golden_path/feature_tests/block_transfer.json +++ b/collections/hub/golden_path/feature_tests/block_transfer.json @@ -328,8 +328,8 @@ "scripts": { "preRequest": { "exec": [ - "requestVariables.quoteId = '{$function.generic.generateUUID}'", - "requestVariables.transactionId = '{$function.generic.generateUUID}'", + "requestVariables.quoteId = '{$function.generic.generateID}'", + "requestVariables.transactionId = '{$function.generic.generateID}'", "", "console.log(`environment.payerNetDebitCapLimit=${environment.payerNetDebitCapLimit}`)", "", @@ -1132,8 +1132,8 @@ "scripts": { "preRequest": { "exec": [ - "requestVariables.quoteId = '{$function.generic.generateUUID}'", - "requestVariables.transactionId = '{$function.generic.generateUUID}'", + "requestVariables.quoteId = '{$function.generic.generateID}'", + "requestVariables.transactionId = '{$function.generic.generateID}'", "", "console.log(`environment.payerNetDebitCapLimit=${environment.payerNetDebitCapLimit}`)", "", diff --git a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_commit.json b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_commit.json index cd35c32b..ccd26e0d 100644 --- a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_commit.json +++ b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_commit.json @@ -34,8 +34,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -551,8 +551,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_reject.json b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_reject.json index 0b2e1ea3..9b6966e5 100644 --- a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_reject.json +++ b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/fulfill_reject.json @@ -34,8 +34,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -546,8 +546,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/original_transfer_at_committed.json b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/original_transfer_at_committed.json index 4c8390aa..1693a78e 100644 --- a/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/original_transfer_at_committed.json +++ b/collections/hub/golden_path/feature_tests/duplicate_handling/transfers/original_transfer_at_committed.json @@ -95,8 +95,8 @@ "FSPIOP-Destination": "{$inputs.SIMPAYEE_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -292,7 +292,7 @@ }, { "id": 17, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')", "" @@ -610,7 +610,7 @@ }, { "id": 17, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')", "" @@ -752,9 +752,9 @@ }, { "id": 17, - "description": "Callback Header - content-type is application/vnd.interoperability.quotes+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ - "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.transfers+json;version=1')", + "expect(callback.headers['content-type']).to.have.string('{$inputs.expectedTransfersVersion}')", "" ] }, diff --git a/collections/hub/golden_path/feature_tests/funds_in/funds_in_ttk.json b/collections/hub/golden_path/feature_tests/funds_in/funds_in_ttk.json index 7f99bf2b..4a4aaa46 100644 --- a/collections/hub/golden_path/feature_tests/funds_in/funds_in_ttk.json +++ b/collections/hub/golden_path/feature_tests/funds_in/funds_in_ttk.json @@ -138,7 +138,7 @@ }, "scriptingEngine": "javascript", "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", diff --git a/collections/hub/golden_path/feature_tests/funds_out/Reserve&Abort/funds_out_abort.json b/collections/hub/golden_path/feature_tests/funds_out/Reserve&Abort/funds_out_abort.json index f65762b0..9ccad3af 100644 --- a/collections/hub/golden_path/feature_tests/funds_out/Reserve&Abort/funds_out_abort.json +++ b/collections/hub/golden_path/feature_tests/funds_out/Reserve&Abort/funds_out_abort.json @@ -138,7 +138,7 @@ }, "scriptingEngine": "javascript", "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsOutPrepareReserve", "reason": "string", diff --git a/collections/hub/golden_path/feature_tests/funds_out/Reserve&Commit/funds_out_commit.json b/collections/hub/golden_path/feature_tests/funds_out/Reserve&Commit/funds_out_commit.json index ae54c282..3baef085 100644 --- a/collections/hub/golden_path/feature_tests/funds_out/Reserve&Commit/funds_out_commit.json +++ b/collections/hub/golden_path/feature_tests/funds_out/Reserve&Commit/funds_out_commit.json @@ -138,7 +138,7 @@ }, "scriptingEngine": "javascript", "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsOutPrepareReserve", "reason": "string", diff --git a/collections/hub/golden_path/feature_tests/get_transfers.json b/collections/hub/golden_path/feature_tests/get_transfers.json index 020b03da..81c1f8b6 100644 --- a/collections/hub/golden_path/feature_tests/get_transfers.json +++ b/collections/hub/golden_path/feature_tests/get_transfers.json @@ -211,9 +211,9 @@ "scripts": { "preRequest": { "exec": [ - "requestVariables.quoteId = \"{$function.generic.generateUUID}\"", + "requestVariables.quoteId = \"{$function.generic.generateID}\"", "", - "requestVariables.transactionId = \"{$function.generic.generateUUID}\"", + "requestVariables.transactionId = \"{$function.generic.generateID}\"", "", "if(environment.ENABLE_JWS_SIGNING) {", " custom.jws.signRequest(environment.TTKFSP_JWS_KEY)", @@ -442,7 +442,7 @@ }, { "id": 21, - "description": "Payer FSP: 'content-type' should be 'application/vnd.interoperability.transfers+json;version=1.0'", + "description": "Payer FSP: 'content-type' should be correct", "exec": [ "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}');" ] @@ -989,7 +989,7 @@ "scripts": { "preRequest": { "exec": [ - "requestVariables.transferId = '{$function.generic.generateUUID}'" + "requestVariables.transferId = '{$function.generic.generateID}'" ] }, "postRequest": { diff --git a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path.json b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path.json index c876a076..f590bc7c 100644 --- a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path.json +++ b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path.json @@ -242,9 +242,9 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", - "transactionRequestId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_accent_unicode.json b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_accent_unicode.json index 5d139961..6a11c36a 100644 --- a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_accent_unicode.json +++ b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_accent_unicode.json @@ -236,8 +236,8 @@ "FSPIOP-Destination": "{$inputs.toAccentIdFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_burmese_unicode.json b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_burmese_unicode.json index b94e016e..9c9b9d79 100644 --- a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_burmese_unicode.json +++ b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_burmese_unicode.json @@ -236,8 +236,8 @@ "FSPIOP-Destination": "{$inputs.toBurmeseIdFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_subid.json b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_subid.json index 43aa944a..706e455c 100644 --- a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_subid.json +++ b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_subid.json @@ -247,8 +247,8 @@ "Authorization": "{$inputs.TTK_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_with_balance_checks.json b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_with_balance_checks.json index 0cfe11e2..8ef5403a 100644 --- a/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_with_balance_checks.json +++ b/collections/hub/golden_path/feature_tests/p2p_money_transfer/p2p_happy_path_with_balance_checks.json @@ -345,9 +345,9 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", - "transactionRequestId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/patch_notifications/patch_notification.json b/collections/hub/golden_path/feature_tests/patch_notifications/patch_notification.json index 12eacf47..ef507f22 100644 --- a/collections/hub/golden_path/feature_tests/patch_notifications/patch_notification.json +++ b/collections/hub/golden_path/feature_tests/patch_notifications/patch_notification.json @@ -569,7 +569,7 @@ "id": 6, "description": "Payer Callback content-type to be transfers", "exec": [ - "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version=1.1')" + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')" ] }, { diff --git a/collections/hub/golden_path/feature_tests/post_scenarios/positive.json b/collections/hub/golden_path/feature_tests/post_scenarios/positive.json index 74031e9a..66a933c2 100644 --- a/collections/hub/golden_path/feature_tests/post_scenarios/positive.json +++ b/collections/hub/golden_path/feature_tests/post_scenarios/positive.json @@ -687,24 +687,6 @@ "}" ] }, - { - "id": 59, - "description": "Payee Request: Content-Type is 'application/vnd.interoperability.parties+json;version=1.0'", - "exec": [ - "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.payeeRequest.headers['content-type']).to.match(/application\\/vnd\\.interoperability\\.parties\\+json;version=1(\\.\\d)?/)", - "}" - ] - }, - { - "id": 60, - "description": "Payee Request: Accept matches 'application/vnd.interoperability.parties+json;version=1(\\.\\d)?/' ", - "exec": [ - "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.payeeRequest.headers['accept']).to.match(/application\\/vnd\\.interoperability\\.parties\\+json;version=1(\\.\\d)?/)", - "}" - ] - }, { "id": 61, "description": "Payee Request: Date is not null", @@ -849,15 +831,6 @@ "}" ] }, - { - "id": 77, - "description": "Payee Request: 'accept' header is the same as sent in the request", - "exec": [ - "if (environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.payeeSideTransferRequest.headers['content-type']).to.match(/application\\/vnd\\.interoperability\\.transfers\\+json;version=1(\\.\\d)?/)", - "}" - ] - }, { "id": 78, "description": "Payee Request: 'fspiop-http-method' i s POST", @@ -941,7 +914,7 @@ }, { "id": 87, - "description": "Payer Callback: 'content-type' header is 'application/vnd.interoperability.transfers+json;version=1.0'", + "description": "Payer Callback: 'content-type' header is correct", "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " expect(requestVariables.payerSideTransferCallback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')", diff --git a/collections/hub/golden_path/feature_tests/post_scenarios/reserve_notification_positive_testfsp1_testfsp2.json b/collections/hub/golden_path/feature_tests/post_scenarios/reserve_notification_positive_testfsp1_testfsp2.json index 6aa0710d..85241184 100644 --- a/collections/hub/golden_path/feature_tests/post_scenarios/reserve_notification_positive_testfsp1_testfsp2.json +++ b/collections/hub/golden_path/feature_tests/post_scenarios/reserve_notification_positive_testfsp1_testfsp2.json @@ -808,7 +808,7 @@ }, { "id": 59, - "description": "On testfsp2 content-type should be application/vnd.interoperability.parties+json;version=1.0", + "description": "On testfsp2 content-type should be correct", "exec": [ "", "", @@ -817,17 +817,6 @@ "}" ] }, - { - "id": 60, - "description": "On Payee FSP 'accept' header should be 'application/vnd.interoperability.parties+json;version=1.1'", - "exec": [ - "", - "", - "if (environment.TEST_NOTIFICATIONS && environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.payeeRequest.headers['accept']).to.match(/application\\/vnd\\.interoperability\\.parties\\+json;version=1(\\.\\d)?/)", - "}" - ] - }, { "id": 61, "description": "On Payee FSP date cannot be undefined", @@ -863,7 +852,7 @@ }, { "id": 64, - "description": "On testfsp2 'content-type' header should be 'application/vnd.interoperability.parties+json;version=1.0'", + "description": "On testfsp2 'content-type' header should be correct", "exec": [ "", "", @@ -1071,11 +1060,11 @@ }, { "id": 81, - "description": "On Payer FSP 'content-type' should be 'application/vnd.interoperability.transfers+json;version=1.1'", + "description": "On Payer FSP 'content-type' should be correct", "exec": [ "/* Disabled temporarily", "if (environment.TEST_NOTIFICATIONS && environment.ENABLE_WS_ASSERTIONS===true) {", - " expect(requestVariables.payerSideTransferCallback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version=1.1')", + " expect(requestVariables.payerSideTransferCallback.headers['content-type']).to.equal('{$inputs.expectedTransfersVersion}')", "}*/" ] }, diff --git a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/fulfil-reserved-v1.0.json b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/fulfil-reserved-v1.0.json index 0d326062..10e98a6e 100644 --- a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/fulfil-reserved-v1.0.json +++ b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/fulfil-reserved-v1.0.json @@ -37,8 +37,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_abort_v1.1.json b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_abort_v1.1.json index fbd5a9b0..85338fbf 100644 --- a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_abort_v1.1.json +++ b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_abort_v1.1.json @@ -121,7 +121,7 @@ "FSPIOP-Destination": "{$inputs.NORESPONSE_SIMPAYEE_NAME}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "payerFsp": "{$inputs.fromFspId}", "payeeFsp": "{$inputs.NORESPONSE_SIMPAYEE_NAME}", "amount": { @@ -450,7 +450,7 @@ }, { "id": 14, - "description": "Callback Header - content-type is application/vnd.interoperability.transfers+json;version=1.0", + "description": "Callback Header - content-type is correct", "exec": [ "expect(callback.headers['content-type']).to.equal('{$inputs.contentTypeTransfers}')", "" @@ -536,7 +536,51 @@ "postRequest": { "exec": [ "", - "" + "// lets get retry config", + "const maxRetryCount = Number.parseFloat(environment.RETRY_MAX_ATTEMPTS) || 20", + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "", + "async function main() {", + " const expectedBalance = +environment[environment.fromFspId + 'PositionBeforePrepare']", + "", + " let _response = response", + "", + " for (let retryCount = 0 ; retryCount < maxRetryCount; retryCount++) {", + " console.log(`retry-count=${retryCount+1}, max-count=${maxRetryCount}, max-wait=${maxRetryWait}`)", + " ", + " const isOk = +response.body?.[0]?.value === expectedBalance;", + " ", + " if (isOk) {", + " console.log(`Everything is OK, let's continue`)", + " response = _response", + " break;", + " } else {", + " console.log(`Everything is NOT OK, let's wait for ${maxRetryWait}ms, and try again...`)", + " await custom.sleep(maxRetryWait)", + " const axiosRes = await makeRequest()", + " _response = { code: axiosRes.status, status: axiosRes.statusText, body: axiosRes.data }", + " console.log(`retryCount: ${retryCount+1} - value: `, axiosRes.data?.[0]?.value)", + " }", + " }", + "}", + "", + "async function makeRequest() {", + " const reqParams = {", + " method: 'get', ", + " url: `{$inputs.HOST_CENTRAL_LEDGER}/participants/{$inputs.fromFspId}/positions`,", + " headers: {", + " 'Content-Type': `{$inputs.contentTypeTransfers}`,", + " Accept: `{$inputs.acceptTransfers}`,", + " Date: `{$function.generic.curDate}`,", + " 'FSPIOP-Source': `{$inputs.fromFspId}`,", + " Authorization: `{$inputs.TTK_BEARER_TOKEN}`", + " }", + " };", + " ", + " return axios(reqParams);", + "}", + "", + "await main()" ] }, "preRequest": { diff --git a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_fulfillment.json b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_fulfillment.json index b0eb7d0d..e95e947c 100644 --- a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_fulfillment.json +++ b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_fulfillment.json @@ -118,8 +118,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_timestamp.json b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_timestamp.json index 768cd5af..1749aed2 100644 --- a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_timestamp.json +++ b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payee_invalid_timestamp.json @@ -118,8 +118,8 @@ }, "url": "{$inputs.HOST_QUOTING_SERVICE}", "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payer_transfer_timeout.json b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payer_transfer_timeout.json index a2754ea0..187f1ca0 100644 --- a/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payer_transfer_timeout.json +++ b/collections/hub/golden_path/feature_tests/transfer_negative_scenarios/payer_transfer_timeout.json @@ -123,7 +123,7 @@ "FSPIOP-Destination": "{$inputs.NORESPONSE_SIMPAYEE_NAME}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "payerFsp": "{$inputs.fromFspId}", "payeeFsp": "{$inputs.NORESPONSE_SIMPAYEE_NAME}", "amount": { diff --git a/collections/hub/golden_path/fx/api_schema_validation/fx_quotes.json b/collections/hub/golden_path/fx/api_schema_validation/fx_quotes.json new file mode 100644 index 00000000..e4c5ae25 --- /dev/null +++ b/collections/hub/golden_path/fx/api_schema_validation/fx_quotes.json @@ -0,0 +1,189 @@ +{ + "options": {}, + "name": "fx_quotes", + "test_cases": [ + { + "id": 1, + "name": "FX Quote - 400", + "fileInfo": { + "path": "hub/golden_path/fx/api_schema_validation/fx_quotes.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Quote - 400" + }, + "requests": [ + { + "id": 4, + "description": "POST /fxQuotes - Invalid Amount Type", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "INVALID", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + } + }, + { + "id": 5, + "description": "POST /fxQuotes - Invalid conversionRequestId", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "invalid", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + } + }, + { + "id": 6, + "description": "POST /fxQuotes - Invalid currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "ABC" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/api_schema_validation/fx_transfers.json b/collections/hub/golden_path/fx/api_schema_validation/fx_transfers.json new file mode 100644 index 00000000..919ad8e7 --- /dev/null +++ b/collections/hub/golden_path/fx/api_schema_validation/fx_transfers.json @@ -0,0 +1,273 @@ +{ + "options": {}, + "name": "fx_transfer_400", + "test_cases": [ + { + "id": 1, + "name": "FX Transfer - 400", + "fileInfo": { + "path": "hub/golden_path/fx/api_schema_validation/fx_transfers.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Transfer - 400" + }, + "requests": [ + { + "id": 6, + "description": "POST /fxTransfers Invalid determiningTransferId", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "invalid", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.amount}" + }, + "condition": "{$inputs.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 7, + "description": "POST /fxTransfers Invalid commitRequestId", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "invalid", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.amount}" + }, + "condition": "{$inputs.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 8, + "description": "POST /fxTransfers Invalid condition", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.amount}" + }, + "condition": "condition", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers Invalid currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "ABC", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.amount}" + }, + "condition": "{$inputs.amount}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/api_schema_validation/master.json b/collections/hub/golden_path/fx/api_schema_validation/master.json new file mode 100644 index 00000000..84f4032e --- /dev/null +++ b/collections/hub/golden_path/fx/api_schema_validation/master.json @@ -0,0 +1,12 @@ +{ + "order": [ + { + "name": "fx_quotes.json", + "type": "file" + }, + { + "name": "fx_transfers.json", + "type": "file" + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/duplicate_handling/duplicate_fx_transfers.json b/collections/hub/golden_path/fx/feature_tests/duplicate_handling/duplicate_fx_transfers.json new file mode 100644 index 00000000..40bfa7b4 --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/duplicate_handling/duplicate_fx_transfers.json @@ -0,0 +1,718 @@ +{ + "options": {}, + "name": "hub_golden_path_fx_feature_tests_duplicate_handling_duplicate_fx_transfers", + "test_cases": [ + { + "id": 1, + "name": "Duplicate fxTransfer", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/duplicate_handling/duplicate_fx_transfers.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Transfer" + }, + "breakOnError": false, + "requests": [ + { + "id": 4, + "description": "POST /fxQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain conversionTerms", + "exec": [ + "expect(callback.body).to.have.property('conversionTerms')" + ] + }, + { + "id": 6, + "description": "Callback sourceAmount (amount & currency) to match the request", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "request.body.conversionTerms.sourceAmount.amount && expect(callback.body.conversionTerms.sourceAmount.amount).to.equal('{$request.body.conversionTerms.sourceAmount.amount}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be fxQuotes", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxQuotes+json')" + ] + }, + { + "id": 16, + "description": "Callback body should contain condition", + "exec": [ + "expect(callback.body).to.have.property('condition')" + ] + }, + { + "id": 17, + "description": "Callback body should contain target amount", + "exec": [ + "expect(callback.body.conversionTerms.targetAmount).to.have.property('amount')" + ] + }, + { + "id": 18, + "description": "Callback transferAmount (amount & currency)to match the request Copy", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "expect(callback.body.conversionTerms.targetAmount.currency).to.equal('{$request.body.conversionTerms.targetAmount.currency}')" + ] + } + ] + }, + "params": { + "Type": "", + "ID": "" + } + }, + { + "id": 5, + "description": "POST /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.toIdType}", + "partyIdentifier": "{$inputs.FX_MSISDN_1}", + "fspId": "{$inputs.FX_PAYEE_DFSP_ID}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$prev.4.callback.body.conversionTerms.targetAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.targetAmount.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + } + }, + { + "id": 6, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$prev.4.callback.body.conversionTerms.conversionId}", + "determiningTransferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.sourceAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.targetAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.targetAmount.currency}" + }, + "condition": "{$prev.4.callback.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback length not zero", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 10, + "description": "Get Accounts for Payer AFTER fx transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer).to.not.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterFxTransfer}`);" + ] + } + } + }, + { + "id": 12, + "description": "POST /transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$prev.5.callback.body.transferAmount.currency}", + "amount": "{$prev.5.callback.body.transferAmount.amount}" + }, + "ilpPacket": "{$prev.5.callback.body.ilpPacket}", + "condition": "{$prev.5.callback.body.condition}", + "expiration": "{$prev.5.callback.body.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + }, + { + "id": 9, + "description": "Request FSP source the same as quote callback FSP destination", + "exec": [ + "expect('{$request.headers['FSPIOP-Source']}').to.equal('{$prev.4.callback.headers.fspiop-destination}')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 13, + "description": "Duplicate POST /fxTransfers with modified payload", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$prev.9.request.body.commitRequestId}", + "determiningTransferId": "{$prev.9.request.body.determiningTransferId}", + "initiatingFsp": "{$prev.9.request.body.initiatingFsp}", + "counterPartyFsp": "{$prev.9.request.body.counterPartyFsp}", + "amountType": "{$prev.9.request.body.amountType}", + "sourceAmount": { + "amount": "{$prev.9.request.body.sourceAmount.amount}", + "currency": "{$prev.9.request.body.sourceAmount.currency}" + }, + "targetAmount": { + "amount": "{$prev.9.request.body.targetAmount.amount}", + "currency": "{$prev.9.request.body.targetAmount.currency}" + }, + "condition": "{$prev.9.request.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback length not zero", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Got errorInformation", + "exec": [ + "expect(callback.body).to.have.property('errorInformation')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 14, + "description": "Duplicate POST /fxTransfers with sam payload", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$prev.9.request.body.commitRequestId}", + "determiningTransferId": "{$prev.9.request.body.determiningTransferId}", + "initiatingFsp": "{$prev.9.request.body.initiatingFsp}", + "counterPartyFsp": "{$prev.9.request.body.counterPartyFsp}", + "amountType": "{$prev.9.request.body.amountType}", + "sourceAmount": { + "amount": "{$prev.9.request.body.sourceAmount.amount}", + "currency": "{$prev.9.request.body.sourceAmount.currency}" + }, + "targetAmount": { + "amount": "{$prev.9.request.body.targetAmount.amount}", + "currency": "{$prev.9.request.body.targetAmount.currency}" + }, + "condition": "{$prev.9.request.body.condition}", + "expiration": "{$prev.9.request.body.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback length not zero", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Should get fulfilment same", + "exec": [ + "expect(callback.body.fulfilment).to.equal('{$prev.9.callback.body.fulfilment}')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/happy_path/fx_p2p_receive.json b/collections/hub/golden_path/fx/feature_tests/happy_path/fx_p2p_receive.json new file mode 100644 index 00000000..643ffafe --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/happy_path/fx_p2p_receive.json @@ -0,0 +1,1094 @@ +{ + "options": {}, + "name": "hub_golden_path_fx_feature_tests_happy_path_fx_p2p_receive", + "test_cases": [ + { + "id": 1, + "name": "Happy Path FX E2E RECEIVE", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/happy_path/fx_p2p_receive.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Transfer RECEIVE" + }, + "breakOnError": false, + "requests": [ + { + "id": 1, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_1.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_1.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_1.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_1.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_1.1/trigger_templates" + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.FX_MSISDN_1}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.FX_MSISDN_1}" + }, + "body": { + "fspId": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "FSPIOP-Source": "{$inputs.FX_PAYEE_DFSP_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "disabled": false + }, + { + "id": 2, + "description": "Get party info", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "additionalApi": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/parties/{Type}/{ID}", + "path": "/parties/MSISDN/{$inputs.FX_MSISDN_1}", + "method": "get", + "params": { + "Type": "MSISDN", + "ID": "{$inputs.FX_MSISDN_1}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "Accept": "{$inputs.acceptParties}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback body should contain party", + "exec": [ + "expect(callback.body).to.have.property('party')" + ] + }, + { + "id": 6, + "description": "Callback FSPIOP-Destination same as request FSPIOP-Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 8, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.toIdType}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.FX_MSISDN_1}')" + ] + } + ] + } + }, + { + "id": 5, + "description": "POST /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$prev.2.callback.body.party.partyIdInfo.partyIdType}", + "partyIdentifier": "{$prev.2.callback.body.party.partyIdInfo.partyIdentifier}", + "fspId": "{$prev.2.callback.body.party.partyIdInfo.fspId}" + } + }, + "amountType": "RECEIVE", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + } + }, + { + "id": 4, + "description": "POST /fxQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$prev.5.request.body.transactionId}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "RECEIVE", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$prev.5.callback.body.transferAmount.amount}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain conversionTerms", + "exec": [ + "expect(callback.body).to.have.property('conversionTerms')" + ] + }, + { + "id": 6, + "description": "Callback sourceAmount (amount & currency) to match the request", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "request.body.conversionTerms.sourceAmount.amount && expect(callback.body.conversionTerms.sourceAmount.amount).to.equal('{$request.body.conversionTerms.sourceAmount.amount}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be fxQuotes", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxQuotes+json')" + ] + }, + { + "id": 16, + "description": "Callback body should contain condition", + "exec": [ + "expect(callback.body).to.have.property('condition')" + ] + }, + { + "id": 17, + "description": "Callback body should contain target amount", + "exec": [ + "expect(callback.body.conversionTerms.targetAmount).to.have.property('amount')" + ] + }, + { + "id": 18, + "description": "Callback transferAmount (amount & currency)to match the request Copy", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "expect(callback.body.conversionTerms.targetAmount.currency).to.equal('{$request.body.conversionTerms.targetAmount.currency}')" + ] + } + ] + }, + "scriptingEngine": "javascript", + "scripts": { + "postRequest": { + "exec": [ + "var res = callback.body;", + "", + "environment.fxSourceAmount = res.conversionTerms.sourceAmount.amount" + ] + } + } + }, + { + "id": 6, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 7, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 8, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$prev.4.callback.body.conversionTerms.conversionId}", + "determiningTransferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "RECEIVE", + "sourceAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.sourceAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.targetAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.targetAmount.currency}" + }, + "condition": "{$prev.4.callback.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback length not zero", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 10, + "description": "Get Accounts for Payer AFTER fx transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer).to.not.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterFxTransfer}`);" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for FXP AFTER fx transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer-environment.payerPositionBalanceBeforeFxTransfer).to.equal(+environment.fxSourceAmount)" + ] + }, + { + "id": 3, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 4, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "// console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "// console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`Payer Position ${environment.FX_SOURCE_CURRENCY} : ${environment.payerPositionBalanceBeforeFxTransfer} -> ${environment.payerPositionBalanceAfterTransfer} (${environment.payerPositionBalanceAfterTransfer - environment.payerPositionBalanceBeforeFxTransfer})`);", + "console.log(`Payee Position ${environment.FX_TARGET_CURRENCY} : ${environment.payeePositionBalanceBeforeFxTransfer} -> ${environment.payeePositionBalanceAfterTransfer} (${environment.payeePositionBalanceAfterTransfer - environment.payeePositionBalanceBeforeFxTransfer})`);", + "console.log(`FXP Source Currency ${environment.FX_SOURCE_CURRENCY} : ${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer} -> ${environment.fxpSourceCurrencyPositionBalanceAfterTransfer} (${environment.fxpSourceCurrencyPositionBalanceAfterTransfer - environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer})`);", + "console.log(`FXP Target Currency ${environment.FX_TARGET_CURRENCY} : ${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer} -> ${environment.fxpTargetCurrencyPositionBalanceAfterTransfer} (${environment.fxpTargetCurrencyPositionBalanceAfterTransfer - environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer})`);" + ] + } + } + }, + { + "id": 15, + "description": "Get FxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers/{ID}", + "path": "/fxTransfers/{$prev.9.request.body.commitRequestId}", + "method": "get", + "params": { + "ID": "{$prev.9.request.body.commitRequestId}" + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback conversionState to be RESERVED", + "exec": [ + "expect(callback.body.conversionState).to.equal('RESERVED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be fxTransfers", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxTransfers+json')" + ] + }, + { + "id": 8, + "description": "Callback body should contain fulfilment", + "exec": [ + "expect(callback.body).to.have.property('fulfilment')" + ] + } + ] + } + }, + { + "id": 12, + "description": "POST /transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$prev.5.callback.body.transferAmount.currency}", + "amount": "{$prev.5.callback.body.transferAmount.amount}" + }, + "ilpPacket": "{$prev.5.callback.body.ilpPacket}", + "condition": "{$prev.5.callback.body.condition}", + "expiration": "{$prev.5.callback.body.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + }, + { + "id": 9, + "description": "Request FSP source the same as quote callback FSP destination", + "exec": [ + "expect('{$request.headers['FSPIOP-Source']}').to.equal('{$prev.4.callback.headers.fspiop-destination}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 3, + "description": "FXP Source currency position should be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer-environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer).to.equal(-environment.fxSourceAmount)" + ] + }, + { + "id": 4, + "description": "FXP Target currency position should be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.not.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "" + ] + } + } + }, + { + "id": 14, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payee position should be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.not.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 16, + "description": "Get FxTransfers after final transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers/{ID}", + "path": "/fxTransfers/{$prev.9.request.body.commitRequestId}", + "method": "get", + "params": { + "ID": "{$prev.9.request.body.commitRequestId}" + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback conversionState to be RESERVED", + "exec": [ + "expect(callback.body.conversionState).to.equal('COMMITTED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be fxTransfers", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxTransfers+json')" + ] + }, + { + "id": 8, + "description": "Callback body should contain fulfilment", + "exec": [ + "expect(callback.body).to.have.property('fulfilment')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/happy_path/fx_tests.json b/collections/hub/golden_path/fx/feature_tests/happy_path/fx_tests.json new file mode 100644 index 00000000..7f008675 --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/happy_path/fx_tests.json @@ -0,0 +1,1092 @@ +{ + "options": {}, + "name": "hub_golden_path_fx_feature_tests_happy_path_fx_tests", + "test_cases": [ + { + "id": 1, + "name": "Happy Path FX E2E", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/happy_path/fx_tests.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Transfer" + }, + "breakOnError": false, + "requests": [ + { + "id": 1, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_1.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_1.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_1.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_1.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_1.1/trigger_templates" + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.FX_MSISDN_1}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.FX_MSISDN_1}" + }, + "body": { + "fspId": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "FSPIOP-Source": "{$inputs.FX_PAYEE_DFSP_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "disabled": false + }, + { + "id": 2, + "description": "Get party info", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "additionalApi": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/parties/{Type}/{ID}", + "path": "/parties/MSISDN/{$inputs.FX_MSISDN_1}", + "method": "get", + "params": { + "Type": "MSISDN", + "ID": "{$inputs.FX_MSISDN_1}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "Accept": "{$inputs.acceptParties}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback body should contain party", + "exec": [ + "expect(callback.body).to.have.property('party')" + ] + }, + { + "id": 6, + "description": "Callback FSPIOP-Destination same as request FSPIOP-Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 8, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.toIdType}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.FX_MSISDN_1}')" + ] + } + ] + } + }, + { + "id": 4, + "description": "POST /fxQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain conversionTerms", + "exec": [ + "expect(callback.body).to.have.property('conversionTerms')" + ] + }, + { + "id": 6, + "description": "Callback sourceAmount (amount & currency) to match the request", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "request.body.conversionTerms.sourceAmount.amount && expect(callback.body.conversionTerms.sourceAmount.amount).to.equal('{$request.body.conversionTerms.sourceAmount.amount}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be fxQuotes", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxQuotes+json')" + ] + }, + { + "id": 16, + "description": "Callback body should contain condition", + "exec": [ + "expect(callback.body).to.have.property('condition')" + ] + }, + { + "id": 17, + "description": "Callback body should contain target amount", + "exec": [ + "expect(callback.body.conversionTerms.targetAmount).to.have.property('amount')" + ] + }, + { + "id": 18, + "description": "Callback transferAmount (amount & currency)to match the request Copy", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "expect(callback.body.conversionTerms.targetAmount.currency).to.equal('{$request.body.conversionTerms.targetAmount.currency}')" + ] + } + ] + } + }, + { + "id": 5, + "description": "POST /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$prev.2.callback.body.party.partyIdInfo.partyIdType}", + "partyIdentifier": "{$prev.2.callback.body.party.partyIdInfo.partyIdentifier}", + "fspId": "{$prev.2.callback.body.party.partyIdInfo.fspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$prev.4.callback.body.conversionTerms.targetAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.targetAmount.currency}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + } + }, + { + "id": 6, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 7, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 8, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "body": { + "commitRequestId": "{$prev.4.callback.body.conversionTerms.conversionId}", + "determiningTransferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.sourceAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "amount": "{$prev.4.callback.body.conversionTerms.targetAmount.amount}", + "currency": "{$prev.4.callback.body.conversionTerms.targetAmount.currency}" + }, + "condition": "{$prev.4.callback.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback length not zero", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 10, + "description": "Get Accounts for Payer AFTER fx transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer).to.not.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterFxTransfer}`);" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for FXP AFTER fx transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer-environment.payerPositionBalanceBeforeFxTransfer).to.equal(+environment.FX_SOURCE_AMOUNT)" + ] + }, + { + "id": 3, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 4, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "// console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "// console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`Payer Position ${environment.FX_SOURCE_CURRENCY} : ${environment.payerPositionBalanceBeforeFxTransfer} -> ${environment.payerPositionBalanceAfterTransfer} (${environment.payerPositionBalanceAfterTransfer - environment.payerPositionBalanceBeforeFxTransfer})`);", + "console.log(`Payee Position ${environment.FX_TARGET_CURRENCY} : ${environment.payeePositionBalanceBeforeFxTransfer} -> ${environment.payeePositionBalanceAfterTransfer} (${environment.payeePositionBalanceAfterTransfer - environment.payeePositionBalanceBeforeFxTransfer})`);", + "console.log(`FXP Source Currency ${environment.FX_SOURCE_CURRENCY} : ${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer} -> ${environment.fxpSourceCurrencyPositionBalanceAfterTransfer} (${environment.fxpSourceCurrencyPositionBalanceAfterTransfer - environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer})`);", + "console.log(`FXP Target Currency ${environment.FX_TARGET_CURRENCY} : ${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer} -> ${environment.fxpTargetCurrencyPositionBalanceAfterTransfer} (${environment.fxpTargetCurrencyPositionBalanceAfterTransfer - environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer})`);" + ] + } + } + }, + { + "id": 15, + "description": "Get FxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers/{ID}", + "path": "/fxTransfers/{$prev.9.request.body.commitRequestId}", + "method": "get", + "params": { + "ID": "{$prev.9.request.body.commitRequestId}" + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback conversionState to be RESERVED", + "exec": [ + "expect(callback.body.conversionState).to.equal('RESERVED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be fxTransfers", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxTransfers+json')" + ] + }, + { + "id": 8, + "description": "Callback body should contain fulfilment", + "exec": [ + "expect(callback.body).to.have.property('fulfilment')" + ] + } + ] + } + }, + { + "id": 12, + "description": "POST /transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.4.request.body.conversionTerms.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$prev.5.callback.body.transferAmount.currency}", + "amount": "{$prev.5.callback.body.transferAmount.amount}" + }, + "ilpPacket": "{$prev.5.callback.body.ilpPacket}", + "condition": "{$prev.5.callback.body.condition}", + "expiration": "{$prev.5.callback.body.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + }, + { + "id": 9, + "description": "Request FSP source the same as quote callback FSP destination", + "exec": [ + "expect('{$request.headers['FSPIOP-Source']}').to.equal('{$prev.4.callback.headers.fspiop-destination}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 3, + "description": "FXP Source currency position should be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer-environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer).to.equal(-environment.FX_SOURCE_AMOUNT)" + ] + }, + { + "id": 4, + "description": "FXP Target currency position should be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.not.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "" + ] + } + } + }, + { + "id": 14, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payee position should be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.not.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 16, + "description": "Get FxTransfers after final transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers/{ID}", + "path": "/fxTransfers/{$prev.9.request.body.commitRequestId}", + "method": "get", + "params": { + "ID": "{$prev.9.request.body.commitRequestId}" + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback conversionState to be RESERVED", + "exec": [ + "expect(callback.body.conversionState).to.equal('COMMITTED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be fxTransfers", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxTransfers+json')" + ] + }, + { + "id": 8, + "description": "Callback body should contain fulfilment", + "exec": [ + "expect(callback.body).to.have.property('fulfilment')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/master.json b/collections/hub/golden_path/fx/feature_tests/master.json new file mode 100644 index 00000000..8135df63 --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/master.json @@ -0,0 +1,16 @@ +{ + "order": [ + { + "name": "happy_path", + "type": "folder" + }, + { + "name": "duplicate_handling", + "type": "folder" + }, + { + "name": "negative_scenarios", + "type": "folder" + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json new file mode 100644 index 00000000..9618257c --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json @@ -0,0 +1,810 @@ +{ + "options": {}, + "name": "hub_golden_path_fx_feature_tests_negative_scenarios_fxp_error", + "test_cases": [ + { + "id": 1, + "name": "FX Quote - Error scenario", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /fxQuotes returns PUT /fxQuotes/{ID}/error" + }, + "requests": [ + { + "id": 4, + "description": "POST /fxQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT_ERROR_GENERIC}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain errorInformation code", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Callback body should contain errorInformation description", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorDescription')" + ] + } + ] + }, + "params": { + "Type": "", + "ID": "" + } + } + ] + }, + { + "id": 2, + "name": "FX Transfer - Error Scenario", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /fxTransfers returns PUT /fxTransfers/{ID}/error" + }, + "requests": [ + { + "id": 1, + "description": "Get payer position before fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 2, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT_ERROR_GENERIC}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain errorInformation code", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Callback body should contain errorInformation description", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorDescription')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 3, + "description": "Get payer position after fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterFxTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterFxTransfer}`);" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Fx Transfer - success; Regular Transfer - error", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/fxp_error.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /transfers returns PUT /transfers/{ID}/error" + }, + "requests": [ + { + "id": 1, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 2, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 3, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 10, + "description": "POST /transfer that triggers an error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.9.request.body.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT_ERROR_GENERIC}" + }, + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback should have error code", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Callback should have error description", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorDescription')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for Payer AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "Array.isArray(res) && res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterTransfer}`);" + ] + } + } + }, + { + "id": 12, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP position should not be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 2, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_invalid_fulfillment.json b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_invalid_fulfillment.json new file mode 100644 index 00000000..93af5264 --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/fxp_invalid_fulfillment.json @@ -0,0 +1,497 @@ +{ + "options": {}, + "name": "fxp_error", + "test_cases": [ + { + "id": 3, + "name": "Check that positions for FXP, Payer and Payee are not changed after FXTransfer fails with invalid fulfillment", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/fxp_invalid_fulfillment.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /fxTransfers returns PUT /fxTransfers/{ID} with invalid fulfillment" + }, + "requests": [ + { + "id": 1, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 2, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 3, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers that receives invalid fulfilment", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "15" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + }, + "params": { + "name": "" + } + }, + { + "id": 10, + "description": "POST /transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.9.request.body.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback should have error code", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Callback should have error description", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorDescription')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for Payer AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "Array.isArray(res) && res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterTransfer}`);" + ] + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + } + }, + { + "id": 12, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP position should not be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 2, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/negative_scenarios/master.json b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/master.json new file mode 100644 index 00000000..09c8a4fe --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/master.json @@ -0,0 +1,20 @@ +{ + "order": [ + { + "name": "fxp_error.json", + "type": "file" + }, + { + "name": "fxp_invalid_fulfillment.json", + "type": "file" + }, + { + "name": "payee_invalid_fulfillment.json", + "type": "file" + }, + { + "name": "timeout_scenarios.json", + "type": "file" + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/negative_scenarios/payee_invalid_fulfillment.json b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/payee_invalid_fulfillment.json new file mode 100644 index 00000000..6f48fbdf --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/payee_invalid_fulfillment.json @@ -0,0 +1,497 @@ +{ + "options": {}, + "name": "fxp_error", + "test_cases": [ + { + "id": 3, + "name": "Check that positions for FXP, Payer and Payee are not changed after payee sends invalid fulfillment", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/payee_invalid_fulfillment.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /transfers returns PUT /transfers/{ID} with invalid fulfillment" + }, + "requests": [ + { + "id": 1, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 2, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 3, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + }, + "params": { + "name": "" + } + }, + { + "id": 10, + "description": "POST /transfer that receives invalid fulfilment", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.9.request.body.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "15" + }, + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback should have error code", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorCode')" + ] + }, + { + "id": 6, + "description": "Callback should have error description", + "exec": [ + "expect(callback.body.errorInformation).to.have.property('errorDescription')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for Payer AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "Array.isArray(res) && res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterTransfer}`);" + ] + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + } + }, + { + "id": 12, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP position should not be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 2, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/feature_tests/negative_scenarios/timeout_scenarios.json b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/timeout_scenarios.json new file mode 100644 index 00000000..4758c98a --- /dev/null +++ b/collections/hub/golden_path/fx/feature_tests/negative_scenarios/timeout_scenarios.json @@ -0,0 +1,654 @@ +{ + "options": {}, + "name": "hub_golden_path_fx_feature_tests_negative_scenarios_timeout_scenarios", + "test_cases": [ + { + "id": 1, + "name": "Check that position for Payer is not changed after FXTransfer is expired", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/timeout_scenarios.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "fxTransfer expired" + }, + "requests": [ + { + "id": 1, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers that expires", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "16" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "// Very short expiration", + "requestVariables.expiration =new Date(new Date().getTime() + 2 * 1000).toISOString()" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for Payer AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "Array.isArray(res) && res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterTransfer}`);" + ] + } + } + } + ] + }, + { + "id": 2, + "name": "Check that positions for FXP, Payer and Payee are not changed after transfer is expired", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/negative_scenarios/timeout_scenarios.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "POST /fxTransfers returns PUT /fxTransfers/{ID} with invalid fulfillment" + }, + "requests": [ + { + "id": 1, + "description": "Get Accounts for Payer BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + "", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance before FxTransfer=${environment.payerPositionBalanceBeforeFxTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 2, + "description": "Get Accounts for Payee BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance before FxTransfer=${environment.payeePositionBalanceBeforeFxTransfer}`);", + "" + ] + } + } + }, + { + "id": 3, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 9, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$function.generic.generateID}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "16" + }, + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + } + ] + }, + "params": { + "name": "" + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 10, + "description": "POST /transfer that expires", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.9.request.body.determiningTransferId}", + "payeeFsp": "{$inputs.FX_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "16" + }, + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.validCondition}", + "expiration": "{$requestVariables.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 2000).toISOString()" + ] + } + } + }, + { + "id": 11, + "description": "Get Accounts for Payer AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYER_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Payer position should not be changed", + "exec": [ + "expect(environment.payerPositionBalanceAfterTransfer).to.equal(environment.payerPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "Array.isArray(res) && res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payerPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payer Position Balance after Transfer=${environment.payerPositionBalanceAfterTransfer}`);" + ] + } + } + }, + { + "id": 12, + "description": "Get Accounts for Payee AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_PAYEE_DFSP_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_PAYEE_DFSP_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP position should not be changed", + "exec": [ + "expect(environment.payeePositionBalanceAfterTransfer).to.equal(environment.payeePositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.payeePositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`Payee Position Balance after Transfer=${environment.payeePositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + }, + { + "id": 13, + "description": "Get Accounts for FXP AFTER transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "FXP Source currency position should not be changed", + "exec": [ + "expect(environment.fxpSourceCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer)" + ] + }, + { + "id": 2, + "description": "FXP Target currency position should not be changed", + "exec": [ + "expect(environment.fxpTargetCurrencyPositionBalanceAfterTransfer).to.equal(environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer)" + ] + } + ] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);", + "", + "" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/fx/master.json b/collections/hub/golden_path/fx/master.json new file mode 100644 index 00000000..da223b77 --- /dev/null +++ b/collections/hub/golden_path/fx/master.json @@ -0,0 +1,12 @@ +{ + "order": [ + { + "name": "feature_tests", + "type": "folder" + }, + { + "name": "api_schema_validation", + "type": "folder" + } + ] +} \ No newline at end of file diff --git a/collections/hub/golden_path/master.json b/collections/hub/golden_path/master.json index 08eee37d..1a91a6a5 100644 --- a/collections/hub/golden_path/master.json +++ b/collections/hub/golden_path/master.json @@ -1,45 +1,45 @@ { - "order": [ - { - "name": "feature_tests", - "type": "folder" - }, - { - "name": "bug fixes", - "type": "folder" - }, - { - "name": "p2p_on_us_transfers", - "type": "folder" - }, - { - "name": "quoting_service", - "type": "folder", - "labels": [ - "quotes" - ] - }, - { - "name": "transaction_request_service", - "type": "folder" - }, - { - "name": "settlement_management", - "type": "folder", - "labels": [ - "settlements" - ] - }, - { - "name": "api-tests", - "type": "folder" - }, - { - "name": "settlement_cgs", - "type": "folder", - "labels": [ - "settlements" - ] - } - ] -} \ No newline at end of file + "order": [ + { + "name": "feature_tests", + "type": "folder" + }, + { + "name": "bug fixes", + "type": "folder" + }, + { + "name": "p2p_on_us_transfers", + "type": "folder" + }, + { + "name": "quoting_service", + "type": "folder", + "labels": [ + "quotes" + ] + }, + { + "name": "transaction_request_service", + "type": "folder" + }, + { + "name": "settlement_management", + "type": "folder", + "labels": [ + "settlements" + ] + }, + { + "name": "api-tests", + "type": "folder" + }, + { + "name": "fx", + "type": "folder", + "labels": [ + "fx" + ] + } + ] + } \ No newline at end of file diff --git a/collections/hub/golden_path/p2p_on_us_transfers/p2p_money_transfer_on_us.json b/collections/hub/golden_path/p2p_on_us_transfers/p2p_money_transfer_on_us.json index 48c49539..77096cb2 100644 --- a/collections/hub/golden_path/p2p_on_us_transfers/p2p_money_transfer_on_us.json +++ b/collections/hub/golden_path/p2p_on_us_transfers/p2p_money_transfer_on_us.json @@ -105,8 +105,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/quoting_service/quoting_service.json b/collections/hub/golden_path/quoting_service/quoting_service.json index d21fa90f..4a61ce2d 100644 --- a/collections/hub/golden_path/quoting_service/quoting_service.json +++ b/collections/hub/golden_path/quoting_service/quoting_service.json @@ -31,8 +31,8 @@ "Authorization": "{$inputs.PAYER_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -334,8 +334,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -445,8 +445,8 @@ "Authorization": "{$inputs.PAYER_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/settlement_management/Settlement-management-primary-currency-test.json b/collections/hub/golden_path/settlement_management/Settlement-management-primary-currency-test.json index a3cff400..0d607a8b 100644 --- a/collections/hub/golden_path/settlement_management/Settlement-management-primary-currency-test.json +++ b/collections/hub/golden_path/settlement_management/Settlement-management-primary-currency-test.json @@ -1544,8 +1544,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1856,8 +1856,8 @@ "Authorization": "{$inputs.TESTFSP1_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2164,8 +2164,8 @@ "Authorization": "{$inputs.PAYER_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2472,8 +2472,8 @@ "Authorization": "{$inputs.TESTFSP2_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2603,19 +2603,19 @@ "console.log(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}');", "", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // if (environment.ENABLE_WS_ASSERTIONS===true) {", - " // await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", - " // }" + " if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", + " }" ] }, "postRequest": { "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", - " const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", - " await custom.sleep(customSleep)", - " environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data", + " environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", + " // const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", + " // await custom.sleep(customSleep)", + " // environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data", "}", "", "console.log(environment.testfsp2callbacks);", @@ -2733,20 +2733,22 @@ "preRequest": { "exec": [ " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // if (environment.ENABLE_WS_ASSERTIONS===true) {", - " // await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.transferId}', 'testfsp2callbackst')", - " // }" + " if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.transferId}', 'testfsp2callbackst')", + " }" ] }, "postRequest": { "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // environment.testfsp2callbackst = await websocket.getMessage('testfsp2callbackst', environment.WS_ASSERTION_TIMEOUT)", - " const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", - " await custom.sleep(customSleep)", - " environment.testfsp2callbackst = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.transferId}')).data", - "}" + " environment.testfsp2callbackst = await websocket.getMessage('testfsp2callbackst', environment.WS_ASSERTION_TIMEOUT)", + " // const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", + " // await custom.sleep(customSleep)", + " // environment.testfsp2callbackst = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.transferId}')).data", + " console.log(environment.testfsp2callbackst)", + "}", + "" ] } } @@ -2789,8 +2791,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -3097,8 +3099,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/settlement_management/Settlement-management-second-currency-test.json b/collections/hub/golden_path/settlement_management/Settlement-management-second-currency-test.json index 8b7084c2..2bf0dec6 100644 --- a/collections/hub/golden_path/settlement_management/Settlement-management-second-currency-test.json +++ b/collections/hub/golden_path/settlement_management/Settlement-management-second-currency-test.json @@ -1544,8 +1544,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -1856,8 +1856,8 @@ "Authorization": "{$inputs.TESTFSP1_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2164,8 +2164,8 @@ "Authorization": "{$inputs.PAYER_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2472,8 +2472,8 @@ "Authorization": "{$inputs.TESTFSP2_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2601,19 +2601,19 @@ "preRequest": { "exec": [ "// NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - "// if (environment.ENABLE_WS_ASSERTIONS===true) {", - "// await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", - "// }" + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", + "}" ] }, "postRequest": { "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", - " const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 1500", - " await custom.sleep(customSleep)", - " environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data", + " environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", + " // const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 1500", + " // await custom.sleep(customSleep)", + " // environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data", "}", "", "console.log(environment.testfsp2callbacks);", @@ -2789,8 +2789,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2934,7 +2934,8 @@ "console.log(environment.transactionid);*/" ] } - } + }, + "disabled": false }, { "id": 2, @@ -3057,7 +3058,8 @@ "console.log(environment.payeefspcallbackst);" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -3097,8 +3099,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -3242,7 +3244,8 @@ "console.log(environment.transactionid);*/" ] } - } + }, + "disabled": false }, { "id": 2, @@ -3365,7 +3368,8 @@ "console.log(environment.payeefspcallbackst);" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -3436,7 +3440,8 @@ "console.log(environment.openWindowID);" ] } - } + }, + "disabled": false }, { "id": 2, @@ -3519,7 +3524,8 @@ "//}" ] } - } + }, + "disabled": false }, { "id": 3, @@ -3610,7 +3616,8 @@ "*/" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -3679,7 +3686,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 2, @@ -3733,7 +3741,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 3, @@ -3787,7 +3796,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 4, @@ -3841,7 +3851,8 @@ "})" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -3957,7 +3968,8 @@ "" ] } - } + }, + "disabled": false }, { "id": 5, @@ -4046,7 +4058,8 @@ "environment.controlvar = isok;" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -4129,7 +4142,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 2, @@ -4197,7 +4211,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 3, @@ -4265,7 +4280,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 4, @@ -4333,7 +4349,8 @@ "})" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -4449,7 +4466,8 @@ "" ] } - } + }, + "disabled": false }, { "id": 5, @@ -4538,7 +4556,8 @@ "environment.controlvar = isok;" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -4621,7 +4640,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 2, @@ -4689,7 +4709,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 3, @@ -4757,7 +4778,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 4, @@ -4825,7 +4847,8 @@ "})" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -4941,7 +4964,8 @@ "" ] } - } + }, + "disabled": false }, { "id": 5, @@ -5030,7 +5054,8 @@ "environment.controlvar = isok;" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -5113,7 +5138,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 2, @@ -5181,7 +5207,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 3, @@ -5249,7 +5276,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 4, @@ -5317,7 +5345,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 5, @@ -5389,7 +5418,8 @@ "environment.hubMultilateralAccountBalanceAfterCommit = hubMultilateralAccountBalanceAfterCommit;" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -5505,7 +5535,8 @@ "" ] } - } + }, + "disabled": false }, { "id": 5, @@ -5594,7 +5625,8 @@ "environment.controlvar = isok;" ] } - } + }, + "disabled": false } ], "fileInfo": { @@ -5677,7 +5709,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 2, @@ -5745,7 +5778,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 3, @@ -5813,7 +5847,8 @@ "})" ] } - } + }, + "disabled": false }, { "id": 4, @@ -5881,7 +5916,8 @@ "})" ] } - } + }, + "disabled": false } ], "fileInfo": { diff --git a/collections/hub/golden_path/settlement_management/mixed_settlement_model.json b/collections/hub/golden_path/settlement_management/mixed_settlement_model.json index 4976383b..deaa2729 100644 --- a/collections/hub/golden_path/settlement_management/mixed_settlement_model.json +++ b/collections/hub/golden_path/settlement_management/mixed_settlement_model.json @@ -2222,8 +2222,8 @@ "FSPIOP-Destination": "{$inputs.SIM2_NAME}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2534,8 +2534,8 @@ "Authorization": "{$inputs.TESTFSP1_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -2842,8 +2842,8 @@ "Authorization": "{$inputs.PAYER_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -3150,8 +3150,8 @@ "Authorization": "{$inputs.TESTFSP2_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -3282,7 +3282,7 @@ "", "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", + " await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.quoteId}', 'testfsp2callbacksq')", "}" ] }, @@ -3290,10 +3290,10 @@ "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", - " await custom.sleep(customSleep)", - " // environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", - " environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data;", + " environment.testfsp2callbacks = await websocket.getMessage('testfsp2callbacksq', environment.WS_ASSERTION_TIMEOUT)", + " // const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 2000", + " // await custom.sleep(customSleep)", + " // environment.testfsp2callbacks = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.quoteId}')).data;", " console.log(environment.testfsp2callbacks);", "}", "" @@ -3410,7 +3410,7 @@ "exec": [ "// if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.transferId}', 'testfsp2callbackst')", + " await websocket.connect(environment.TESTFSP2_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.transferId}', 'testfsp2callbackst')", "// }" ] }, @@ -3418,10 +3418,10 @@ "exec": [ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " // NOTE: This has been commented out due to the WS issue https://github.com/mojaloop/project/issues/3164, with a work-around to call the HTTP equivalent API on the postRequest instead until it can be resolved.", - " // environment.testfsp2callbackst = await websocket.getMessage('testfsp2callbackst', environment.WS_ASSERTION_TIMEOUT)", - " const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 1500", - " await custom.sleep(customSleep)", - " environment.testfsp2callbackst = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.transferId}')).data", + " environment.testfsp2callbackst = await websocket.getMessage('testfsp2callbackst', environment.WS_ASSERTION_TIMEOUT)", + " // const customSleep = Number.parseFloat(environment.SLEEP_MAX_WAIT_IN_MS) || 1500", + " // await custom.sleep(customSleep)", + " // environment.testfsp2callbackst = (await axios.get(environment.TESTFSP2_SDK_TESTAPI_URL + '/callbacks/{$request.body.transferId}')).data", " console.log(environment.testfsp2callbackst)", "}" ] @@ -3467,8 +3467,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", @@ -3775,8 +3775,8 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "quoteId": "{$function.generic.generateUUID}", - "transactionId": "{$function.generic.generateUUID}", + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", "payer": { "partyIdInfo": { "partyIdType": "{$inputs.fromIdType}", diff --git a/collections/hub/golden_path/transaction_request_service/Error-framework-authorizations.json b/collections/hub/golden_path/transaction_request_service/Error-framework-authorizations.json index 5695eece..5ef4b460 100644 --- a/collections/hub/golden_path/transaction_request_service/Error-framework-authorizations.json +++ b/collections/hub/golden_path/transaction_request_service/Error-framework-authorizations.json @@ -72,7 +72,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -142,7 +142,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -212,7 +212,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -283,7 +283,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -354,7 +354,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -425,7 +425,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -495,7 +495,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -565,7 +565,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -645,7 +645,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -715,7 +715,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -786,7 +786,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -844,7 +844,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -915,7 +915,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -986,7 +986,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -1057,7 +1057,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -1130,7 +1130,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "" ] } @@ -1201,7 +1201,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -1281,7 +1281,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -1354,7 +1354,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } diff --git a/collections/hub/golden_path/transaction_request_service/authorizations.json b/collections/hub/golden_path/transaction_request_service/authorizations.json index f0e029a6..37e8db0a 100644 --- a/collections/hub/golden_path/transaction_request_service/authorizations.json +++ b/collections/hub/golden_path/transaction_request_service/authorizations.json @@ -59,7 +59,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } @@ -116,7 +116,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)" ] } diff --git a/collections/hub/golden_path/transaction_request_service/error-framework.json b/collections/hub/golden_path/transaction_request_service/error-framework.json index 3c442acc..95aae3d1 100644 --- a/collections/hub/golden_path/transaction_request_service/error-framework.json +++ b/collections/hub/golden_path/transaction_request_service/error-framework.json @@ -53,7 +53,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "/*", "if (environment.ENABLE_WS_ASSERTIONS===true) {", " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/callbacks/{$request.body.transferId}', 'payeecallback')", @@ -178,7 +178,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)", "", "environment.transferExpirationx= new Date(new Date().getTime() + 600000);", @@ -308,7 +308,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)", "", "environment.transferExpirationx= new Date(new Date().getTime() + 600000);", @@ -431,7 +431,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)", "", "environment.transferExpirationx= new Date(new Date().getTime() + 600000);", @@ -566,7 +566,7 @@ "scripts": { "preRequest": { "exec": [ - "environment.tranid = '{$function.generic.generateUUID}'", + "environment.tranid = '{$function.generic.generateID}'", "console.log(environment.tranid)", "", "//environment.transferExpirationx= new Date(new Date().getTime() + 600000);", diff --git a/collections/hub/golden_path/transaction_request_service/received State.json b/collections/hub/golden_path/transaction_request_service/received State.json index 29df6fbb..b19b628d 100644 --- a/collections/hub/golden_path/transaction_request_service/received State.json +++ b/collections/hub/golden_path/transaction_request_service/received State.json @@ -34,7 +34,7 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "transactionRequestId": "{$function.generic.generateUUID}", + "transactionRequestId": "{$function.generic.generateID}", "payee": { "partyIdInfo": { "partyIdType": "PERSONAL_ID", @@ -69,7 +69,7 @@ "initiator": "PAYEE", "initiatorType": "CONSUMER", "refundInfo": { - "originalTransactionId": "{$function.generic.generateUUID}", + "originalTransactionId": "{$function.generic.generateID}", "refundReason": "free text indicating reason for the refund" }, "balanceOfPayments": "123" @@ -105,7 +105,7 @@ "scripts": { "preRequest": { "exec": [ - "//environment.tranid = '{$function.generic.generateUUID}'", + "//environment.tranid = '{$function.generic.generateID}'", "//console.log(environment.tranid)", "", "environment.transferExpirationx= new Date(new Date().getTime() + 600000).toISOString();", diff --git a/collections/hub/golden_path/transaction_request_service/rejected State.json b/collections/hub/golden_path/transaction_request_service/rejected State.json index ff50a45d..7aef0f2d 100644 --- a/collections/hub/golden_path/transaction_request_service/rejected State.json +++ b/collections/hub/golden_path/transaction_request_service/rejected State.json @@ -34,7 +34,7 @@ "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}" }, "body": { - "transactionRequestId": "{$function.generic.generateUUID}", + "transactionRequestId": "{$function.generic.generateID}", "payee": { "partyIdInfo": { "partyIdType": "PERSONAL_ID", @@ -69,7 +69,7 @@ "initiator": "PAYEE", "initiatorType": "CONSUMER", "refundInfo": { - "originalTransactionId": "{$function.generic.generateUUID}", + "originalTransactionId": "{$function.generic.generateID}", "refundReason": "free text indicating reason for the refund" }, "balanceOfPayments": "123" @@ -105,7 +105,7 @@ "scripts": { "preRequest": { "exec": [ - "//environment.tranid = '{$function.generic.generateUUID}'", + "//environment.tranid = '{$function.generic.generateID}'", "//console.log(environment.tranid)", "", "environment.transferExpirationx= new Date(new Date().getTime() + 600000).toISOString();", diff --git a/collections/hub/inter_scheme/as_payee_scheme/happy_path/discovery.json b/collections/hub/inter_scheme/as_payee_scheme/happy_path/discovery.json new file mode 100644 index 00000000..4abb8cbd --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/happy_path/discovery.json @@ -0,0 +1,96 @@ +{ + "name": "Party Lookup Happy Path", + "test_cases": [ + { + "id": "1", + "name": "Party Lookup for ProxyAB if not cached", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "nonexistentpayerfsp", + "FSPIOP-Proxy": "{$inputs.PROXY1_NAME}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Source Header same as Payeefsp Id", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}')" + ] + }, + { + "id": 3, + "description": "Response Destination Header same as Payerfsp Id", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}')" + ] + }, + { + "id": 4, + "description": "Callback content-type to be parties", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.parties+json;version={$inputs.expectedPartiesVersion}')" + ] + }, + { + "id": 5, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}')" + ] + }, + { + "id": 6, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID}')" + ] + }, + { + "id": 7, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.personalInfo.complexName.firstName).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_FIRST_NAME}')" + ] + }, + { + "id": 8, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.personalInfo.complexName.lastName).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_LAST_NAME}')" + ] + } + ] + } + } + ] + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payee_scheme/happy_path/quotes.json b/collections/hub/inter_scheme/as_payee_scheme/happy_path/quotes.json new file mode 100644 index 00000000..ffff2039 --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/happy_path/quotes.json @@ -0,0 +1,409 @@ +{ + "name": "Quotes Happy Path", + "test_cases": [ + { + "id": 1, + "name": "Proxy Quoting Service", + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to send a request for Quote (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "nonexistentpayerfsp", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "nonexistentpayerfsp" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Source equal to request FSP Destination", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$request.headers['FSPIOP-Destination']}')" + ] + }, + { + "id": 5, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount to match the request", + "exec": [ + "expect(callback.body.payeeReceiveAmount.amount).to.equal('{$request.body.amount.amount}')" + ] + }, + { + "id": 7, + "description": "Callback currency to match the request", + "exec": [ + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 8, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')" + ] + }, + { + "id": 9, + "description": "Request amountType to be RECEIVE", + "exec": [ + "expect('{$request.body.amountType}').to.equal('RECEIVE')" + ] + }, + { + "id": 10, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 12, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + }, + "path": "/quotes", + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + }, + { + "id": "2", + "name": "Party Lookup for other proxy in Scheme if not cached", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_OTHER_PROXY_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_OTHER_PROXY_PARTY_ID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYERFSP_OTHER_PROXY_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Proxy Header should not be set", + "exec": [ + "expect(callback.headers['fspiop-proxy']).to.equal('')" + ] + }, + { + "id": 3, + "description": "Response Source Header same as TODO", + "exec": [ + "expect('{$callback.headers['FSPIOP-Source']}').to.equal('TODO')" + ] + }, + { + "id": 4, + "description": "Response Destination Header same as Payerfsp Id", + "exec": [ + "expect('{$callback.headers['FSPIOP-Destination']}').to.equal('{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}')" + ] + }, + { + "id": 5, + "description": "an error callback is expected", + "exec": [ + "expect(callback.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYERFSP_OTHER_PROXY_ERROR_CODE}')", + "expect(callback.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYERFSP_OTHER_PROXY_ERROR_DESCRIPTION}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "2", + "description": "Send Oracle lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.toIdValue}" + }, + "headers": { + "Accept": "application/vnd.interoperability.participants+json;version=1.0", + "Content-Type": "application/vnd.interoperability.participants+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "payerfsp", + "FSPIOP-Destination": "payeefsp" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Oracle should not have payeeDFSP set", + "exec": [ + "expect(response.fspId).to.equal('')" + ] + } + ] + }, + "disabled": true + } + ] + }, + { + "id": "3", + "name": "Party Lookup for Proxy in Scheme if it is cached", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_OTHER_PROXY_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_OTHER_PROXY_PARTY_ID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYERFSP_OTHER_PROXY_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Proxy Header should not be set", + "exec": [ + "expect(callback.headers['fspiop-proxy']).to.equal('')" + ] + }, + { + "id": 3, + "description": "Response Source Header same as TODO", + "exec": [ + "expect('{$callback.headers['FSPIOP-Source']}').to.equal('TODO')" + ] + }, + { + "id": 4, + "description": "Response Destination Header same as Payerfsp Id", + "exec": [ + "expect('{$callback.headers['FSPIOP-Destination']}').to.equal('{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}')" + ] + }, + { + "id": 5, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_FIRST_NAME}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_LAST_NAME}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "2", + "description": "Send Oracle lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.toIdValue}" + }, + "headers": { + "Accept": "application/vnd.interoperability.participants+json;version=1.0", + "Content-Type": "application/vnd.interoperability.participants+json;version=1.0", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "payerfsp", + "FSPIOP-Destination": "payeefsp" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Oracle should not have payeeDFSP set", + "exec": [ + "expect(response.fspId).to.equal('')" + ] + } + ] + }, + "disabled": true + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payee_scheme/happy_path/transfers.json b/collections/hub/inter_scheme/as_payee_scheme/happy_path/transfers.json new file mode 100644 index 00000000..d5a7fdcd --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/happy_path/transfers.json @@ -0,0 +1,249 @@ +{ + "name": "Quotes Happy Path", + "test_cases": [ + { + "id": 1, + "name": "Proxy Transfers Service", + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to send a request for Quote (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "FSPIOP-Proxy": "{$inputs.PROXY_HEADER}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Source equal to request FSP Destination", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$request.headers['FSPIOP-Destination']}')" + ] + }, + { + "id": 5, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')" + ] + }, + { + "id": 8, + "description": "Request amountType to be RECEIVE", + "exec": [ + "expect('{$request.body.amountType}').to.equal('RECEIVE')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + }, + "path": "/quotes", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "This request allows us to send a request for Transfer (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "FSPIOP-Proxy": "{$inputs.PROXY_HEADER}" + }, + "body": { + "transferId": "{$prev.1.request.body.transactionId}", + "payerFsp": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$prev.1.callback.body.transferAmount.amount}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$prev.1.callback.body.expiration}", + "ilpPacket": "{$prev.1.callback.body.ilpPacket}", + "condition": "{$prev.1.callback.body.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/proxy/as_payee/happy_path", + "labels": [ + "transfers" + ] + } + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/discovery.json b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/discovery.json new file mode 100644 index 00000000..9f0be8bd --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/discovery.json @@ -0,0 +1,60 @@ +{ + "name": "Party Lookup Negative Scenarios", + "test_cases": [ + { + "id": "1", + "name": "Test Case for scenario when there is an error in payee dfsp", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID_ERROR}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "FSPIOP-Proxy": "{$inputs.PROXY_HEADER}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYEE_DFSP_ERROR_CODE_5XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_DFSP_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/quotes.json b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/quotes.json new file mode 100644 index 00000000..34745ea5 --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/quotes.json @@ -0,0 +1,87 @@ +{ + "name": "Quotes Negative Scenarios", + "test_cases": [ + { + "id": "1", + "name": "Test Case for scenario when there is an error in payee dfsp", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "FSPIOP-Proxy": "{$inputs.PROXY_HEADER}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_PARTY_ID_ERROR}", + "fspId": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_TEST_PAYEE_DFSP_ERROR_CODE_5XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_DFSP_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + } + } + ] + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/transfers.json b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/transfers.json new file mode 100644 index 00000000..bfdd5a43 --- /dev/null +++ b/collections/hub/inter_scheme/as_payee_scheme/negative_scenarios/transfers.json @@ -0,0 +1,78 @@ +{ + "name": "Transfers Negative Scenarios", + "test_cases": [ + { + "id": 1, + "name": "Proxy Transfers Service when there is an error in payee dfsp", + "requests": [ + { + "id": 1, + "meta": { + "info": "Test Case for scenario when there is an error in payee dfsp" + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "FSPIOP-Proxy": "{$inputs.PROXY_HEADER}" + }, + "body": { + "transferId": "{$function.generic.generateID}", + "payerFsp": "{$inputs.PROXY_PAYEE_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYEE_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$inputs.PROXY_PAYEE_DFSP_ERROR_AMOUNT_5XXX}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$inputs.expiration}", + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "path": "/quotes", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ] + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/happy_path/discovery.json b/collections/hub/inter_scheme/as_payer_scheme/happy_path/discovery.json new file mode 100644 index 00000000..042043e4 --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/happy_path/discovery.json @@ -0,0 +1,142 @@ +{ + "name": "Party Lookup Happy Path", + "test_cases": [ + { + "id": "1", + "name": "Party Lookup for ProxyAB if not cached", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Proxy Header should be set", + "exec": [ + "expect(callback.headers['fspiop-proxy']).to.equal('{$inputs.PROXY_HEADER}')" + ] + }, + { + "id": 3, + "description": "Response Source Header same as Payeefsp Id", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}')" + ] + }, + { + "id": 4, + "description": "Response Destination Header same as Payerfsp Id", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}')" + ] + }, + { + "id": 5, + "description": "Callback content-type to be parties", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.parties+json;version={$inputs.expectedPartiesVersion}')" + ] + }, + { + "id": 6, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}')" + ] + }, + { + "id": 7, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}')" + ] + }, + { + "id": 8, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.personalInfo.complexName.firstName).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_FIRST_NAME}')" + ] + }, + { + "id": 9, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.personalInfo.complexName.lastName).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_LAST_NAME}')" + ] + } + ] + } + }, + { + "id": "2", + "description": "Send Oracle lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ORACLE}", + "operationPath": "/participants/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}" + }, + "headers": { + "Accept": "application/vnd.interoperability.participants+json;version=1.0", + "Content-Type": "application/vnd.interoperability.participants+json;version=1.0", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Oracle has Proxy Payee DFSP set", + "exec": [ + "expect(response.body.partyList[0].fspId).to.equal('{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/happy_path/quotes.json b/collections/hub/inter_scheme/as_payer_scheme/happy_path/quotes.json new file mode 100644 index 00000000..b2dba022 --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/happy_path/quotes.json @@ -0,0 +1,177 @@ +{ + "name": "Quotes Happy Path", + "test_cases": [ + { + "id": 1, + "name": "Proxy Quoting Service", + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to send a request for Quote (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Source equal to request FSP Destination", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$request.headers['FSPIOP-Destination']}')" + ] + }, + { + "id": 5, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')" + ] + }, + { + "id": 8, + "description": "Request amountType to be RECEIVE", + "exec": [ + "expect('{$request.body.amountType}').to.equal('RECEIVE')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + }, + "path": "/quotes", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/happy_path/transfers.json b/collections/hub/inter_scheme/as_payer_scheme/happy_path/transfers.json new file mode 100644 index 00000000..cb09ac00 --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/happy_path/transfers.json @@ -0,0 +1,247 @@ +{ + "name": "Transfers Happy Path", + "test_cases": [ + { + "id": 1, + "name": "Proxy Transfers Service", + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to send a request for Quote (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Source equal to request FSP Destination", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$request.headers['FSPIOP-Destination']}')" + ] + }, + { + "id": 5, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')" + ] + }, + { + "id": 8, + "description": "Request amountType to be RECEIVE", + "exec": [ + "expect('{$request.body.amountType}').to.equal('RECEIVE')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + }, + "path": "/quotes", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "This request allows us to send a request for Transfer (payerfsp to payeefsp), for the calculation of possible fees and FSP commission involved in performing an interoperable financial transaction." + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "transferId": "{$prev.1.request.body.transactionId}", + "payerFsp": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$prev.1.callback.body.transferAmount.amount}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$prev.1.callback.body.expiration}", + "ilpPacket": "{$prev.1.callback.body.ilpPacket}", + "condition": "{$prev.1.callback.body.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + } + ] + }, + "path": "/transfers", + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + } + ] +} \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/discovery.json b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/discovery.json new file mode 100644 index 00000000..4d062883 --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/discovery.json @@ -0,0 +1,764 @@ +{ + "name": "Party Lookup Negative Scenarios", + "test_cases": [ + { + "id": "1", + "name": "Test Case for Bad Request - 400", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + }, + { + "id": 2, + "description": "Response error code to be 3102", + "exec": [ + "expect(response.body.errorInformation.errorCode).to.equal('3102')" + ] + } + ] + } + } + ] + }, + { + "id": "2", + "name": "Test Case for error in Payer Scheme", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 2xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYER_SCHEME_2XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_CODE_2XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_DESCRIPTION_2XXX}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "2", + "description": "Negative test case for error code 3xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYER_SCHEME_3XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_CODE_3XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_DESCRIPTION_3XXX}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "3", + "description": "Negative test case for error code 4xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYER_SCHEME_4XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_CODE_4XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_DESCRIPTION_4XXX}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "4", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYER_SCHEME_5XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_CODE_5XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYER_SCHEME_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + }, + "disabled": true + } + ] + }, + { + "id": "3", + "name": "Test Case for scenario where the receiving dfsp is not in payer proxy cache", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('${inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE_ERROR_CODE}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('${inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE_ERROR_DESCRIPTION}')" + ] + } + ] + }, + "disabled": true + } + ] + }, + { + "id": "4", + "name": "Test Case for scenario when there is an error in proxy", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Source Header should be proxy", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$inputs.PROXY_HEADER}')" + ] + }, + { + "id": 3, + "description": "Response Destination Header same as Payerfsp Id", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}')" + ] + }, + { + "id": 4, + "description": "Callback response has errorCode", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY_ERROR_CODE}')" + ] + }, + { + "id": 5, + "description": "Callback response has errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY_ERROR_DESCRIPTION}')" + ] + } + ] + } + } + ] + }, + { + "id": "5", + "name": "Test Case for scenario when there is an error in payee scheme", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 2xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_2XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_2XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_2XXX}')" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "await custom.sleep(maxRetryWait)" + ] + } + } + }, + { + "id": "2", + "description": "Negative test case for error code 3xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_3XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_3XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_3XXX}')" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "await custom.sleep(maxRetryWait)" + ] + } + } + }, + { + "id": "3", + "description": "Negative test case for error code 4xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_4XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_4XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_4XXX}')" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "await custom.sleep(maxRetryWait)" + ] + } + } + }, + { + "id": "4", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_5XXX}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_5XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "await custom.sleep(maxRetryWait)" + ] + } + } + } + ] + }, + { + "id": "6", + "name": "Test Case for scenario when there is an error in payee dfsp", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID_ERROR}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_TEST_PAYEE_DFSP_ERROR_CODE_5XXX}')" + ] + }, + { + "id": 3, + "description": "Callback response has errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_DFSP_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + } + } + ] + }, + { + "id": "7", + "name": "Party Lookup for scenario when there is an eror in Oracle", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_ORACLE_ERROR}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_ORACLE_ERROR_ERROR_CODE}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_ORACLE_ERROR_ERROR_DESCRIPTION}')" + ] + } + ] + }, + "disabled": true + } + ] + }, + { + "id": "8", + "name": "Party Lookup for Payer Cache no longer valid", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/parties/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_CACHE_NOT_VALID}" + }, + "headers": { + "Accept": "{$inputs.acceptParties}", + "Content-Type": "{$inputs.contentTypeParties}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_CACHE_NOT_VALID_ERROR_CODE}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_CACHE_NOT_VALID_ERROR_DESCRIPTION}')" + ] + } + ] + }, + "disabled": true + }, + { + "id": "2", + "description": "Send Oracle lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "method": "get", + "params": { + "Type": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "ID": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_PAYER_SCHEME_CACHE_NOT_VALID}" + }, + "headers": { + "Accept": "application/vnd.interoperability.participants+json;version=1.0", + "Content-Type": "application/vnd.interoperability.participants+json;version=1.0", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Oracle should not have mapping for the party ID", + "exec": [ + "expect(response.fspId).to.equal('')" + ] + } + ] + }, + "disabled": true + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/quotes.json b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/quotes.json new file mode 100644 index 00000000..22d7b28e --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/quotes.json @@ -0,0 +1,642 @@ +{ + "name": "Quotes Negative Scenarios", + "test_cases": [ + { + "id": "1", + "name": "Test Case for Bad Request - 400", + "requests": [ + { + "id": "1", + "description": "Quote request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + }, + "dateOfBirth": "{$inputs.PROXY_PAYERFSP_PARTY_DOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 400", + "exec": [ + "expect(response.status).to.equal(400)" + ] + } + ] + } + } + ] + }, + { + "id": "2", + "name": "Test Case for scenario where the receiving dfsp is not in payer proxy cache", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + }, + "dateOfBirth": "{$inputs.PROXY_PAYERFSP_PARTY_DOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('${inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE_ERROR_CODE}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('${inputs.PROXY_PAYEEFSP_PARTY_ID_NOT_IN_PAYER_PROXY_CACHE_ERROR_DESCRIPTION}')" + ] + } + ] + }, + "disabled": true + } + ] + }, + { + "id": "3", + "name": "Test Case for scenario when there is an error in proxy", + "requests": [ + { + "id": "1", + "description": "Send party lookup request", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response Source Header should be proxy", + "exec": [ + "expect(callback.headers['fspiop-source']).to.equal('{$inputs.PROXY_HEADER}')" + ] + }, + { + "id": 3, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 4, + "description": "Callback response has errorCode", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY_ERROR_CODE}')" + ] + }, + { + "id": 5, + "description": "Callback response has errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_IN_PROXY_ERROR_DESCRIPTION}')" + ] + } + ] + } + } + ] + }, + { + "id": "4", + "name": "Test Case for scenario when there is an error in payee scheme", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 2xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_2XXX}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_2XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_2XXX}')" + ] + } + ] + } + }, + { + "id": "2", + "description": "Negative test case for error code 3xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_3XXX}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_3XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_3XXX}')" + ] + } + ] + } + }, + { + "id": "3", + "description": "Negative test case for error code 4xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_4XXX}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_4XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_4XXX}')" + ] + } + ] + } + }, + { + "id": "4", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_ERROR_PAYEE_SCHEME_5XXX}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_CODE_5XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_SCHEME_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + } + } + ] + }, + { + "id": "5", + "name": "Test Case for scenario when there is an error in payee dfsp", + "requests": [ + { + "id": "1", + "description": "Negative test case for error code 5xxx", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "operationPath": "/quotes", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYERFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYERFSP_PARTY_ID}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.PROXY_PAYERFSP_PARTY_FIRST_NAME}", + "lastName": "{$inputs.PROXY_PAYERFSP_PARTY_LAST_NAME}" + } + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$inputs.PROXY_PAYEEFSP_PARTY_ID_TYPE}", + "partyIdentifier": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_PARTY_ID_ERROR}", + "fspId": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + } + }, + "amountType": "RECEIVE", + "amount": { + "amount": "{$inputs.PROXY_AMOUNT}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + } + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Callback response has errorCode and errorDescription", + "exec": [ + "expect(callback.body.errorInformation.errorCode).to.equal('{$inputs.PROXY_PAYER_TEST_PAYEE_DFSP_ERROR_CODE_5XXX}')", + "expect(callback.body.errorInformation.errorDescription).to.equal('{$inputs.PROXY_PAYEE_DFSP_ERROR_DESCRIPTION_5XXX}')" + ] + } + ] + } + } + ] + } + ] + } \ No newline at end of file diff --git a/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/transfers.json b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/transfers.json new file mode 100644 index 00000000..b3ebdc29 --- /dev/null +++ b/collections/hub/inter_scheme/as_payer_scheme/negative_scenarios/transfers.json @@ -0,0 +1,239 @@ +{ + "name": "Transfers Negative Scenarios", + "test_cases": [ + { + "id": 1, + "name": "Test Case for scenario when there is an error in proxy", + "requests": [ + { + "id": 1, + "meta": { + "info": "Test Case for scenario when there is an error in proxy" + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "transferId": "{$function.generic.generateID}", + "payerFsp": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$inputs.PROXY_PAYEEFSP_AMOUNT_ERROR_IN_PROXY}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$inputs.expiration}", + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "path": "/transfers", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + }, + { + "id": 2, + "name": "Test Case for scenario when there is an error in payee scheme", + "requests": [ + { + "id": 1, + "meta": { + "info": "Test Case for scenario when there is an error in proxy" + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "transferId": "{$function.generic.generateID}", + "payerFsp": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$inputs.PROXY_PAYEEFSP_AMOUNT_ERROR_IN_PROXY}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$inputs.expiration}", + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "path": "/transfers", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + }, + { + "id": 3, + "name": "Test Case for scenario when there is an error in payee dfsp", + "requests": [ + { + "id": 1, + "meta": { + "info": "Test Case for scenario when there is an error in proxy" + }, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "operationPath": "/transfers", + "method": "post", + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}", + "FSPIOP-Destination": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}" + }, + "body": { + "transferId": "{$function.generic.generateID}", + "payerFsp": "{$inputs.PROXY_PAYER_TEST_PAYERFSP_ID}", + "payeeFsp": "{$inputs.PROXY_PAYER_TEST_PAYEEFSP_ID}", + "amount": { + "amount": "{$inputs.PROXY_PAYEEFSP_AMOUNT_ERROR_IN_PROXY}", + "currency": "{$inputs.PROXY_AMOUNT_CURRENCY}" + }, + "expiration": "{$inputs.expiration}", + "ilpPacket": "{$inputs.ilpPacket}", + "condition": "{$inputs.condition}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "path": "/transfers", + + "scripts": { + "preRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " await websocket.connect(environment.PAYEEFSP_SDK_TESTAPI_WS_URL + '/requests/{$request.body.quoteId}', 'payeeRequest')", + "}" + ] + }, + "postRequest": { + "exec": [ + "if (environment.ENABLE_WS_ASSERTIONS===true) {", + " environment.payeeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/quoting_service/quoting_service.json", + "labels": [ + "quotes" + ] + } + } + ] + } \ No newline at end of file diff --git a/collections/hub/master.json b/collections/hub/master.json index 2c806858..124f59cc 100644 --- a/collections/hub/master.json +++ b/collections/hub/master.json @@ -5,23 +5,19 @@ "type": "folder" }, { - "name": "golden_path", - "type": "folder" - }, - { - "name": "other_tests", + "name": "provisioning", "type": "folder" }, { - "name": "provisioning_sdkbulk", + "name": "golden_path", "type": "folder" }, { - "name": "provisioning_thirdparty", + "name": "thirdparty", "type": "folder" }, { - "name": "provisioning", + "name": "inter_scheme", "type": "folder" }, { @@ -33,11 +29,7 @@ "type": "folder" }, { - "name": "thirdparty", - "type": "folder" - }, - { - "name": "provisioning_dfsp", + "name": "other_tests", "type": "folder" } ] diff --git a/collections/hub/other_tests/bulk_transfers/bulk-duplicated-transfers.json b/collections/hub/other_tests/bulk_transfers/bulk-duplicated-transfers.json index 27b363d2..414bced0 100644 --- a/collections/hub/other_tests/bulk_transfers/bulk-duplicated-transfers.json +++ b/collections/hub/other_tests/bulk_transfers/bulk-duplicated-transfers.json @@ -35,12 +35,12 @@ }, "body": { "bulkTransferId": "{$environment.transid}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -61,7 +61,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -372,7 +372,7 @@ "preRequest": { "exec": [ "const delay = 1000 * 3600 * 24", - "environment.transid =\"{$function.generic.generateUUID}\"", + "environment.transid =\"{$function.generic.generateID}\"", "const now = new Date()", "const expirationDate = new Date(now.getTime() + delay).toISOString();", "const completedTimestamp = now.toISOString();", @@ -525,7 +525,7 @@ "preRequest": { "exec": [ "const delay = 1000 * 3600 * 24", - "//environment.transid =\"{$function.generic.generateUUID}\"", + "//environment.transid =\"{$function.generic.generateID}\"", "const now = new Date()", "const expirationDate = new Date(now.getTime() + delay).toISOString();", "const completedTimestamp = now.toISOString();", @@ -579,12 +579,12 @@ }, "body": { "bulkTransferId": "{$environment.transid}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -605,7 +605,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -916,7 +916,7 @@ "preRequest": { "exec": [ "const delay = 1000 * 3600 * 24", - "environment.transid =\"{$function.generic.generateUUID}\"", + "environment.transid =\"{$function.generic.generateID}\"", "const now = new Date()", "const expirationDate = new Date(now.getTime() + delay).toISOString();", "const completedTimestamp = now.toISOString();", @@ -976,7 +976,7 @@ "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -997,7 +997,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -1065,7 +1065,7 @@ "preRequest": { "exec": [ "const delay = 1000 * 3600 * 24", - "//environment.transid =\"{$function.generic.generateUUID}\"", + "//environment.transid =\"{$function.generic.generateID}\"", "const now = new Date()", "const expirationDate = new Date(now.getTime() + delay).toISOString();", "const completedTimestamp = now.toISOString();", diff --git a/collections/hub/other_tests/bulk_transfers/bulk-invalid-dfsp-name-header-and-body.json b/collections/hub/other_tests/bulk_transfers/bulk-invalid-dfsp-name-header-and-body.json index d1b25da5..eaedebca 100644 --- a/collections/hub/other_tests/bulk_transfers/bulk-invalid-dfsp-name-header-and-body.json +++ b/collections/hub/other_tests/bulk_transfers/bulk-invalid-dfsp-name-header-and-body.json @@ -34,13 +34,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "DUMMY", "payerFsp": "{$environment.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -61,7 +61,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" @@ -152,13 +152,13 @@ "FSPIOP-Destination": "DUMMY" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$environment.toFspId}", "payerFsp": "{$environment.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -179,7 +179,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" @@ -271,13 +271,13 @@ "FSPIOP-Destination": "DUMMY" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "DUMMY", "payerFsp": "{$environment.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -298,7 +298,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" @@ -402,13 +402,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "DUMMY", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -429,7 +429,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" @@ -569,13 +569,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -596,7 +596,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" @@ -773,13 +773,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -800,7 +800,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "GBP", "amount": "2" diff --git a/collections/hub/other_tests/bulk_transfers/bulk-warm-up.json b/collections/hub/other_tests/bulk_transfers/bulk-warm-up.json index 923772e3..d60b022f 100644 --- a/collections/hub/other_tests/bulk_transfers/bulk-warm-up.json +++ b/collections/hub/other_tests/bulk_transfers/bulk-warm-up.json @@ -34,13 +34,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -61,7 +61,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -244,13 +244,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -271,7 +271,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -454,13 +454,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -481,7 +481,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" diff --git a/collections/hub/other_tests/bulk_transfers/fspiop_protocol_validation.json b/collections/hub/other_tests/bulk_transfers/fspiop_protocol_validation.json index 6d8ecb8c..3c929a3f 100644 --- a/collections/hub/other_tests/bulk_transfers/fspiop_protocol_validation.json +++ b/collections/hub/other_tests/bulk_transfers/fspiop_protocol_validation.json @@ -34,13 +34,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -61,7 +61,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -423,13 +423,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -450,7 +450,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" @@ -565,13 +565,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -592,7 +592,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" diff --git a/collections/hub/other_tests/bulk_transfers/negative_scenarios.json b/collections/hub/other_tests/bulk_transfers/negative_scenarios.json index c2ee11f8..955725a8 100644 --- a/collections/hub/other_tests/bulk_transfers/negative_scenarios.json +++ b/collections/hub/other_tests/bulk_transfers/negative_scenarios.json @@ -500,13 +500,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$environment.toFspId}", "payerFsp": "{$environment.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -527,7 +527,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "AED", "amount": "2" diff --git a/collections/hub/other_tests/bulk_transfers/positive_scenarios.json b/collections/hub/other_tests/bulk_transfers/positive_scenarios.json index ecbf1581..e870de5f 100644 --- a/collections/hub/other_tests/bulk_transfers/positive_scenarios.json +++ b/collections/hub/other_tests/bulk_transfers/positive_scenarios.json @@ -34,13 +34,13 @@ "FSPIOP-Destination": "{$inputs.toFspId}" }, "body": { - "bulkTransferId": "{$function.generic.generateUUID}", - "bulkQuoteId": "{$function.generic.generateUUID}", + "bulkTransferId": "{$function.generic.generateID}", + "bulkQuoteId": "{$function.generic.generateID}", "payeeFsp": "{$inputs.toFspId}", "payerFsp": "{$inputs.fromFspId}", "individualTransfers": [ { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency}", "amount": "1" @@ -61,7 +61,7 @@ } }, { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "transferAmount": { "currency": "{$inputs.currency2}", "amount": "1" diff --git a/collections/hub/golden_path/settlement_cgs/newsetcgs.json b/collections/hub/other_tests/settlement_cgs/newsetcgs.json similarity index 99% rename from collections/hub/golden_path/settlement_cgs/newsetcgs.json rename to collections/hub/other_tests/settlement_cgs/newsetcgs.json index 027ed061..af88eef0 100644 --- a/collections/hub/golden_path/settlement_cgs/newsetcgs.json +++ b/collections/hub/other_tests/settlement_cgs/newsetcgs.json @@ -1001,7 +1001,7 @@ "id": "{$environment.testfsp1SettlementAccountId}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", @@ -1057,7 +1057,7 @@ "id": "{$environment.testfsp2SettlementAccountId}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", @@ -1113,7 +1113,7 @@ "id": "{$environment.testfsp3SettlementAccountId}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", @@ -1169,7 +1169,7 @@ "id": "{$environment.testfsp4SettlementAccountId}" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", diff --git a/collections/hub/other_tests/settlement_fx/settlement_tests.json b/collections/hub/other_tests/settlement_fx/settlement_tests.json new file mode 100644 index 00000000..e3cb436c --- /dev/null +++ b/collections/hub/other_tests/settlement_fx/settlement_tests.json @@ -0,0 +1,1397 @@ +{ + "options": {}, + "name": "collections_tests_fx_fx_tests", + "test_cases": [ + { + "id": 1, + "name": "Settlement FX Transfer tests", + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + }, + "meta": { + "info": "FX Transfer" + }, + "requests": [ + { + "id": 1, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_1.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_1.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_1.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_1.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_1.1/trigger_templates" + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.toIdValue}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.toIdValue}" + }, + "body": { + "fspId": "{$inputs.payeefsp}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "FSPIOP-Source": "{$inputs.toFspId}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + } + }, + { + "id": 2, + "description": "Get party info Copy", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "additionalApi": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/parties/{Type}/{ID}", + "path": "/parties/MSISDN/{$inputs.toIdValue}", + "method": "get", + "params": { + "Type": "MSISDN", + "ID": "{$inputs.toIdValue}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentType}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "Accept": "{$inputs.accept}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback body should contain party", + "exec": [ + "expect(callback.body).to.have.property('party')" + ] + }, + { + "id": 6, + "description": "Callback FSPIOP-Destination same as request FSPIOP-Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 8, + "description": "Callback partyIdInfo (partyIdType, partyIdentifier)", + "exec": [ + "expect(callback.body.party.partyIdInfo.partyIdType).to.equal('{$inputs.toIdType}')", + "expect(callback.body.party.partyIdInfo.partyIdentifier).to.equal('{$inputs.toIdValue}')" + ] + } + ] + } + }, + { + "id": 3, + "description": "GET /services/FXP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "prefix": "/v2", + "additionalApi": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/services/FXP", + "path": "/services/FXP", + "method": "get", + "url": "{$inputs.HOST_FXP_SERVICES}", + "disabled": false, + "headers": { + "Content-Type": "{$inputs.contentTypeServicesFxp}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "Accept": "{$inputs.acceptServicesFxp}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback body should contain providers", + "exec": [ + "expect(callback.body).to.have.property('providers')", + "expect(callback.body.providers.length).to.be.at.least(1)" + ] + }, + { + "id": 6, + "description": "Callback FSPIOP-Destination same as request FSPIOP-Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + } + ] + } + }, + { + "id": 4, + "description": "POST /fxQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxQuotes", + "path": "/fxQuotes", + "method": "post", + "body": { + "conversionRequestId": "{$function.generic.generateID}", + "conversionTerms": { + "conversionId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "expiration": "{$inputs.FX_EXPIRATION}" + } + }, + "headers": { + "Accept": "{$inputs.acceptFxQuotes}", + "Content-Type": "{$inputs.contentTypeFxQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain conversionTerms", + "exec": [ + "expect(callback.body).to.have.property('conversionTerms')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.conversionTerms.sourceAmount.currency).to.equal('{$request.body.conversionTerms.sourceAmount.currency}')", + "expect(callback.body.conversionTerms.targetAmount.currency).to.equal('{$request.body.conversionTerms.targetAmount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be fxQuotes", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxQuotes+json')" + ] + }, + { + "id": 16, + "description": "Callback body should contain condition", + "exec": [ + "expect(callback.body).to.have.property('condition')" + ] + }, + { + "id": 17, + "description": "Callback body should contain target amount", + "exec": [ + "expect(callback.body.conversionTerms.targetAmount).to.have.property('amount')" + ] + } + ] + } + }, + { + "id": 5, + "description": "POST /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/quotes", + "path": "/quotes", + "method": "post", + "url": "{$inputs.HOST_QUOTING_SERVICE}", + "headers": { + "Accept": "{$inputs.acceptQuotes}", + "Content-Type": "{$inputs.contentTypeQuotes}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}", + "FSPIOP-Destination": "{$inputs.FXP_PAYEE_DFSP_ID}" + }, + "body": { + "quoteId": "{$function.generic.generateID}", + "transactionId": "{$function.generic.generateID}", + "transactionRequestId": "{$function.generic.generateID}", + "payer": { + "partyIdInfo": { + "partyIdType": "{$inputs.fromIdType}", + "partyIdentifier": "{$inputs.fromIdValue}", + "fspId": "{$inputs.fromFspId}" + }, + "personalInfo": { + "complexName": { + "firstName": "{$inputs.fromFirstName}", + "lastName": "{$inputs.fromLastName}" + }, + "dateOfBirth": "{$inputs.fromDOB}" + } + }, + "payee": { + "partyIdInfo": { + "partyIdType": "{$prev.2.callback.body.party.partyIdInfo.partyIdType}", + "partyIdentifier": "{$prev.2.callback.body.party.partyIdInfo.partyIdentifier}", + "fspId": "{$prev.2.callback.body.party.partyIdInfo.fspId}" + } + }, + "amountType": "SEND", + "amount": { + "amount": "{$inputs.amount}", + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "{$inputs.note}" + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback body should contain transferAmount", + "exec": [ + "expect(callback.body).to.have.property('transferAmount')" + ] + }, + { + "id": 6, + "description": "Callback transferAmount (amount & currency)to match the request", + "exec": [ + "expect(callback.body.transferAmount.amount).to.equal('{$request.body.amount.amount}')", + "expect(callback.body.transferAmount.currency).to.equal('{$request.body.amount.currency}')" + ] + }, + { + "id": 7, + "description": "Callback content-type to be quotes", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.quotes+json;version={$inputs.expectedQuotesVersion}')" + ] + }, + { + "id": 9, + "description": "Request transactionType scenario to be TRANSFER", + "exec": [ + "expect('{$request.body.transactionType.scenario}').to.equal('TRANSFER')" + ] + }, + { + "id": 10, + "description": "Request transactionType initiator to be PAYER", + "exec": [ + "expect('{$request.body.transactionType.initiator}').to.equal('PAYER')" + ] + }, + { + "id": 11, + "description": "Request transactionType initiatorType to be CONSUMER", + "exec": [ + "expect('{$request.body.transactionType.initiatorType}').to.equal('CONSUMER')" + ] + } + ] + } + }, + { + "id": 6, + "description": "Get Accounts for FXP BEFORE fxTransfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance before FxTransfer=${environment.fxpSourceCurrencyPositionBalanceBeforeFxTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance before FxTransfer=${environment.fxpTargetCurrencyPositionBalanceBeforeFxTransfer}`);" + ] + } + } + }, + { + "id": 7, + "description": "POST /fxTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/fxTransfers", + "path": "/fxTransfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "headers": { + "Accept": "{$inputs.acceptFxTransfers}", + "Content-Type": "{$inputs.contentTypeFxTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "body": { + "commitRequestId": "{$prev.4.callback.body.conversionTerms.conversionId}", + "determiningTransferId": "{$function.generic.generateID}", + "initiatingFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "counterPartyFsp": "{$inputs.FX_TESTFXP1_ID}", + "amountType": "SEND", + "sourceAmount": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "{$inputs.FX_SOURCE_AMOUNT}" + }, + "targetAmount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.FX_TARGET_AMOUNT}" + }, + "condition": "{$prev.4.callback.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "scriptingEngine": "javascript", + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback conversionState to be RESERVED", + "exec": [ + "expect(callback.body.conversionState).to.equal('RESERVED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be fxTransfers", + "exec": [ + "expect(callback.headers['content-type']).to.have.string('application/vnd.interoperability.fxTransfers+json')" + ] + }, + { + "id": 8, + "description": "Callback body should contain fulfilment", + "exec": [ + "expect(callback.body).to.have.property('fulfilment')" + ] + }, + { + "id": 9, + "description": "Request FSP source the same as quote callback FSP destination", + "exec": [ + "expect('{$request.headers['FSPIOP-Source']}').to.equal('{$prev.4.callback.headers.fspiop-destination}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 8, + "description": "POST /transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": "{$inputs.HOST_ML_API_ADAPTER}", + "body": { + "transferId": "{$prev.6.request.body.determiningTransferId}", + "payeeFsp": "{$inputs.FXP_PAYEE_DFSP_ID}", + "payerFsp": "{$inputs.FX_PAYER_DFSP_ID}", + "amount": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "amount": "{$inputs.amount}" + }, + "ilpPacket": "{$prev.5.callback.body.ilpPacket}", + "condition": "{$prev.5.callback.body.condition}", + "expiration": "{$requestVariables.expiration}" + }, + "headers": { + "Accept": "{$inputs.acceptTransfers}", + "Content-Type": "{$inputs.contentTypeTransfers}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.FX_PAYER_DFSP_ID}" + }, + "disabled": false, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + }, + { + "id": 2, + "description": "Response statusText be Accepted", + "exec": [ + "expect(response.statusText).to.equal('Accepted')" + ] + }, + { + "id": 3, + "description": "Callback Content Length not 0", + "exec": [ + "expect(callback.headers['Content-Length']).to.not.equal('0')" + ] + }, + { + "id": 4, + "description": "Callback FSP Destination equal to request FSP Source", + "exec": [ + "expect(callback.headers['fspiop-destination']).to.equal('{$request.headers['FSPIOP-Source']}')" + ] + }, + { + "id": 5, + "description": "Callback transferState to be COMMITTED", + "exec": [ + "expect(callback.body.transferState).to.equal('COMMITTED')" + ] + }, + { + "id": 6, + "description": "Callback content-type to be transfers", + "exec": [ + "expect(callback.headers['content-type']).to.equal('application/vnd.interoperability.transfers+json;version={$inputs.expectedTransfersVersion}')" + ] + }, + { + "id": 9, + "description": "Request FSP source the same as quote callback FSP destination", + "exec": [ + "expect('{$request.headers['FSPIOP-Source']}').to.equal('{$prev.4.callback.headers.fspiop-destination}')" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "requestVariables.expiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ] + } + } + }, + { + "id": 9, + "description": "Get Accounts for FXP AFTER Transfer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterTransfer= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Transfer=${environment.fxpSourceCurrencyPositionBalanceAfterTransfer}`);", + "", + "console.log(`FXP Target Currency Position Balance after Transfer=${environment.fxpTargetCurrencyPositionBalanceAfterTransfer}`);" + ] + } + } + } + ] + }, + { + "id": 2, + "name": "Create Settlement on the current open window", + "meta": { + "info": "Get current open window and close it" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Get Existing Open Window" + }, + "description": "Get Existing Open Window", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlementWindows", + "path": "/settlementWindows", + "method": "get", + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "queryParams": { + "state": "OPEN" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "State should be OPEN", + "exec": [ + "expect(environment.openWindowstate).to.equal(\"OPEN\")" + ] + } + ] + }, + "scriptingEngine": "javascript", + "scripts": { + "postRequest": { + "exec": [ + "var jsonData = response.body;", + "//console.log(jsonData.state);", + "", + "environment.openWindowID=jsonData[0].settlementWindowId;", + "environment.openWindowstate=jsonData[0].state;", + "", + "console.log(environment.openWindowID);" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Close existent window" + }, + "description": "Close existent window", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlementWindows/{id}", + "path": "/settlementWindows/{$environment.openWindowID}", + "method": "post", + "params": { + "id": "{$environment.openWindowID}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "body": { + "state": "CLOSED", + "reason": "string" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 200 or 400", + "exec": [ + "if(response.status === 400){", + " expect(response.status).to.equal(400)", + "}", + "else{", + " expect(response.status).to.equal(200)", + "}", + "", + "" + ] + }, + { + "id": 2, + "description": "New window State should be OPEN", + "exec": [ + "", + " if (response.status === 400) {", + " ", + "expect(response.body.errorInformation.errorCode).to.eql('3100');", + "expect(response.body.errorInformation.errorDescription).to.eql('Generic validation error - Window ' + environment.openWindowID + ' is empty');", + "}else{", + " ", + " ", + " expect(environment.openWindowstate).to.equal(\"OPEN\");", + "}", + "", + "", + "" + ] + } + ] + }, + "scriptingEngine": "javascript", + "scripts": { + "postRequest": { + "exec": [ + "var jsonData = response.body;", + "var rcode = Number(response.status);", + "//console.log(rcode);", + "", + "//if (rcode == 200){", + "environment.closedWindowID= Number(environment.openWindowID);", + "environment.openWindowstate=jsonData.state;", + "", + "console.log(environment.openWindowstate);", + "console.log(environment.closedWindowID);", + "//}" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "Create Settlement for Closed Window" + }, + "description": "Create Settlement for Closed Window", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements", + "path": "/settlements", + "method": "post", + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement State should be PENDING_SETTLEMENT", + "exec": [ + "expect(environment.winstate).to.equal(\"PENDING_SETTLEMENT\")" + ] + }, + { + "id": 3, + "description": "Number of associated windows should be 1", + "exec": [ + "expect(response.body.settlementWindows.length).to.equal(1)" + ] + }, + { + "id": 4, + "description": "Associated Settlement Window ID is the correct one", + "exec": [ + "expect(response.body.settlementWindows[0].id).to.equal(environment.closedWindowID)" + ] + }, + { + "id": 5, + "description": "Associated Settlement Window state should be PENDING_SETTLEMENT", + "exec": [ + "expect(response.body.settlementWindows[0].state).to.equal(\"PENDING_SETTLEMENT\")" + ] + } + ] + }, + "scriptingEngine": "javascript", + "body": { + "settlementModel": "DEFERREDNET{$inputs.currency}", + "reason": "TESTING", + "settlementWindows": [ + { + "id": "{$environment.closedWindowID}" + } + ] + }, + "delay": "3000", + "scripts": { + "postRequest": { + "exec": [ + "var jsonData = response.body;", + "environment.settlementId = jsonData.id;", + "environment.winstate = jsonData.state;", + "", + "" + ] + }, + "preRequest": { + "exec": [ + "//environment.closedWindowID = 6;", + "environment.closedWindowID = Number(environment.closedWindowID);", + "", + "/*requestVariables.closedWindowID = Number(environment.closedWindowID);", + "*/" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + } + }, + { + "id": 11, + "name": "Prepare-settlement", + "meta": { + "info": "Prepare-settlement" + }, + "requests": [ + { + "id": 4, + "meta": { + "info": "Prepare Settlement" + }, + "description": "Prepare Settlement", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements/{id}", + "path": "/settlements/{$environment.settlementId}", + "method": "get", + "params": { + "id": "{$environment.settlementId}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response code status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scriptingEngine": "javascript", + "delay": "2500", + "scripts": { + "postRequest": { + "exec": [ + "" + ] + }, + "preRequest": { + "exec": [ + "" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + } + }, + { + "id": 12, + "name": "reserve-settlement", + "meta": { + "info": "reserve-settlement" + }, + "requests": [ + { + "id": 4, + "meta": { + "info": "reserve Settlement" + }, + "description": "reserve Settlement", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements/{id}", + "path": "/settlements/{$environment.settlementId}", + "method": "get", + "params": { + "id": "{$environment.settlementId}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response code status is 200", + "exec": [ + "//if(environment.WINDOWISEMPTY === false){", + "expect(response.status).to.equal(200)", + "//}" + ] + } + ] + }, + "scriptingEngine": "javascript", + "delay": "2500", + "scripts": { + "postRequest": { + "exec": [ + "" + ] + }, + "preRequest": { + "exec": [ + "" + ] + } + } + }, + { + "id": 5, + "meta": { + "info": "check state for participants after prepare" + }, + "description": "check state for participants after prepare", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements/{id}", + "path": "/settlements/{$environment.settlementId}", + "method": "get", + "params": { + "id": "{$environment.settlementId}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "scriptingEngine": "javascript", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response code status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Check status PS_TRANSFERS_RESERVED", + "exec": [ + "expect(response.body.state).to.eql(\"PS_TRANSFERS_RESERVED\");" + ] + }, + { + "id": 3, + "description": "Check status for window is PENDING SETTLEMENT", + "exec": [ + " expect(response.body.settlementWindows[0].state).to.eql(\"PENDING_SETTLEMENT\");" + ] + }, + { + "id": 4, + "description": "Account state is PS_TRANSFERS_RESERVEDfor all accounts", + "exec": [ + "expect(environment.controlvar).to.equal(true)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "//Boolean isok = false;\r", + "var res = response.body;\r", + "var isok = true;\r", + "\r", + "try{\r", + "res.participants.map(function (participant) {\r", + " participant.accounts.filter(account => account.netSettlementAmount.currency === environment.currency).every(curAccount => {\r", + " if(isok === true){ \r", + " if(curAccount.state === \"PS_TRANSFERS_RESERVED\"){\r", + " isok= true;\r", + " \r", + " \r", + " \r", + " }else{\r", + " isok= false;\r", + " // console.log(isok);\r", + " \r", + " }\r", + " } \r", + " })\r", + "})\r", + "\r", + "}catch(exception){\r", + " console.log(exception);\r", + "}\r", + "\r", + "environment.controlvar = isok;" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + } + }, + { + "id": 13, + "name": "commit-settlement", + "meta": { + "info": "commit-settlement" + }, + "requests": [ + { + "id": 4, + "meta": { + "info": "commit Settlement" + }, + "description": "commit Settlement", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements/{id}", + "path": "/settlements/{$environment.settlementId}", + "method": "get", + "params": { + "id": "{$environment.settlementId}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response code status is 200", + "exec": [ + "//if(environment.WINDOWISEMPTY === false){", + "expect(response.status).to.equal(200)", + "//}" + ] + } + ] + }, + "scriptingEngine": "javascript", + "delay": "2500", + "scripts": { + "postRequest": { + "exec": [ + "" + ] + }, + "preRequest": { + "exec": [ + "" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + } + }, + { + "id": 14, + "name": "settle-settlement", + "meta": { + "info": "settle-settlement" + }, + "requests": [ + { + "id": 4, + "meta": { + "info": "settle Settlement" + }, + "description": "settle Settlement", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "settlements" + }, + "operationPath": "/settlements/{id}", + "path": "/settlements/{$environment.settlementId}", + "method": "get", + "params": { + "id": "{$environment.settlementId}" + }, + "url": "{$inputs.HOST_CENTRAL_SETTLEMENT}", + "headers": { + "FSPIOP-Source": "{$inputs.fromFspId}", + "Authorization": "{$inputs.TTK_BEARER_TOKEN}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Response code status is 200", + "exec": [ + "//if(environment.WINDOWISEMPTY === false){", + "expect(response.status).to.equal(200)", + "//}" + ] + } + ] + }, + "scriptingEngine": "javascript", + "delay": "2500", + "scripts": { + "postRequest": { + "exec": [ + "" + ] + }, + "preRequest": { + "exec": [ + "" + ] + } + } + }, + { + "id": 15, + "description": "Get Accounts for FXP AFTER Settlement", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin", + "specFile": "spec_files/api_definitions/central_admin_1.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/central_admin_1.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/central_admin_1.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/central_admin_1.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/central_admin_1.0/trigger_templates" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.FX_TESTFXP1_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.FX_TESTFXP1_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "scriptingEngine": "javascript", + "tests": { + "assertions": [] + }, + "disabled": false, + "scripts": { + "postRequest": { + "exec": [ + "var res = response.body;", + "", + "res.filter(account => account.currency === environment.FX_SOURCE_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpSourceCurrencyPositionBalanceAfterSettlement= curAccount.value", + " }", + "})", + "", + "res.filter(account => account.currency === environment.FX_TARGET_CURRENCY).forEach(curAccount => {", + " if(curAccount.ledgerAccountType === \"POSITION\") {", + " environment.fxpTargetCurrencyPositionBalanceAfterSettlement= curAccount.value", + " }", + "})", + "", + "console.log(`FXP Source Currency Position Balance after Settlement=${environment.fxpSourceCurrencyPositionBalanceAfterSettlement}`);", + "", + "console.log(`FXP Target Currency Position Balance after Settlement=${environment.fxpTargetCurrencyPositionBalanceAfterSettlement}`);" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/golden_path/fx/feature_tests/settlement/settlement_tests.json", + "labels": [ + "fx" + ] + } + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning/CGS_Specific/add-users-to-new-sims-and-als-registration.json b/collections/hub/provisioning/for_golden_path/CGS_Specific/add-users-to-new-sims-and-als-registration.json similarity index 100% rename from collections/hub/provisioning/CGS_Specific/add-users-to-new-sims-and-als-registration.json rename to collections/hub/provisioning/for_golden_path/CGS_Specific/add-users-to-new-sims-and-als-registration.json diff --git a/collections/hub/provisioning/CGS_Specific/adjust-participants-limits.json b/collections/hub/provisioning/for_golden_path/CGS_Specific/adjust-participants-limits.json similarity index 100% rename from collections/hub/provisioning/CGS_Specific/adjust-participants-limits.json rename to collections/hub/provisioning/for_golden_path/CGS_Specific/adjust-participants-limits.json diff --git a/collections/hub/provisioning/CGS_Specific/master.json b/collections/hub/provisioning/for_golden_path/CGS_Specific/master.json similarity index 100% rename from collections/hub/provisioning/CGS_Specific/master.json rename to collections/hub/provisioning/for_golden_path/CGS_Specific/master.json diff --git a/collections/hub/provisioning/CGS_Specific/oracle-onboarding.json b/collections/hub/provisioning/for_golden_path/CGS_Specific/oracle-onboarding.json similarity index 100% rename from collections/hub/provisioning/CGS_Specific/oracle-onboarding.json rename to collections/hub/provisioning/for_golden_path/CGS_Specific/oracle-onboarding.json diff --git a/collections/hub/provisioning/MojaloopHub_Setup/hub.json b/collections/hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json similarity index 87% rename from collections/hub/provisioning/MojaloopHub_Setup/hub.json rename to collections/hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json index 36e2e2b8..3134c2c7 100644 --- a/collections/hub/provisioning/MojaloopHub_Setup/hub.json +++ b/collections/hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json @@ -1,5 +1,6 @@ { - "name": "multi", + "options": {}, + "name": "hub_provisioning_for_golden_path_MojaloopHub_Setup", "test_cases": [ { "id": 1, @@ -7,6 +8,9 @@ "meta": { "info": "Hub Account" }, + "fileInfo": { + "path": "hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json" + }, "requests": [ { "id": 1, @@ -373,16 +377,103 @@ } ] } + }, + { + "id": 10, + "description": "Add Hub Account-HUB_MULTILATERAL_SETTLEMENT Third Currency", + "meta": { + "info": "Add Hub Account-HUB_MULTILATERAL_SETTLEMENT Second Currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_MULTILATERAL_SETTLEMENT", + "currency": "{$inputs.currency3}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 11, + "description": "Add Hub Account-HUB_RECONCILIATION Third Currency", + "meta": { + "info": "Add Hub Account-HUB_RECONCILIATION Second Currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_RECONCILIATION", + "currency": "{$inputs.currency3}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } } - ], - "fileInfo": { - "path": "hub/provisioning/MojaloopHub_Setup/hub.json" - } + ] }, { "id": 2, "type": "Settlement Models", "name": "Settlement Models", + "fileInfo": { + "path": "hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json" + }, + "meta": { + "info": "Settlement Models" + }, "requests": [ { "id": 2, @@ -557,15 +648,18 @@ "settlementAccountType": "INTERCHANGE_FEE_SETTLEMENT" } } - ], - "fileInfo": { - "path": "hub/provisioning/MojaloopHub_Setup/hub.json" - } + ] }, { "id": 3, "type": "Oracle Onboarding", "name": "Oracle Onboarding", + "fileInfo": { + "path": "hub/provisioning/for_golden_path/MojaloopHub_Setup/hub.json" + }, + "meta": { + "info": "Oracle Onboarding" + }, "requests": [ { "id": 1, @@ -702,10 +796,7 @@ ] } } - ], - "fileInfo": { - "path": "hub/provisioning/MojaloopHub_Setup/hub.json" - } + ] } ] } \ No newline at end of file diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/master.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/master.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/master.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/master.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/noresponsepayeefsp.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/noresponsepayeefsp.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/noresponsepayeefsp.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/noresponsepayeefsp.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/payeefsp.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/payeefsp.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/payeefsp.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/payeefsp.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/payerfsp.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/payerfsp.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/payerfsp.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/payerfsp.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp1.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp1.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/testfsp1.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp1.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp2.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp2.json similarity index 100% rename from collections/hub/provisioning/MojaloopSims_Onboarding/testfsp2.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp2.json diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp3.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp3.json similarity index 99% rename from collections/hub/provisioning/MojaloopSims_Onboarding/testfsp3.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp3.json index 7bc42f9c..22618297 100644 --- a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp3.json +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp3.json @@ -161,7 +161,7 @@ "Content-Type": "application/json" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", @@ -193,7 +193,7 @@ "scripts": { "preRequest": { "exec": [ - "//fundsInPrepareTransferId='{$function.generic.generateUUID}'", + "//fundsInPrepareTransferId='{$function.generic.generateID}'", "environment.fundsInPrepareAmount= 5000", "", "", diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp4.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp4.json similarity index 99% rename from collections/hub/provisioning/MojaloopSims_Onboarding/testfsp4.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp4.json index 044232ba..ee5e21d8 100644 --- a/collections/hub/provisioning/MojaloopSims_Onboarding/testfsp4.json +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testfsp4.json @@ -161,7 +161,7 @@ "Content-Type": "application/json" }, "body": { - "transferId": "{$function.generic.generateUUID}", + "transferId": "{$function.generic.generateID}", "externalReference": "string", "action": "recordFundsIn", "reason": "string", @@ -193,7 +193,7 @@ "scripts": { "preRequest": { "exec": [ - "//fundsInPrepareTransferId='{$function.generic.generateUUID}'", + "//fundsInPrepareTransferId='{$function.generic.generateID}'", "environment.fundsInPrepareAmount= 5000", "", "", diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/testingtoolkitdfsp.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testingtoolkitdfsp.json similarity index 91% rename from collections/hub/provisioning/MojaloopSims_Onboarding/testingtoolkitdfsp.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testingtoolkitdfsp.json index a4838422..458313ad 100644 --- a/collections/hub/provisioning/MojaloopSims_Onboarding/testingtoolkitdfsp.json +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/testingtoolkitdfsp.json @@ -3,9 +3,9 @@ "test_cases": [ { "id": 1, - "name": "testingtoolkitdfsp provisioning", + "name": "Primary Account", "meta": { - "info": "testingtoolkitdfsp provisioning" + "info": "Primary Account" }, "requests": [ { @@ -90,7 +90,194 @@ } ] } + } + ] + }, + { + "id": 2, + "name": "Additional Currencies", + "meta": { + "info": "Additional Currencies" + }, + "requests": [ + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "testingtoolkitdfsp", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/testingtoolkitdfsp/initialPositionAndLimits", + "method": "post", + "params": { + "name": "testingtoolkitdfsp" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "testingtoolkitdfsp", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/testingtoolkitdfsp/initialPositionAndLimits", + "method": "post", + "params": { + "name": "testingtoolkitdfsp" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning/MojaloopSims_Onboarding/testingtoolkitdfsp.json" + } + }, + { + "id": 3, + "name": "Endpoints", + "meta": { + "info": "Endpoints" + }, + "requests": [ { "id": 3, "meta": { @@ -981,37 +1168,36 @@ }, { "id": 27, + "description": "Add callback - FX TRANSFERS POST", "meta": { - "info": "Add participant with second currency" + "info": "Add callback - FX TRANSFERS POST" }, - "description": "Add participant with second currency", "apiVersion": { "minorVersion": 0, "majorVersion": 1, "type": "central_admin" }, - "operationPath": "/participants", - "path": "/participants", + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/testingtoolkitdfsp/endpoints", "method": "post", - "body": { - "name": "testingtoolkitdfsp", - "currency": "{$inputs.currency2}" + "params": { + "name": "testingtoolkitdfsp" }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", "headers": { "Content-Type": "application/json" }, - "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, "tests": { "assertions": [ { "id": 1, - "description": "status to be 201 if not exists or 400 if exists", + "description": "Status code is 201", "exec": [ - "if (response.body.errorInformation) {", - " expect(response.status).to.equal(400)", - "} else {", - " expect(response.status).to.equal(201)", - "}" + "expect(response.status).to.equal(201)" ] } ] @@ -1019,44 +1205,36 @@ }, { "id": 28, + "description": "Add callback - FX TRANSFERS PUT", "meta": { - "info": "Add initial position and limits with second currency" + "info": "Add callback - FX TRANSFERS PUT" }, - "description": "Add initial position and limits with second currency", "apiVersion": { "minorVersion": 0, "majorVersion": 1, "type": "central_admin" }, - "operationPath": "/participants/{name}/initialPositionAndLimits", - "path": "/participants/testingtoolkitdfsp/initialPositionAndLimits", + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/testingtoolkitdfsp/endpoints", "method": "post", "params": { "name": "testingtoolkitdfsp" }, - "body": { - "currency": "{$inputs.currency2}", - "limit": { - "type": "NET_DEBIT_CAP", - "value": 1000000 - }, - "initialPosition": 0 - }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", "headers": { "Content-Type": "application/json" }, - "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, "tests": { "assertions": [ { "id": 1, - "description": "status to be 201 if not exists or 500 if exists", + "description": "Status code is 201", "exec": [ - "if (response.body.errorInformation) {", - " expect(response.status).to.equal(500)", - "} else {", - " expect(response.status).to.equal(201)", - "}" + "expect(response.status).to.equal(201)" ] } ] @@ -1064,37 +1242,36 @@ }, { "id": 29, - "description": "Add participant with second currency CGS", + "description": "Add callback - FX TRANSFERS ERROR", "meta": { - "info": "Add participant with second currency" + "info": "Add callback - FX TRANSFERS ERROR" }, "apiVersion": { "minorVersion": 0, "majorVersion": 1, "type": "central_admin" }, - "operationPath": "/participants", - "path": "/participants", + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/testingtoolkitdfsp/endpoints", "method": "post", - "body": { - "name": "testingtoolkitdfsp", - "currency": "{$inputs.cgscurrency}" + "params": { + "name": "testingtoolkitdfsp" }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", "headers": { "Content-Type": "application/json" }, - "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, "tests": { "assertions": [ { "id": 1, - "description": "status to be 201 if not exists or 400 if exists", + "description": "Status code is 201", "exec": [ - "if (response.body.errorInformation) {", - " expect(response.status).to.equal(400)", - "} else {", - " expect(response.status).to.equal(201)", - "}" + "expect(response.status).to.equal(201)" ] } ] @@ -1102,56 +1279,45 @@ }, { "id": 30, - "description": "Add initial position and limits with second currency CGS", + "description": "Add callback - FXQUOTES PUT", "meta": { - "info": "Add initial position and limits with second currency" + "info": "Add callback - FXQUOTES PUT" }, "apiVersion": { "minorVersion": 0, "majorVersion": 1, "type": "central_admin" }, - "operationPath": "/participants/{name}/initialPositionAndLimits", - "path": "/participants/testingtoolkitdfsp/initialPositionAndLimits", + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/testingtoolkitdfsp/endpoints", "method": "post", "params": { "name": "testingtoolkitdfsp" }, - "body": { - "currency": "{$inputs.cgscurrency}", - "limit": { - "type": "NET_DEBIT_CAP", - "value": 1000000 - }, - "initialPosition": 0 - }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", "headers": { "Content-Type": "application/json" }, - "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, "tests": { "assertions": [ { "id": 1, - "description": "status to be 201 if not exists or 500 if exists", + "description": "Status code is 201", "exec": [ - "if (response.body.errorInformation) {", - " expect(response.status).to.equal(500)", - "} else {", - " expect(response.status).to.equal(201)", - "}" + "expect(response.status).to.equal(201)" ] } ] } } - ], - "fileInfo": { - "path": "hub/provisioning/MojaloopSims_Onboarding/testingtoolkitdfsp.json" - } + ] }, { - "id": 2, + "id": 4, "name": "testingtoolkitdfsp fundsin", "meta": { "info": "testingtoolkitdfsp fundsin" diff --git a/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxp1.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxp1.json new file mode 100644 index 00000000..15ec0a28 --- /dev/null +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxp1.json @@ -0,0 +1,1460 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Primary Account", + "meta": { + "info": "Primary Account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "ttkfxp1", + "currency": "{$inputs.FX_SOURCE_CURRENCY}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/ttkfxp1/initialPositionAndLimits", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "body": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "Additional Currencies", + "meta": { + "info": "Additional Currencies" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "ttkfxp1", + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/ttkfxp1/initialPositionAndLimits", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "body": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "Endpoints", + "meta": { + "info": "Endpoints" + }, + "requests": [ + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add ttkfxp1 callback - PARTICIPANT PUT Batch" + }, + "description": "Add ttkfxp1 callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add ttkfxp1 callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add ttkfxp1 callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 28, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxp1/endpoints", + "method": "post", + "params": { + "name": "ttkfxp1" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ] + }, + { + "id": 4, + "name": "Fundsin", + "meta": { + "info": "Fundsin" + }, + "requests": [ + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/ttkfxp1/accounts", + "method": "get", + "params": { + "name": "ttkfxp1" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('FX_TARGET_CURRENCY')) {", + " pm.environment.set(\"ttkfxp1Currency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"ttkfxp1Currency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/ttkfxp1/accounts/{$environment.ttkfxp1Currency2SettlementAccountId}", + "method": "post", + "params": { + "name": "ttkfxp1", + "id": "{$environment.ttkfxp1Currency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.ttkfxp1fundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.ttkfxp1fundsInPrepareAmountCurrency2}", + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('ttkfxp1fundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('ttkfxp1fundsInPrepareAmountCurrency2', 5000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/ttkfxp1/accounts", + "method": "get", + "params": { + "name": "ttkfxp1" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.ttkfxp1Currency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.ttkfxp1Currency2SettlementAccountBalanceBeforeFundsIn - +environment.ttkfxp1fundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "{$inputs.DELAY_FUNDS_IN}", + "scripts": { + "postRequest": { + "exec": [ + "const expectedBalance = Number.parseFloat(pm.environment.get(\"ttkfxp1Currency2SettlementAccountBalanceBeforeFundsIn\")) - Number.parseFloat(pm.environment.get(\"ttkfxp1fundsInPrepareAmountCurrency2\"))", + "console.log(`balanceBeforeFundsIn: `, Number.parseFloat(pm.environment.get(\"ttkfxp1Currency2SettlementAccountBalanceBeforeFundsIn\")))", + "console.log(`fundsInPrepareAmount: `, Number.parseFloat(pm.environment.get(\"ttkfxp1fundsInPrepareAmountCurrency2\")))", + "console.log(`expectedBalance: `, expectedBalance)", + "// lets get retry config", + "const maxRetryCount = Number.parseFloat(environment.RETRY_MAX_ATTEMPTS) || 20", + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "", + "async function main() {", + " let res = pm.response", + " let jsonData = res.body", + "", + " for (let retryCount = 0 ; retryCount < maxRetryCount; retryCount++) {", + " console.log(`retry-count=${retryCount+1}, max-count=${maxRetryCount}, max-wait=${maxRetryWait}`)", + " ", + " let isOk = false;", + " ", + " for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('FX_TARGET_CURRENCY') && Number.parseFloat(jsonData[i].value) == expectedBalance) {", + " pm.environment.set(\"ttkfxp1Currency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " isOk = true", + " }", + " }", + " if (isOk) {", + " console.log(`Everything is OK, let's continue`)", + " break; // lets break out of retry loop loop", + " } else {", + " console.log(`Everything is NOT OK, let's wait for ${maxRetryWait}ms, and try again...`)", + " await wait(maxRetryWait)", + " const pmResponse = await makeRequest()", + " jsonData = JSON.parse(pmResponse.body)", + " }", + " }", + "}", + "", + "async function makeRequest() {", + " const requestParams = {", + " method: 'GET', ", + " url: `${environment.HOST_CENTRAL_LEDGER}/participants/ttkfxp1/accounts`,", + " header: {", + " 'Content-Type': 'application/json',", + " },", + " };", + " ", + " return new Promise((resolve, reject) => {", + " pm.sendRequest(requestParams, (error, response) => {", + " if (error) reject(error)", + " resolve(response)", + " })", + " })", + "}", + "", + "function wait(ms) {", + " return new Promise((resolve) => {", + " setTimeout(resolve, ms)", + " });", + "}", + "", + "main()" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayee.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayee.json new file mode 100644 index 00000000..ed233a49 --- /dev/null +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayee.json @@ -0,0 +1,1142 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Primary Account", + "meta": { + "info": "Primary Account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "ttkfxpayee", + "currency": "{$inputs.FX_TARGET_CURRENCY}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/ttkfxpayee/initialPositionAndLimits", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "body": { + "currency": "{$inputs.FX_TARGET_CURRENCY}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "Endpoints", + "meta": { + "info": "Endpoints" + }, + "requests": [ + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add ttkfxpayee callback - PARTICIPANT PUT Batch" + }, + "description": "Add ttkfxpayee callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add ttkfxpayee callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add ttkfxpayee callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 28, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayee/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayee" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayer.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayer.json new file mode 100644 index 00000000..4612b3b9 --- /dev/null +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkfxpayer.json @@ -0,0 +1,1368 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Primary Account", + "meta": { + "info": "Primary Account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "ttkfxpayer", + "currency": "{$inputs.FX_SOURCE_CURRENCY}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/ttkfxpayer/initialPositionAndLimits", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "body": { + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "Endpoints", + "meta": { + "info": "Endpoints" + }, + "requests": [ + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add ttkfxpayer callback - PARTICIPANT PUT Batch" + }, + "description": "Add ttkfxpayer callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add ttkfxpayer callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add ttkfxpayer callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 28, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/ttkfxpayer/endpoints", + "method": "post", + "params": { + "name": "ttkfxpayer" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ] + }, + { + "id": 4, + "name": "Fundsin", + "meta": { + "info": "Fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Get Status Request before deposit" + }, + "description": "Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/ttkfxpayer/accounts", + "method": "get", + "params": { + "name": "ttkfxpayer" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('FX_SOURCE_CURRENCY')) {", + " pm.environment.set(\"ttkfxpayerSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"ttkfxpayerSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "description": "Deposit Funds in Settlement Account", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/ttkfxpayer/accounts/{$environment.ttkfxpayerSettlementAccountId}", + "method": "post", + "params": { + "name": "ttkfxpayer", + "id": "{$environment.ttkfxpayerSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.ttkfxpayerfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.ttkfxpayerfundsInPrepareAmount}", + "currency": "{$inputs.FX_SOURCE_CURRENCY}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('ttkfxpayerfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('ttkfxpayerfundsInPrepareAmount', 5000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "Get Status Request after deposit" + }, + "description": "Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/ttkfxpayer/accounts", + "method": "get", + "params": { + "name": "ttkfxpayer" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.ttkfxpayerSettlementAccountBalanceAfterFundsIn).to.equal(+environment.ttkfxpayerSettlementAccountBalanceBeforeFundsIn - +environment.ttkfxpayerfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "{$inputs.DELAY_FUNDS_IN}", + "scripts": { + "postRequest": { + "exec": [ + "const expectedBalance = Number.parseFloat(pm.environment.get(\"ttkfxpayerSettlementAccountBalanceBeforeFundsIn\")) - Number.parseFloat(pm.environment.get(\"ttkfxpayerfundsInPrepareAmount\"))", + "console.log(`balanceBeforeFundsIn: `, Number.parseFloat(pm.environment.get(\"ttkfxpayerSettlementAccountBalanceBeforeFundsIn\")))", + "console.log(`fundsInPrepareAmount: `, Number.parseFloat(pm.environment.get(\"ttkfxpayerfundsInPrepareAmount\")))", + "console.log(`expectedBalance: `, expectedBalance)", + "// lets get retry config", + "const maxRetryCount = Number.parseFloat(environment.RETRY_MAX_ATTEMPTS) || 20", + "const maxRetryWait = Number.parseFloat(environment.RETRY_MAX_WAIT_IN_MS) || 250", + "", + "async function main() {", + " let res = pm.response", + " let jsonData = res.body", + "", + " for (let retryCount = 0 ; retryCount < maxRetryCount; retryCount++) {", + " console.log(`retry-count=${retryCount+1}, max-count=${maxRetryCount}, max-wait=${maxRetryWait}`)", + " ", + " let isOk = false;", + " ", + " for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('FX_SOURCE_CURRENCY') && jsonData[i].value == expectedBalance) {", + " pm.environment.set(\"ttkfxpayerSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " isOk = true", + " }", + " }", + " if (isOk) {", + " console.log(`Everything is OK, let's continue`)", + " break; // lets break out of retry loop loop", + " } else {", + " console.log(`Everything is NOT OK, let's wait for ${maxRetryWait}ms, and try again...`)", + " await wait(maxRetryWait)", + " const pmResponse = await makeRequest()", + " jsonData = JSON.parse(pmResponse.body)", + " }", + " }", + "}", + "", + "async function makeRequest() {", + " const requestParams = {", + " method: 'GET', ", + " url: `${environment.HOST_CENTRAL_LEDGER}/participants/ttkfxpayer/accounts`,", + " header: {", + " 'Content-Type': 'application/json',", + " },", + " };", + " ", + " return new Promise((resolve, reject) => {", + " pm.sendRequest(requestParams, (error, response) => {", + " if (error) reject(error)", + " resolve(response)", + " })", + " })", + "}", + "", + "function wait(ms) {", + " return new Promise((resolve) => {", + " setTimeout(resolve, ms)", + " });", + "}", + "", + "main()" + ] + } + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning/MojaloopSims_Onboarding/ttkpayeefsp.json b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkpayeefsp.json similarity index 92% rename from collections/hub/provisioning/MojaloopSims_Onboarding/ttkpayeefsp.json rename to collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkpayeefsp.json index 689b051d..f692cf24 100644 --- a/collections/hub/provisioning/MojaloopSims_Onboarding/ttkpayeefsp.json +++ b/collections/hub/provisioning/for_golden_path/MojaloopSims_Onboarding/ttkpayeefsp.json @@ -1144,6 +1144,92 @@ } ] } + }, + { + "id": 31, + "meta": { + "info": "Add payeeIdentifier in payeeIdType Oracle" + }, + "description": "Add payeeIdentifier in payeeIdType Oracle", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.payeeIdType}/{$inputs.ttkpayeefspIdentifier1}", + "method": "post", + "params": { + "Type": "{$inputs.payeeIdType}", + "ID": "{$inputs.ttkpayeefspIdentifier1}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentTypeParticipants}", + "Accept": "{$inputs.acceptParticipants}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.ttkpayeefspName}" + }, + "body": { + "fspId": "{$inputs.ttkpayeefspName}", + "currency": "{$inputs.currency}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "ignoreCallbacks": true + }, + { + "id": 32, + "meta": { + "info": "Add payeeIdentifier in payeeIdType Oracle" + }, + "description": "Add payeeIdentifier in payeeIdType Oracle", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.payeeIdType}/{$inputs.ttkpayeefspIdentifier2}", + "method": "post", + "params": { + "Type": "{$inputs.payeeIdType}", + "ID": "{$inputs.ttkpayeefspIdentifier2}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "headers": { + "Content-Type": "{$inputs.contentTypeParticipants}", + "Accept": "{$inputs.acceptParticipants}", + "Date": "{$function.generic.curDate}", + "FSPIOP-Source": "{$inputs.ttkpayeefspName}" + }, + "body": { + "fspId": "{$inputs.ttkpayeefspName}", + "currency": "{$inputs.currency}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "ignoreCallbacks": true } ], "fileInfo": { diff --git a/collections/hub/provisioning/master.json b/collections/hub/provisioning/for_golden_path/master.json similarity index 100% rename from collections/hub/provisioning/master.json rename to collections/hub/provisioning/for_golden_path/master.json diff --git a/collections/hub/provisioning/for_inter_scheme/new_proxy.json b/collections/hub/provisioning/for_inter_scheme/new_proxy.json new file mode 100644 index 00000000..fd9eeb8c --- /dev/null +++ b/collections/hub/provisioning/for_inter_scheme/new_proxy.json @@ -0,0 +1,1469 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "Setup Hub accounts", + "meta": { + "info": "Hub account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT Second Currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT Second Currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_MULTILATERAL_SETTLEMENT", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the DFSP currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the DFSP currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_RECONCILIATION", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "Setup DFSP accounts and limits", + "meta": { + "info": "DFSP account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP" + }, + "description": "Add DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PROXY1_NAME}", + "currency": "{$inputs.currency}", + "isProxy": "true" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits - DFSP" + }, + "description": "Add initial position and limits - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PROXY1_NAME}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 10000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "DFSP Get Status Request before deposit" + }, + "description": "DFSP Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY1_NAME}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"dfspSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "meta": { + "info": "Deposit Funds in Settlement Account - DFSP" + }, + "description": "Deposit Funds in Settlement Account - DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PROXY1_NAME}/accounts/{$environment.dfspSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}", + "id": "{$environment.dfspSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.dfspfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.dfspfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('dfspfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('dfspfundsInPrepareAmount', 5000);" + ] + } + } + }, + { + "id": 5, + "meta": { + "info": "DFSP Get Status Request after deposit" + }, + "description": "DFSP Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PROXY1_NAME}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "DFSP Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.dfspSettlementAccountBalanceAfterFundsIn).to.equal(+environment.dfspSettlementAccountBalanceBeforeFundsIn - +environment.dfspfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "1000", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"dfspSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ], + "fileInfo": { + "path": "hub/provisioning/new_participants/new_dfsp.json" + } + }, + { + "id": 3, + "name": "Setup Callback Endpoints", + "meta": { + "info": "DFSP callbacks" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add DFSP callback - AUTHORIZATIONS" + }, + "description": "Add DFSP callback - AUTHORIZATIONS", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_AUTHORIZATIONS", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT" + }, + "description": "Add DFSP callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add DFSP callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add DFSP callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add DFSP callback - PARTIES GET" + }, + "description": "Add DFSP callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add DFSP callback - PARTIES PUT" + }, + "description": "Add DFSP callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add DFSP callback - PARTIES PUT Error" + }, + "description": "Add DFSP callback - PARTIES PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add DFSP callback - QUOTES" + }, + "description": "Add DFSP callback - QUOTES", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add DFSP callback - TXN REQUEST" + }, + "description": "Add DFSP callback - TXN REQUEST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add DFSP callback - TRANSFERS POST" + }, + "description": "Add DFSP callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add DFSP callback - TRANSFERS PUT" + }, + "description": "Add DFSP callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add DFSP callback - TRANSFERS ERROR" + }, + "description": "Add DFSP callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER POST" + }, + "description": "Add DFSP callback - BULK-TRANSFER POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER PUT" + }, + "description": "Add DFSP callback - BULK-TRANSFER PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add DFSP callback - BULK-TRANSFER ERROR" + }, + "description": "Add DFSP callback - BULK-TRANSFER ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Add DFSP callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add DFSP callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID GET" + }, + "description": "Add DFSP callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Add DFSP callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add DFSP callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning/new_participants/new_dfsp.json" + } + }, + { + "id": 4, + "name": "Setup Notification Emails", + "meta": { + "info": "DFSP notification_emails" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY1_NAME}" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PROXY1_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PROXY1_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.PROXY1_NAME}" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ], + "fileInfo": { + "path": "hub/provisioning/new_participants/new_dfsp.json" + } + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning_sdkbulk/master.json b/collections/hub/provisioning/for_sdk_bulk/master.json similarity index 100% rename from collections/hub/provisioning_sdkbulk/master.json rename to collections/hub/provisioning/for_sdk_bulk/master.json diff --git a/collections/hub/provisioning_sdkbulk/ttksim1.json b/collections/hub/provisioning/for_sdk_bulk/ttksim1.json similarity index 99% rename from collections/hub/provisioning_sdkbulk/ttksim1.json rename to collections/hub/provisioning/for_sdk_bulk/ttksim1.json index f72d6e07..9d031eaf 100644 --- a/collections/hub/provisioning_sdkbulk/ttksim1.json +++ b/collections/hub/provisioning/for_sdk_bulk/ttksim1.json @@ -595,7 +595,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim1.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim1.json" } }, { @@ -1466,7 +1466,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim1.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim1.json" } }, { @@ -1592,7 +1592,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim1.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim1.json" } }, { @@ -1647,7 +1647,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim1.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim1.json" } } ] diff --git a/collections/hub/provisioning_sdkbulk/ttksim2.json b/collections/hub/provisioning/for_sdk_bulk/ttksim2.json similarity index 99% rename from collections/hub/provisioning_sdkbulk/ttksim2.json rename to collections/hub/provisioning/for_sdk_bulk/ttksim2.json index 579451c6..57a4d73a 100644 --- a/collections/hub/provisioning_sdkbulk/ttksim2.json +++ b/collections/hub/provisioning/for_sdk_bulk/ttksim2.json @@ -595,7 +595,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim2.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim2.json" } }, { diff --git a/collections/hub/provisioning_sdkbulk/ttksim3.json b/collections/hub/provisioning/for_sdk_bulk/ttksim3.json similarity index 99% rename from collections/hub/provisioning_sdkbulk/ttksim3.json rename to collections/hub/provisioning/for_sdk_bulk/ttksim3.json index 051df86c..fc4c7915 100644 --- a/collections/hub/provisioning_sdkbulk/ttksim3.json +++ b/collections/hub/provisioning/for_sdk_bulk/ttksim3.json @@ -595,7 +595,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_sdkbulk/ttksim3.json" + "path": "hub/provisioning/for_sdk_bulk/ttksim3.json" } }, { diff --git a/collections/hub/provisioning_thirdparty/centralauth.json b/collections/hub/provisioning/for_thirdparty/centralauth.json similarity index 100% rename from collections/hub/provisioning_thirdparty/centralauth.json rename to collections/hub/provisioning/for_thirdparty/centralauth.json diff --git a/collections/hub/provisioning_thirdparty/dfspa.json b/collections/hub/provisioning/for_thirdparty/dfspa.json similarity index 100% rename from collections/hub/provisioning_thirdparty/dfspa.json rename to collections/hub/provisioning/for_thirdparty/dfspa.json diff --git a/collections/hub/provisioning_thirdparty/dfspb.json b/collections/hub/provisioning/for_thirdparty/dfspb.json similarity index 100% rename from collections/hub/provisioning_thirdparty/dfspb.json rename to collections/hub/provisioning/for_thirdparty/dfspb.json diff --git a/collections/hub/provisioning_thirdparty/dfspb_parties.json b/collections/hub/provisioning/for_thirdparty/dfspb_parties.json similarity index 100% rename from collections/hub/provisioning_thirdparty/dfspb_parties.json rename to collections/hub/provisioning/for_thirdparty/dfspb_parties.json diff --git a/collections/hub/provisioning_thirdparty/hub.json b/collections/hub/provisioning/for_thirdparty/hub.json similarity index 100% rename from collections/hub/provisioning_thirdparty/hub.json rename to collections/hub/provisioning/for_thirdparty/hub.json diff --git a/collections/hub/provisioning_thirdparty/master.json b/collections/hub/provisioning/for_thirdparty/master.json similarity index 100% rename from collections/hub/provisioning_thirdparty/master.json rename to collections/hub/provisioning/for_thirdparty/master.json diff --git a/collections/hub/provisioning_thirdparty/pisp.json b/collections/hub/provisioning/for_thirdparty/pisp.json similarity index 100% rename from collections/hub/provisioning_thirdparty/pisp.json rename to collections/hub/provisioning/for_thirdparty/pisp.json diff --git a/collections/hub/provisioning_dfsp/newdfsp.json b/collections/hub/provisioning/new_participants/new_dfsp.json similarity index 92% rename from collections/hub/provisioning_dfsp/newdfsp.json rename to collections/hub/provisioning/new_participants/new_dfsp.json index 20296b8a..aa24c5bf 100644 --- a/collections/hub/provisioning_dfsp/newdfsp.json +++ b/collections/hub/provisioning/new_participants/new_dfsp.json @@ -3,7 +3,100 @@ "test_cases": [ { "id": 1, - "name": "Setup Accounts and Limits", + "name": "Setup Hub accounts", + "meta": { + "info": "Hub account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT Second Currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT Second Currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_MULTILATERAL_SETTLEMENT", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the DFSP currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the DFSP currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_RECONCILIATION", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "Setup DFSP accounts and limits", "meta": { "info": "DFSP account" }, @@ -24,7 +117,8 @@ "method": "post", "body": { "name": "{$inputs.DFSP_NAME}", - "currency": "{$inputs.currency}" + "currency": "{$inputs.currency}", + "isProxy": "{$inputs.isProxy}" }, "headers": { "Content-Type": "application/json", @@ -260,11 +354,11 @@ } ], "fileInfo": { - "path": "hub/provisioning_dfsp/newdfsp.json" + "path": "hub/provisioning/new_participants/new_dfsp.json" } }, { - "id": 2, + "id": 3, "name": "Setup Callback Endpoints", "meta": { "info": "DFSP callbacks" @@ -1242,11 +1336,11 @@ } ], "fileInfo": { - "path": "hub/provisioning_dfsp/newdfsp.json" + "path": "hub/provisioning/new_participants/new_dfsp.json" } }, { - "id": 3, + "id": 4, "name": "Setup Notification Emails", "meta": { "info": "DFSP notification_emails" @@ -1368,7 +1462,7 @@ } ], "fileInfo": { - "path": "hub/provisioning_dfsp/newdfsp.json" + "path": "hub/provisioning/new_participants/new_dfsp.json" } } ] diff --git a/collections/hub/provisioning/new_participants/new_fxp.json b/collections/hub/provisioning/new_participants/new_fxp.json new file mode 100644 index 00000000..18d0c475 --- /dev/null +++ b/collections/hub/provisioning/new_participants/new_fxp.json @@ -0,0 +1,1467 @@ +{ + "options": {}, + "name": "switch_onboarding_participant_fxp", + "test_cases": [ + { + "id": 1, + "name": "Setup Hub accounts", + "meta": { + "info": "Hub account" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT FXP Currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_MULTILATERAL_SETTLEMENT FXP Currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_MULTILATERAL_SETTLEMENT", + "currency": "{$inputs.fxpCurrency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the FXP currency" + }, + "description": "Add {$inputs.HUB_NAME} Account-HUB_RECONCILIATION for the FXP currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.HUB_NAME}/accounts", + "method": "post", + "params": { + "name": "{$inputs.HUB_NAME}" + }, + "body": { + "type": "HUB_RECONCILIATION", + "currency": "{$inputs.fxpCurrency}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "hub_operator" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "Setup FXP Accounts", + "meta": { + "info": "FXP Accounts" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add FXP participant" + }, + "description": "Add FXP participant currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.DFSP_NAME}", + "currency": "{$inputs.fxpCurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits for FX Currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.DFSP_NAME}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "body": { + "currency": "{$inputs.fxpCurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "Funds In", + "meta": { + "info": "Funds In" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Get Status Request before deposit" + }, + "description": "Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.DFSP_NAME}/accounts", + "method": "get", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('fxpCurrency')) {", + " pm.environment.set(\"fxpCurrency1SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"fxpCurrency1SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "description": "Deposit Funds in Settlement Account FX Currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.DFSP_NAME}/accounts/{$environment.fxpCurrency1SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}", + "id": "{$environment.fxpCurrency1SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.fxpCurrency1fundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.fxpCurrency1fundsInPrepareAmount}", + "currency": "{$inputs.fxpCurrency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('fxpCurrency1fundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('fxpCurrency1fundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "Get Status Request after deposit" + }, + "description": "Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.DFSP_NAME}/accounts", + "method": "get", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.fxpCurrency1SettlementAccountBalanceAfterFundsIn).to.equal(+environment.fxpCurrency1SettlementAccountBalanceBeforeFundsIn - +environment.fxpCurrency1fundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('fxpCurrency')) {", + " pm.environment.set(\"fxpCurrency1SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 4, + "name": "Setup Callback Endpoints", + "meta": { + "info": "FXP callbacks" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add FXP callback - AUTHORIZATIONS" + }, + "description": "Add FXP callback - AUTHORIZATIONS", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_AUTHORIZATIONS", + "value": "{$inputs.DFSP_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add FXP callback - PARTICIPANT PUT" + }, + "description": "Add FXP callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add FXP callback - PARTICIPANT PUT Error" + }, + "description": "Add FXP callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add FXP callback - PARTICIPANT PUT Batch" + }, + "description": "Add FXP callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add FXP callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add FXP callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add FXP callback - PARTIES GET" + }, + "description": "Add FXP callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add FXP callback - PARTIES PUT" + }, + "description": "Add FXP callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add FXP callback - PARTIES PUT Error" + }, + "description": "Add FXP callback - PARTIES PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add FXP callback - QUOTES" + }, + "description": "Add FXP callback - QUOTES", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.DFSP_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add FXP callback - TXN REQUEST" + }, + "description": "Add FXP callback - TXN REQUEST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.DFSP_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add FXP callback - TRANSFERS POST" + }, + "description": "Add FXP callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.DFSP_CALLBACK_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add FXP callback - TRANSFERS PUT" + }, + "description": "Add FXP callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add FXP callback - TRANSFERS ERROR" + }, + "description": "Add FXP callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add FXP callback - BULK-TRANSFER POST" + }, + "description": "Add FXP callback - BULK-TRANSFER POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.DFSP_CALLBACK_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add FXP callback - BULK-TRANSFER PUT" + }, + "description": "Add FXP callback - BULK-TRANSFER PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add FXP callback - BULK-TRANSFER ERROR" + }, + "description": "Add FXP callback - BULK-TRANSFER ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add FXP callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add FXP callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Add FXP callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add FXP callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Add FXP callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add FXP callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.DFSP_CALLBACK_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "Add FXP callback - PARTIES SUB-ID GET" + }, + "description": "Add FXP callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Add FXP callback - PARTIES SUB-ID PUT" + }, + "description": "Add FXP callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Add FXP callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add FXP callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "description": "Add callback - FX TRANSFERS POST", + "meta": { + "info": "Add callback - FX TRANSFERS POST" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_POST", + "value": "{$inputs.DFSP_CALLBACK_URL}/fxTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "description": "Add callback - FX TRANSFERS PUT", + "meta": { + "info": "Add callback - FX TRANSFERS PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_PUT", + "value": "{$inputs.DFSP_CALLBACK_URL}/fxTransfers/{{commitRequestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "description": "Add callback - FX TRANSFERS ERROR", + "meta": { + "info": "Add callback - FX TRANSFERS ERROR" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_TRANSFER_ERROR", + "value": "{$inputs.DFSP_CALLBACK_URL}/fxTransfers/{{commitRequestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "description": "Add callback - FXQUOTES PUT", + "meta": { + "info": "Add callback - FXQUOTES PUT" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_FX_QUOTES", + "value": "{$inputs.DFSP_CALLBACK_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ] + }, + { + "id": 5, + "name": "Setup Notification Emails", + "meta": { + "info": "FXP notification_emails" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.DFSP_NAME}" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Email-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Email-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.DFSP_NAME}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.DFSP_NAME}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.DFSP_NAME}" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.dfspEmail}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-happy-path-mvp-out-of-scope.json b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-happy-path-mvp-out-of-scope.json index 10379f08..7f2d20f9 100644 --- a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-happy-path-mvp-out-of-scope.json +++ b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-happy-path-mvp-out-of-scope.json @@ -29,7 +29,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-quotes-error-cases-mvp-out-of-scope.json b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-quotes-error-cases-mvp-out-of-scope.json index 2dac94a8..278859fd 100644 --- a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-quotes-error-cases-mvp-out-of-scope.json +++ b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-quotes-error-cases-mvp-out-of-scope.json @@ -29,7 +29,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -223,7 +223,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -407,7 +407,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -626,7 +626,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -845,7 +845,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -1072,7 +1072,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-transfers-error-case-mvp-out-of-scope.json b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-transfers-error-case-mvp-out-of-scope.json index a0398eb5..0c980164 100644 --- a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-transfers-error-case-mvp-out-of-scope.json +++ b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/bulk-transfers-error-case-mvp-out-of-scope.json @@ -29,7 +29,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -361,7 +361,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -653,7 +653,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -951,7 +951,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -1311,7 +1311,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/legacy-high-volume-bulk.json b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/legacy-high-volume-bulk.json index ebeab0c3..0b34243f 100644 --- a/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/legacy-high-volume-bulk.json +++ b/collections/hub/sdk_scheme_adapter/bulk-mvp-out-of-scope/legacy-high-volume-bulk.json @@ -28,7 +28,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -1191,7 +1191,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -2649,7 +2649,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "e0ac0773-2f96-4496-84f7-3c5a8bb2fe63", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-happy-path.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-happy-path.json index 1f93f7fa..6659e175 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-happy-path.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-happy-path.json @@ -32,7 +32,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -623,7 +623,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-high-volume_dynamic.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-high-volume_dynamic.json index 46c3e048..67bf1117 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-high-volume_dynamic.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-high-volume_dynamic.json @@ -26,7 +26,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-parties-error-cases.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-parties-error-cases.json index 6e5eafa1..ae190bbb 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-parties-error-cases.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-parties-error-cases.json @@ -32,7 +32,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -134,7 +134,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -250,7 +250,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -346,7 +346,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -509,7 +509,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -673,7 +673,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-quotes-error-cases.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-quotes-error-cases.json index 72c5ec97..85f0ebd7 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-quotes-error-cases.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-quotes-error-cases.json @@ -32,7 +32,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -220,7 +220,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -380,7 +380,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -595,7 +595,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -797,7 +797,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -1027,7 +1027,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -1296,7 +1296,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-sdk-warm-up.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-sdk-warm-up.json index 0d264bbf..751e85c1 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-sdk-warm-up.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-sdk-warm-up.json @@ -26,7 +26,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -248,7 +248,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-transfers-error-cases.json b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-transfers-error-cases.json index 8b46d896..8a9444ed 100644 --- a/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-transfers-error-cases.json +++ b/collections/hub/sdk_scheme_adapter/bulk/basic/bulk-transfers-error-cases.json @@ -32,7 +32,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -339,7 +339,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -624,7 +624,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { @@ -928,7 +928,7 @@ "method": "post", "body": { "bulkHomeTransactionID": "abc123", - "bulkTransactionId": "{$function.generic.generateUUID}", + "bulkTransactionId": "{$function.generic.generateID}", "options": { "onlyValidateParty": true, "autoAcceptParty": { diff --git a/collections/pm4ml/fxp2p/sdk_fx_transfer.json b/collections/pm4ml/golden_path/forex/feature_tests/happy_path/sdk_fx_transfer.json similarity index 100% rename from collections/pm4ml/fxp2p/sdk_fx_transfer.json rename to collections/pm4ml/golden_path/forex/feature_tests/happy_path/sdk_fx_transfer.json diff --git a/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_error.json b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_error.json new file mode 100644 index 00000000..cfc824d8 --- /dev/null +++ b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_error.json @@ -0,0 +1,300 @@ +{ + "options": {}, + "name": "fxp_error", + "test_cases": [ + { + "id": 1, + "name": "FX Quote - Error scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxQuotes returns PUT /fxQuotes/{ID}/error" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "501", + "quoteRequestExtensions" : [ + { + "key": "501", + "value": "Trigger Quote Error" + } + ] + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_CONVERSION_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "FX Transfer - Error Scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxTransfers returns PUT /fxTransfers/{ID}/error" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "502" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Quotes Response contains error", + "exec": [ + "expect(response.body.fxQuoteResponse).contains('error code')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Accept Conversion", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptConversion": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_QUOTE_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_QUOTE_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Accept Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptQuote": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be COMPLETED", + "exec": [ + "expect(response.body.currentState).to.equal('COMPLETED')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_non_success_states.json b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_non_success_states.json new file mode 100644 index 00000000..66851c74 --- /dev/null +++ b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_non_success_states.json @@ -0,0 +1,189 @@ +{ + "options": {}, + "name": "fxp_non_success_states", + "test_cases": [ + { + "id": 1, + "name": "FX Transfer - ABORTED Scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxTransfers sends ABORTED state" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "506" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_CONVERSION_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Accept Conversion", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptConversion": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_QUOTE_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_QUOTE_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Accept Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptQuote": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be COMPLETED", + "exec": [ + "expect(response.body.currentState).to.equal('COMPLETED')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_timeout_scenarios.json b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_timeout_scenarios.json new file mode 100644 index 00000000..72a61d9b --- /dev/null +++ b/collections/pm4ml/golden_path/forex/feature_tests/negative_scenarios/fxp_timeout_scenarios.json @@ -0,0 +1,477 @@ +{ + "options": {}, + "name": "fxp_error", + "test_cases": [ + { + "id": 1, + "name": "FX Quote - Timeout scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxQuotes timesout sending a response. Switch should send PUT /fxQuotes/{ID}/error without Timeout error code" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "503" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 500", + "exec": [ + "expect(response.status).to.equal(500)" + ] + }, + { + "id": 2, + "description": "Check for /error response with timeout information", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "FX Transfer - Timeout Scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxTransfers times out" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "504" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_CONVERSION_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Accept Conversion", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptConversion": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_QUOTE_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_QUOTE_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Accept Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptQuote": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be COMPLETED", + "exec": [ + "expect(response.body.currentState).to.equal('COMPLETED')" + ] + } + ] + } + } + ] + }, + { + "id": 3, + "name": "FX - Regular Transfer - Timeout Scenario", + "fileInfo": { + "path": "pm4ml/sdk_fx_transfer.json" + }, + "meta": { + "info": "POST /fxTransfers works fine, but POST /transfers times out" + }, + "requests": [ + { + "id": 1, + "description": "Initiate a transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "url": null, + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "merchantClassificationCode": "123", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}" + }, + "amountType": "SEND", + "transactionType": "TRANSFER", + "currency": "{$inputs.FX_SOURCE_CURRENCY}", + "amount": "505" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_CONVERSION_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Accept Conversion", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptConversion": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_QUOTE_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_QUOTE_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Accept Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "url": null, + "body": { + "acceptQuote": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be COMPLETED", + "exec": [ + "expect(response.body.currentState).to.equal('COMPLETED')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/pm4ml/p2p/sdk_post_transfer.json b/collections/pm4ml/golden_path/p2p/sdk_post_transfer.json similarity index 100% rename from collections/pm4ml/p2p/sdk_post_transfer.json rename to collections/pm4ml/golden_path/p2p/sdk_post_transfer.json diff --git a/collections/pm4ml/golden_path/proxy/fxp/sdk_post_transfer.json b/collections/pm4ml/golden_path/proxy/fxp/sdk_post_transfer.json new file mode 100644 index 00000000..34ea59f2 --- /dev/null +++ b/collections/pm4ml/golden_path/proxy/fxp/sdk_post_transfer.json @@ -0,0 +1,190 @@ +{ + "options": {}, + "name": "sdk-proxy-fxp", + "test_cases": [ + { + "id": 1, + "name": "Proxy-FXP Transfer Happy Path", + "meta": { + "info": "Proxy-FXP Transfer Happy Path" + }, + "requests": [ + { + "id": 1, + "description": "Send transfer", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": true + }, + "operationPath": "/transfers", + "path": "/transfers", + "method": "post", + "body": { + "homeTransactionId": "{$inputs.HOME_TRANSACTION_ID}", + "from": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "{$inputs.P2P_SOURCE_PARTY_ID_1}", + "displayName": "{$inputs.FROM_DISPLAY_NAME}", + "firstName": "{$inputs.FROM_FIRST_NAME}", + "middleName": "{$inputs.FROM_MIDDLE_NAME}", + "lastName": "{$inputs.FROM_LAST_NAME}", + "dateOfBirth": "{$inputs.FROM_DOB}", + "fspId": "{$inputs.FROM_FSP_ID}" + }, + "to": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "{$inputs.FX_DESTINATION_PARTY_ID_1}", + "merchantClassificationCode": 123 + }, + "amountType": "SEND", + "currency": "{$inputs.P2P_CURRENCY}", + "amount": "{$inputs.P2P_AMOUNT}", + "transactionType": "TRANSFER", + "note": "{$inputs.NOTE}", + "skipPartyLookup": false + }, + "params": { + "Type": "", + "ID": "" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_PARTY_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_PARTY_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 2, + "description": "Accept Party", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "body": { + "acceptParty": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_CONVERSION_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_CONVERSION_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 3, + "description": "Accept FX Conversion Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "body": { + "acceptConversion": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be WAITING_FOR_QUOTE_ACCEPTANCE", + "exec": [ + "expect(response.body.currentState).to.equal('WAITING_FOR_QUOTE_ACCEPTANCE')" + ] + } + ] + } + }, + { + "id": 4, + "description": "Accept Quote", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "operationPath": "/transfers/{transferId}", + "path": "/transfers/{$prev.1.response.body.transferId}", + "method": "put", + "params": { + "transferId": "{$prev.1.response.body.transferId}" + }, + "body": { + "acceptQuote": true + }, + "disabled": false, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status is 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Current state should be COMPLETED", + "exec": [ + "expect(response.body.currentState).to.equal('COMPLETED')" + ] + } + ] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/environments/hub.json b/environments/hub.json index b2d26ec3..5a7e1a14 100644 --- a/environments/hub.json +++ b/environments/hub.json @@ -213,6 +213,9 @@ "TTKSIM3_SDK_TESTAPI_URL": "http://$release_name-$param_simNameTTKSim3-sdk-api-svc:4002", "TTKSIM3_SDK_TESTAPI_WS_URL": "ws://$release_name-$param_simNameTTKSim3-sdk-api-svc:4002", "TTKSIM2_PARTY_NOT_FOUND": "partynotfound", - "TTKSIM2_PARTY_TIMES_OUT": "partytimesout" + "TTKSIM2_PARTY_TIMES_OUT": "partytimesout", + "ttkpayeefspIdentifier1": "7891234", + "ttkpayeefspIdentifier2": "5201", + "ttkpayeefspName": "ttkpayeefsp" } } diff --git a/environments/hub/forex/fxp-env.json b/environments/hub/forex/fxp-env.json new file mode 100644 index 00000000..2c738372 --- /dev/null +++ b/environments/hub/forex/fxp-env.json @@ -0,0 +1,30 @@ +{ + "inputValues": { + "FX_PAYER_DFSP_ID": "testingtoolkitdfsp", + "FX_TESTFXP1_ID": "test-fxp", + "FX_SOURCE_CURRENCY": "EUR", + "FX_SOURCE_AMOUNT": "10", + "FX_TARGET_CURRENCY": "EUR", + "FX_EXPIRATION": "2024-08-22T12:33:23.819Z", + "acceptFxParties": "application/vnd.interoperability.parties+json;version=1.0", + "acceptFxQuotes": "application/vnd.interoperability.fxQuotes+json;version=2.0", + "acceptFxTransfers": "application/vnd.interoperability.transfers+json;version=1.0", + "contentTypeFxParticipants": "application/vnd.interoperability.parties+json;version=1.0", + "contentTypeFxParties": "application/vnd.interoperability.parties+json;version=1.0", + "contentTypeFxQuotes": "application/vnd.interoperability.fxQuotes+json;version=2.0", + "contentTypeFxTransfers": "application/vnd.interoperability.transfers+json;version=1.0", + "currency": "USD", + "fxpCurrency": "USD", + "hub_operator": "NOT_APPLICABLE", + "HOST_CENTRAL_LEDGER": "http://moja1-centralledger-service", + "HOST_ACCOUNT_LOOKUP_SERVICE": "http://moja1-account-lookup-service", + "HOST_ORACLE": "http://moja1-simulator/oracle", + "HOST_QUOTING_SERVICE": "http://moja1-quoting-service", + "dfspEmail": "test@infitx.com", + "CALLBACK_ENDPOINT_BASE_URL": "http://moja1-ml-testing-toolkit-backend:4040", + "condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM", + "fulfillment": "UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA", + "expiration": "2024-07-26T11:12:15.158Z", + "ilpPacket": "AYIDBQAAAAAAACcQJGcucGF5ZWVmc3AubXNpc2RuLnt7cmVjZWl2ZXJtc2lzZG59fYIC1GV5SjBjbUZ1YzJGamRHbHZia2xrSWpvaVptVXhNREU0Wm1NdE1EaGxZeTAwWWpJM0xUbGpZalF0TnpjMk9URTFNR00zT1dKaklpd2ljWFZ2ZEdWSlpDSTZJbVpsTVRBeE9HWmpMVEE0WldNdE5HSXlOeTA1WTJJMExUYzNOamt4TlRCak56bGlZeUlzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaWUzdHlaV05sYVhabGNrMVRTVk5FVG4xOUlpd2labk53U1dRaU9pSndZWGxsWldaemNDSjlmU3dpY0dGNVpYSWlPbnNpY0dGeWRIbEpaRWx1Wm04aU9uc2ljR0Z5ZEhsSlpGUjVjR1VpT2lKTlUwbFRSRTRpTENKd1lYSjBlVWxrWlc1MGFXWnBaWElpT2lJeU56Y3hNemd3TXprd05TSXNJbVp6Y0Vsa0lqb2ljR0Y1WlhKbWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJazFoZEhNaUxDSnNZWE4wVG1GdFpTSTZJa2hoWjIxaGJpSjlMQ0prWVhSbFQyWkNhWEowYUNJNklqRTVPRE10TVRBdE1qVWlmWDBzSW1GdGIzVnVkQ0k2ZXlKaGJXOTFiblFpT2lJeE1EQWlMQ0pqZFhKeVpXNWplU0k2SWxWVFJDSjlMQ0owY21GdWMyRmpkR2x2YmxSNWNHVWlPbnNpYzJObGJtRnlhVzhpT2lKVVVrRk9VMFpGVWlJc0ltbHVhWFJwWVhSdmNpSTZJbEJCV1VWU0lpd2lhVzVwZEdsaGRHOXlWSGx3WlNJNklrTlBUbE5WVFVWU0luMTkA" + } +} \ No newline at end of file diff --git a/environments/pm4ml/proxy/fxp/proxy-fxp-env.json b/environments/pm4ml/proxy/fxp/proxy-fxp-env.json new file mode 100644 index 00000000..e88de0b6 --- /dev/null +++ b/environments/pm4ml/proxy/fxp/proxy-fxp-env.json @@ -0,0 +1,27 @@ +{ + "inputValues": { + "ENABLE_WS_ASSERTIONS": true, + "WS_ASSERTION_TIMEOUT": 5000, + "RETRY_MAX_ATTEMPTS": 100, + "FROM_DISPLAY_NAME": "Display-Test", + "FROM_FIRST_NAME": "Firstname-Test", + "FROM_MIDDLE_NAME": "Middlename-Test", + "FROM_LAST_NAME": "Lastname-Test", + "FROM_DOB": "1984-01-01", + "FROM_FSP_ID": "test-mwk-dfsp", + "HOME_TRANSACTION_ID": "123ABC", + "NOTE": "test", + "P2P_AMOUNT": "10", + "P2P_CURRENCY": "MWK", + "P2P_SOURCE_PARTY_ID_1": "16665551001", + "P2P_DESTINATION_PARTY_ID_1": "5678912", + "FX_SOURCE_PARTY_ID_1": "16665551001", + "FX_DESTINATION_PARTY_ID_1": "5678912", + "FXP1_ID": "testfxp", + "FX_PAYERDFSP_ID": "testpayer", + "FX_PAYEEDFSP_ID": "testpayee", + "FX_SOURCE_CURRENCY": "EUR", + "FX_TARGET_CURRENCY": "XXX", + "FX_SOURCE_AMOUNT": "10" + } +} \ No newline at end of file diff --git a/rules/mojaloop/ml-testing-toolkit/spec_files/rules_callback/default.json b/rules/hub/rules_callback/default.json similarity index 76% rename from rules/mojaloop/ml-testing-toolkit/spec_files/rules_callback/default.json rename to rules/hub/rules_callback/default.json index 8d85d9aa..33ac9968 100644 --- a/rules/mojaloop/ml-testing-toolkit/spec_files/rules_callback/default.json +++ b/rules/hub/rules_callback/default.json @@ -993,12 +993,6 @@ "value": "ttkpayeefsp", "path": "FSPIOP-Destination" }, - { - "fact": "headers", - "operator": "equal", - "value": "application/vnd.interoperability.transfers+json;version=1.1", - "path": "Content-Type" - }, { "fact": "body", "operator": "numericEqual", @@ -1060,12 +1054,6 @@ "value": "ttkpayeefsp", "path": "FSPIOP-Destination" }, - { - "fact": "headers", - "operator": "equal", - "value": "application/vnd.interoperability.transfers+json;version=1.1", - "path": "Content-Type" - }, { "fact": "body", "operator": "numericEqual", @@ -1127,12 +1115,6 @@ "value": "ttkpayeefsp", "path": "FSPIOP-Destination" }, - { - "fact": "headers", - "operator": "equal", - "value": "application/vnd.interoperability.transfers+json;version=1.1", - "path": "Content-Type" - }, { "fact": "body", "operator": "numericEqual", @@ -1202,7 +1184,7 @@ "path": "/parties/{Type}/{ID}", "params": { "headers": { - "Content-Type": "application/vnd.interoperability.parties+json;version=1.0", + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", "FSPIOP-Source": "greenbankfsp" }, "body": { @@ -1232,9 +1214,223 @@ "version": 1 }, { - "ruleId": 1, + "ruleId": 21, + "priority": 1, + "description": "get /parties/{Type}/{ID} for ttkfxpayer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "ttkfxpayer", + "path": "FSPIOP-Source" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "FSPIOP-Source": "ttkfxpayee", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" + }, + "body": { + "party": { + "partyIdInfo": { + "fspId": "ttkfxpayee" + }, + "merchantClassificationCode": null, + "name": "Justin Pierre", + "personalInfo": { + "complexName": { + "firstName": "Justin", + "middleName": "Pierre", + "lastName": "Trudeau" + }, + "dateOfBirth": "1971-12-25", + "kycInformation": "ENCRYPTED KYC INFORMATION" + }, + "supportedCurrencies": [ + "XTS" + ] + } + }, + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "ruleId": 50, "priority": 1, - "description": "get /parties/{Type}/{ID}", + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Happy Path", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "123456", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp", + "fspiop-proxy": "proxyttk" + }, + "body": { + "party": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "123456", + "fspId": "nonexistentpayeefsp" + }, + "name": "veniam consectetur officia si", + "personalInfo": { + "complexName": { + "lastName": "Proxy_Payee_Last", + "firstName": "Proxy_Payee_First" + }, + "dateOfBirth": "2000-10-10" + }, + "merchantClassificationCode": "873" + } + } + }, + "type": "FIXED_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "ruleId": 51, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payee side scheme with Payer side proxy as TTK and Payee DFSP as proxy", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "7891234", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "", + "FSPIOP-Source": "ttkpayeefsp", + "FSPIOP-Destination": "nonexistentpayerfsp" + }, + "body": { + "party": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "7891234", + "fspId": "payeefspproxyttk" + }, + "name": "veniam consectetur officia si", + "personalInfo": { + "complexName": { + "lastName": "Proxy_Payee_Last", + "firstName": "Proxy_Payee_First" + }, + "dateOfBirth": "2000-10-10" + }, + "merchantClassificationCode": "873" + } + } + }, + "type": "FIXED_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "ruleId": 22, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Default", "apiVersion": { "minorVersion": 0, "majorVersion": 1, @@ -1260,7 +1456,7 @@ "path": "/parties/{Type}/{ID}", "params": { "headers": { - "Content-Type": "application/vnd.interoperability.parties+json;version=1.0" + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0" }, "body": { "party": { @@ -1269,7 +1465,9 @@ } } }, - "scripts": {} + "scripts": { + "scriptingEngine": "postman" + } }, "type": "MOCK_CALLBACK" }, @@ -1277,11 +1475,9 @@ "version": 1 }, { - "type": "callback", - "version": 1, "ruleId": 2, "priority": 1, - "description": "post /quotes", + "description": "post /quotes - Default", "apiVersion": { "minorVersion": 0, "majorVersion": 1, @@ -1338,18 +1534,180 @@ "environment.quoteExpiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" ], "scriptingEngine": "javascript" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" } }, "delay": 0, "type": "MOCK_CALLBACK" - } + }, + "type": "callback", + "version": 1 }, { + "ruleId": 53, + "priority": 1, + "description": "Post /transfers - invalid fulfilment", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "15", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": { + "scripts": { + "scriptingEngine": "javascript" + }, + "body": { + "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8", + "completedTimestamp": "{$function.generic.curDateISO}", + "transferState": "COMMITTED", + "extensionList": null + } + }, + "type": "MOCK_CALLBACK" + }, "type": "callback", - "version": 1, + "version": 1 + }, + { + "ruleId": 57, + "priority": 1, + "description": "Post /transfers No callback", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "16", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": { + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "NO_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "ruleId": 56, + "priority": 1, + "description": "Post /transfers matching fulfilment", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM", + "path": "condition" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "body": { + "fulfilment": "UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA", + "completedTimestamp": "{$function.generic.curDateISO}", + "transferState": "COMMITTED", + "extensionList": null + } + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { "ruleId": 3, "priority": 1, - "description": "post /transfers", + "description": "post /transfers - Default", "apiVersion": { "minorVersion": 0, "majorVersion": 1, @@ -1373,17 +1731,21 @@ "event": { "method": "put", "path": "/transfers/{ID}", - "params": {}, + "params": { + "scripts": { + "scriptingEngine": "postman" + } + }, "delay": 0, "type": "MOCK_CALLBACK" - } + }, + "type": "callback", + "version": 1 }, { - "type": "callback", - "version": 1, "ruleId": 4, "priority": 1, - "description": "post /transactionRequests", + "description": "post /transactionRequests - Default", "apiVersion": { "minorVersion": 0, "majorVersion": 1, @@ -1410,11 +1772,16 @@ "params": { "body": { "transactionRequestState": "RECEIVED" + }, + "scripts": { + "scriptingEngine": "postman" } }, "delay": 0, "type": "MOCK_CALLBACK" - } + }, + "type": "callback", + "version": 1 }, { "type": "callback", @@ -1935,95 +2302,117 @@ } }, { - "ruleId": 21, + "ruleId": 50, "priority": 1, - "description": "get /fxParties/{Type}/{ID}", + "description": "post /fxQuotes", "apiVersion": { "minorVersion": 0, "majorVersion": 2, - "type": "fx-api", - "asynchronous": true + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" }, "conditions": { "all": [ { "fact": "operationPath", "operator": "equal", - "value": "/fxParties/{Type}/{ID}" + "value": "/fxQuotes" }, { "fact": "method", "operator": "equal", - "value": "get" + "value": "post" } ] }, "event": { "method": "put", - "path": "/fxParties/{Type}/{ID}", + "path": "/fxQuotes/{ID}", "params": { "scripts": { - "scriptingEngine": "postman" + "exec": [ + "const fxQuoteBody = JSON.parse(request.body)", + "environment.sourceAmountValue = fxQuoteBody.conversionTerms.sourceAmount.amount || 500", + "environment.targetAmountValue = fxQuoteBody.conversionTerms.targetAmount.amount || 500" + ], + "scriptingEngine": "javascript" + }, + "body": { + "condition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM", + "conversionTerms": { + "conversionId": "{$request.body.conversionTerms.conversionId}", + "determiningTransferId": "{$request.body.conversionTerms.determiningTransferId}", + "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", + "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", + "amountType": "{$request.body.conversionTerms.amountType}", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}", + "amount": "{$environment.sourceAmountValue}" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}", + "amount": "{$environment.targetAmountValue}" + }, + "charges": [ + { + "chargeType": "string", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}", + "amount": "33" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}", + "amount": "6000" + } + } + ], + "expiration": "2025-12-25T14:17:09.663+01:00" + } + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" } }, - "type": "MOCK_CALLBACK" + "type": "FIXED_CALLBACK" }, "type": "callback", "version": 1 }, { - "ruleId": 22, + "ruleId": 54, "priority": 1, - "description": "get /fxParties/{Type}/{ID}/{SubId}", + "description": "post /fxTransfers - invalid fulfilment", "apiVersion": { "minorVersion": 0, "majorVersion": 2, - "type": "fx-api", - "asynchronous": true + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" }, "conditions": { "all": [ { - "fact": "operationPath", - "operator": "equal", - "value": "/fxParties/{Type}/{ID}/{SubId}" + "fact": "body", + "operator": "numericEqual", + "value": "15", + "path": "sourceAmount.amount" }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/fxParties/{Type}/{ID}/{SubId}", - "params": { - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - }, - { - "ruleId": 23, - "priority": 1, - "description": "post /fxQuotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 2, - "type": "fx-api", - "asynchronous": true - }, - "conditions": { - "all": [ { "fact": "operationPath", "operator": "equal", - "value": "/fxQuotes" + "value": "/fxTransfers" }, { "fact": "method", @@ -2034,66 +2423,54 @@ }, "event": { "method": "put", - "path": "/fxQuotes/{ID}", + "path": "/fxTransfers/{ID}", "params": { "scripts": { - "scriptingEngine": "postman" + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" + }, + "body": { + "fulfilment": "AelJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" } }, - "type": "MOCK_CALLBACK" + "type": "FIXED_CALLBACK" }, "type": "callback", "version": 1 }, { - "ruleId": 24, + "ruleId": 55, "priority": 1, - "description": "get /fxQuotes/{ID}", + "description": "post /fxTransfers No callback", "apiVersion": { "minorVersion": 0, "majorVersion": 2, - "type": "fx-api", - "asynchronous": true + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" }, "conditions": { "all": [ { - "fact": "operationPath", - "operator": "equal", - "value": "/fxQuotes/{ID}" + "fact": "body", + "operator": "numericEqual", + "value": "16", + "path": "sourceAmount.amount" }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/fxQuotes/{ID}", - "params": { - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - }, - { - "ruleId": 25, - "priority": 1, - "description": "post /fxTransfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 2, - "type": "fx-api", - "asynchronous": true - }, - "conditions": { - "all": [ { "fact": "operationPath", "operator": "equal", @@ -2114,32 +2491,37 @@ "scriptingEngine": "postman" } }, - "type": "MOCK_CALLBACK" + "type": "NO_CALLBACK" }, "type": "callback", "version": 1 }, { - "ruleId": 26, + "ruleId": 51, "priority": 1, - "description": "get /fxTransfers/{ID}", + "description": "post /fxTransfers", "apiVersion": { "minorVersion": 0, "majorVersion": 2, - "type": "fx-api", - "asynchronous": true + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" }, "conditions": { "all": [ { "fact": "operationPath", "operator": "equal", - "value": "/fxTransfers/{ID}" + "value": "/fxTransfers" }, { "fact": "method", "operator": "equal", - "value": "get" + "value": "post" } ] }, @@ -2148,12 +2530,26 @@ "path": "/fxTransfers/{ID}", "params": { "scripts": { - "scriptingEngine": "postman" + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + }, + "body": { + "fulfilment": "UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" } }, - "type": "MOCK_CALLBACK" + "type": "FIXED_CALLBACK" }, "type": "callback", "version": 1 } -] +] \ No newline at end of file diff --git a/rules/mojaloop/ml-testing-toolkit/spec_files/rules_response/default.json b/rules/hub/rules_response/default.json similarity index 100% rename from rules/mojaloop/ml-testing-toolkit/spec_files/rules_response/default.json rename to rules/hub/rules_response/default.json diff --git a/rules/hub/rules_validation/default.json b/rules/hub/rules_validation/default.json new file mode 100644 index 00000000..ec843a53 --- /dev/null +++ b/rules/hub/rules_validation/default.json @@ -0,0 +1,1262 @@ +[ + { + "ruleId": 1, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in Proxy", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "3100", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "FSPIOP-Source": "proxyttk", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3100", + "errorDescription": "Generic Error in Proxy" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 2, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 200X Error in Payee Scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "2001", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "2001", + "errorDescription": "Generic 200X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 3, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 300X Error in Payee Scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "3001", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3001", + "errorDescription": "Generic 300X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 4, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 400X Error in Payee Scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "4001", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "4001", + "errorDescription": "Generic 400X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 5, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 500X Error in Payee Scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "5001", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "5001", + "errorDescription": "Generic 500X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 6, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Error in Payee DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "5101", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "body": { + "errorInformation": { + "errorCode": "5101", + "errorDescription": "Generic error in Payee DFSP" + } + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "nonexistentpayeefsp", + "FSPIOP-Destination": "testingtoolkitdfsp" + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 7, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in Proxy", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "3100", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3100", + "errorDescription": "Generic Error in Proxy" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 8, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 200X Error in Payee dfsp scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "2001", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "2001", + "errorDescription": "Generic 200X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 9, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 300X Error in Payee dfsp scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "3001", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3001", + "errorDescription": "Generic 300X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 10, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 400X Error in Payee dfsp scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "4001", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "4001", + "errorDescription": "Generic 400X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 11, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - 500X Error in Payee dfsp scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "5001", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "5001", + "errorDescription": "Generic 500X error in Payeefsp Scheme" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 12, + "priority": 1, + "description": "post /quotes - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in payee dfsp", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "5101", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "5101", + "errorDescription": "Generic error in Payee DFSP" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 13, + "priority": 1, + "description": "post /transfers - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in Proxy", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "3100", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3100", + "errorDescription": "Generic Error in Proxy" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 14, + "priority": 1, + "description": "post /transfers - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in payee dfsp scheme", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "3100", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3100", + "errorDescription": "Generic Error in Proxy" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 15, + "priority": 1, + "description": "post /transfers - Testing Payer Scheme with Payee side Proxy as TTK - Negative Scenarios - Generic Error in payee dfsp", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "5101", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "proxyttk", + "FSPIOP-Destination": "testingtoolkitdfsp" + }, + "body": { + "errorInformation": { + "errorCode": "3100", + "errorDescription": "Generic Error in Proxy" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 16, + "priority": 1, + "description": "get /parties/{Type}/{ID} - Testing Payee Scheme with Payer side Proxy as TTK - Negative Scenarios - Error in Payee DFSP", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "pathParams", + "operator": "equal", + "value": "5201", + "path": "ID" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "body": { + "errorInformation": { + "errorCode": "5201", + "errorDescription": "Generic error in Payee DFSP" + } + }, + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=2.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "ttkpayeefsp", + "FSPIOP-Destination": "nonexistentpayerfsp" + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 17, + "priority": 1, + "description": "post /quotes - Testing Payee Scheme with Payer side Proxy as TTK - Negative Scenarios - Generic Error in payee dfsp", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "5201", + "path": "payee.partyIdInfo.partyIdentifier" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.quotes+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "ttkpayeefsp", + "FSPIOP-Destination": "nonexistentpayerfsp" + }, + "body": { + "errorInformation": { + "errorCode": "5201", + "errorDescription": "Generic error in Payee DFSP" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 18, + "priority": 1, + "description": "post /transfers - Testing Payee Scheme with Payer side Proxy as TTK - Negative Scenarios - Generic Error in payee dfsp", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "5201", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "application/vnd.interoperability.transfers+json;version=1.0", + "Date": "Tue, 23 Jul 2024 02:05:53 GMT", + "FSPIOP-Source": "ttkpayeefsp", + "FSPIOP-Destination": "nonexistentpayerfsp" + }, + "body": { + "errorInformation": { + "errorCode": "5201", + "errorDescription": "Generic Error in Payee DFSP" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 19, + "priority": 1, + "description": "FxQuotes generic error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "13", + "path": "conversionTerms.sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/fxQuotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" + }, + "body": { + "errorInformation": { + "errorCode": "2000", + "errorDescription": "This is a generic error" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 20, + "priority": 1, + "description": "fxTransfers generic error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "13", + "path": "sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/fxTransfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" + }, + "body": { + "errorInformation": { + "errorCode": "2000", + "errorDescription": "This is a generic error" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + }, + { + "ruleId": 21, + "priority": 1, + "description": "transfers generic error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 2, + "type": "fspiop", + "asynchronous": true, + "specFile": "spec_files/api_definitions/fspiop_2.0/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/fspiop_2.0/callback_map.json", + "responseMapFile": "spec_files/api_definitions/fspiop_2.0/response_map.json", + "jsfRefFile": "spec_files/api_definitions/fspiop_2.0/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/fspiop_2.0/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "13", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + }, + "headers": { + "Content-Type": "{$request.headers.content-type}", + "Date": "{$request.headers.date}", + "FSPIOP-Source": "{$request.headers.fspiop-destination}", + "FSPIOP-Destination": "{$request.headers.fspiop-source}" + }, + "body": { + "errorInformation": { + "errorCode": "2000", + "errorDescription": "This is a generic error" + } + } + }, + "type": "FIXED_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + } +] \ No newline at end of file diff --git a/rules/mojaloop/ml-testing-toolkit/spec_files/rules_validation/default.json b/rules/mojaloop/ml-testing-toolkit/spec_files/rules_validation/default.json deleted file mode 100644 index 0637a088..00000000 --- a/rules/mojaloop/ml-testing-toolkit/spec_files/rules_validation/default.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/rules/pm4ml/forex/rules_sync_response/default.json b/rules/pm4ml/forex/rules_sync_response/default.json new file mode 100644 index 00000000..f2497a19 --- /dev/null +++ b/rules/pm4ml/forex/rules_sync_response/default.json @@ -0,0 +1,550 @@ +[ + { + "ruleId": 6, + "priority": 1, + "description": "FXP - post /fxQuotes", + "apiVersion": { + "asynchronous": false, + "majorVersion": 2, + "minorVersion": 1, + "type": "mojaloop_connector_outbound" + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "params": { + "body": { + "conversionTerms": { + "amountType": "SEND", + "conversionId": "{$request.body.conversionTerms.conversionId}", + "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "{$request.body.conversionTerms.expiration}", + "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}" + } + }, + "homeTransactionId": "homeTransactionId-123" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const fxQuoteBody = JSON.parse(request.body)", + "const fxRates = {", + " \"base\": \"USD\",", + " \"date\": \"2023-03-03\",", + " \"rates\": {", + " \"AED\": 3.670595,", + " \"AFN\": 88.881425,", + " \"ALL\": 108.376523,", + " \"AMD\": 390.471399,", + " \"ANG\": 1.804308,", + " \"AOA\": 505.839998,", + " \"ARS\": 197.689779,", + " \"AUD\": 1.48222,", + " \"AWG\": 1.799566,", + " \"AZN\": 1.699337,", + " \"BAM\": 1.842544,", + " \"BBD\": 1.998973,", + " \"BDT\": 107.07517,", + " \"BGN\": 1.843505,", + " \"BHD\": 0.376919,", + " \"BIF\": 2079.526363,", + " \"BMD\": 0.999953,", + " \"BND\": 1.34899,", + " \"BOB\": 6.915241,", + " \"BRL\": 5.198354,", + " \"BSD\": 0.999335,", + " \"BTC\": 0.000044,", + " \"BTN\": 82.647688,", + " \"BWP\": 13.237335,", + " \"BYN\": 2.526074,", + " \"BZD\": 2.01736,", + " \"CAD\": 1.357836,", + " \"CDF\": 2086.44176,", + " \"CHF\": 0.940605,", + " \"CLF\": 0.02963,", + " \"CLP\": 812.200511,", + " \"CNH\": 6.904663,", + " \"CNY\": 6.898567,", + " \"COP\": 4833.056834,", + " \"CRC\": 558.748547,", + " \"CUC\": 0.99935,", + " \"CUP\": 25.728404,", + " \"CVE\": 103.850722,", + " \"CZK\": 22.089353,", + " \"DJF\": 178.175863,", + " \"DKK\": 7.009313,", + " \"DOP\": 55.539156,", + " \"DZD\": 136.526375,", + " \"EGP\": 30.743014,", + " \"ERN\": 14.987908,", + " \"ETB\": 53.840023,", + " \"EUR\": 0.942228,", + " \"FJD\": 2.210902,", + " \"FKP\": 0.83471,", + " \"GBP\": 0.834759,", + " \"GEL\": 2.598071,", + " \"GGP\": 0.834647,", + " \"GHS\": 12.759418,", + " \"GIP\": 0.834672,", + " \"GMD\": 60.98912,", + " \"GNF\": 8615.060299,", + " \"GTQ\": 7.816555,", + " \"GYD\": 211.148725,", + " \"HKD\": 7.843114,", + " \"HNL\": 24.676398,", + " \"HRK\": 7.096534,", + " \"HTG\": 151.107107,", + " \"HUF\": 354.546511,", + " \"IDR\": 15305.816425,", + " \"ILS\": 3.659591,", + " \"IMP\": 0.83482,", + " \"INR\": 82.271752,", + " \"IQD\": 1460.523392,", + " \"IRR\": 42214.667089,", + " \"ISK\": 142.311052,", + " \"JEP\": 0.83532,", + " \"JMD\": 154.109032,", + " \"JOD\": 0.709871,", + " \"JPY\": 136.579884,", + " \"KES\": 127.794041,", + " \"KGS\": 87.345932,", + " \"KHR\": 4067.915978,", + " \"KMF\": 464.562389,", + " \"KPW\": 899.247674,", + " \"KRW\": 1302.190934,", + " \"KWD\": 0.307326,", + " \"KYD\": 0.83405,", + " \"KZT\": 436.101643,", + " \"LAK\": 16873.790213,", + " \"LBP\": 15020.521133,", + " \"LKR\": 345.92388,", + " \"LRD\": 159.117366,", + " \"LSL\": 18.20456,", + " \"LYD\": 4.835853,", + " \"MAD\": 10.388795,", + " \"MDL\": 18.888917,", + " \"MGA\": 4296.352625,", + " \"MKD\": 58.02969,", + " \"MMK\": 2101.470623,", + " \"MNT\": 3404.116439,", + " \"MOP\": 8.091167,", + " \"MRU\": 36.386096,", + " \"MUR\": 46.641155,", + " \"MVR\": 15.347871,", + " \"MWK\": 1027.828846,", + " \"MXN\": 18.098725,", + " \"MYR\": 4.474645,", + " \"MZN\": 63.797698,", + " \"NAD\": 18.214751,", + " \"NGN\": 460.317636,", + " \"NIO\": 36.600644,", + " \"NOK\": 10.424506,", + " \"NPR\": 132.235448,", + " \"NZD\": 1.604879,", + " \"OMR\": 0.385743,", + " \"PAB\": 0.999902,", + " \"PEN\": 3.770718,", + " \"PGK\": 3.527422,", + " \"PHP\": 54.844041,", + " \"PKR\": 278.695386,", + " \"PLN\": 4.423791,", + " \"PYG\": 7220.315472,", + " \"QAR\": 3.651532,", + " \"RON\": 4.637626,", + " \"RSD\": 110.496314,", + " \"RUB\": 75.238572,", + " \"RWF\": 1091.764956,", + " \"SAR\": 3.750399,", + " \"SBD\": 8.239938,", + " \"SCR\": 13.476738,", + " \"SDG\": 590.506115,", + " \"SEK\": 10.481266,", + " \"SGD\": 1.346505,", + " \"SHP\": 0.834776,", + " \"SLL\": 17650.226858,", + " \"SOS\": 568.863447,", + " \"SRD\": 33.904806,", + " \"SSP\": 130.15096,", + " \"STD\": 22804.902808,", + " \"STN\": 23.075404,", + " \"SVC\": 8.756667,", + " \"SYP\": 2510.429835,", + " \"SZL\": 18.20316,", + " \"THB\": 34.771491,", + " \"TJS\": 10.006042,", + " \"TMT\": 3.507758,", + " \"TND\": 3.129616,", + " \"TOP\": 2.355679,", + " \"TRY\": 18.879408,", + " \"TTD\": 6.789468,", + " \"TWD\": 30.624624,", + " \"TZS\": 2330.0501,", + " \"UAH\": 36.958426,", + " \"UGX\": 3718.628848,", + " \"USD\": 1,", + " \"UYU\": 38.884596,", + " \"UZS\": 11371.806807,", + " \"VES\": 24.306068,", + " \"VND\": 23702.143038,", + " \"VUV\": 117.94585,", + " \"WST\": 2.695482,", + " \"XAF\": 617.756757,", + " \"XAG\": 0.047556,", + " \"XAU\": 0.0011,", + " \"XCD\": 2.700451,", + " \"XDR\": 0.751352,", + " \"XOF\": 617.756728,", + " \"XPD\": 0.001709,", + " \"XPF\": 112.382643,", + " \"XPT\": 0.001221,", + " \"YER\": 250.041827,", + " \"ZAR\": 18.172541,", + " \"ZMW\": 19.989716,", + " \"ZWL\": 321.731101", + " }", + "}", + "", + "const sourceCurrency = fxQuoteBody.conversionTerms.sourceAmount?.currency", + "const targetCurrency = fxQuoteBody.conversionTerms.targetAmount?.currency", + "let conversionRate = 1", + "", + "if(sourceCurrency === fxRates.base) {", + " conversionRate = fxRates.rates[targetCurrency]", + "} else {", + " const invertConvRate1 = fxRates.rates[sourceCurrency]", + " const baseConvRate = fxRates.rates[targetCurrency]", + " conversionRate = (baseConvRate / invertConvRate1)", + "}", + "", + "const sourceAmount = fxQuoteBody.conversionTerms.sourceAmount.amount", + "const targetAmount = fxQuoteBody.conversionTerms.targetAmount.amount", + "", + "let newSourceAmount = sourceAmount", + "let newTargetAmount = targetAmount", + "", + "if (!sourceAmount) {", + " newSourceAmount = Math.round(targetAmount / conversionRate)", + "}", + "", + "if (!targetAmount) {", + " newTargetAmount = Math.round(sourceAmount * conversionRate)", + "}", + "", + "const chargesPercent = 2", + "const chargesSourceAmount = Math.round(newSourceAmount * chargesPercent) / 100", + "const chargesTargetAmount = Math.round(newTargetAmount * chargesPercent) / 100", + "", + "custom.appendEventBody({", + " conversionTerms: {", + " sourceAmount: {", + " amount: newSourceAmount + \"\"", + " },", + " targetAmount: {", + " amount: newTargetAmount + \"\"", + " },", + " charges: [", + " {", + " chargeType: \"currency conversion\",", + " sourceAmount: {", + " amount: chargesSourceAmount + \"\",", + " currency: sourceCurrency", + " },", + " targetAmount: {", + " amount: chargesTargetAmount + \"\",", + " currency: targetCurrency", + " }", + " }", + " ]", + " }", + "})" + ], + "scriptingEngine": "javascript" + } + }, + "path": null, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 7, + "priority": 1, + "description": "FXP - post /fxTransfers response", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeTransactionId": "{$request.body.homeTransactionId}", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 8, + "priority": 1, + "description": "get /parties/{idType}/{idValue}", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{idType}/{idValue}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "dateOfBirth": "1966-06-16", + "displayName": "Yaro", + "firstName": "Yaro", + "fspId": "testpayee", + "idType": "MSISDN", + "idValue": "{$request.params.idValue}", + "lastName": "Smith", + "merchantClassificationCode": "1234", + "middleName": "", + "kycInformation": "This is encrypted KYC information", + "supportedCurrencies": [ + "ZMW" + ] + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 9, + "priority": 1, + "description": "post /quoterequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quoterequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "quoteId": "{$request.body.quoteId}", + "transactionId": "{$request.body.transactionId}", + "transferAmount": "{$request.body.amount}", + "transferAmountCurrency": "{$request.body.currency}" + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 10, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "completedTimestamp": "{$environment.completedTimestamp}", + "homeTransactionId": "123", + "transferState": "COMMITTED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 11, + "priority": 1, + "description": "post /transactionrequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactionrequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeR2PTransactionId": "cba321", + "transactionId": "{$function.generic.generateUUID}", + "transactionRequestState": "RECEIVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const reqBody = JSON.parse(request.body)", + "const outEndpoint = userConfig.CALLBACK_ENDPOINT", + "const outReqBody = {", + " transactionRequestId: reqBody.transactionRequestId,", + " homeR2PTransactionId: 'abc123',", + " from: reqBody.to,", + " to: reqBody.from,", + " amountType: \"RECEIVE\",", + " currency: reqBody.currency,", + " amount: reqBody.amount,", + " scenario: \"DEPOSIT\",", + " initiator: reqBody.initiator,", + " initiatorType: reqBody.initiatorType,", + " note: \"Note sent to Payee.\"", + "}", + "try {", + " const axioResponse = await axios({", + " method: 'post',", + " url: outEndpoint + '/requestToPayTransfer',", + " data: outReqBody", + " });", + " res = axioResponse.data;", + " responseCode = axioResponse.code || axioResponse.status", + "} catch (err) {", + " console.log(err)", + "}", + "" + ], + "scriptingEngine": "javascript" + } + }, + "type": "MOCK_RESPONSE" + }, + "type": "response", + "version": 1 + } +] \ No newline at end of file diff --git a/rules/pm4ml/forex/rules_sync_response/fxp_response_rules.json b/rules/pm4ml/forex/rules_sync_response/fxp_response_rules.json new file mode 100644 index 00000000..60866001 --- /dev/null +++ b/rules/pm4ml/forex/rules_sync_response/fxp_response_rules.json @@ -0,0 +1,878 @@ +[ + { + "ruleId": 12, + "priority": 1, + "description": "FXP - Generic error for post /fxQuotes", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false, + "specFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/mojaloop_connector_backend_2.1/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "501", + "path": "conversionTerms.sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "statusCode": "5001", + "message": "Generic Error" + }, + "statusCode": "500", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 14, + "priority": 1, + "description": "FXP - Timeout scenario for post /fxQuotes", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false, + "specFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/mojaloop_connector_backend_2.1/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "503", + "path": "conversionTerms.sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "conversionTerms": { + "amountType": "SEND", + "conversionId": "{$request.body.conversionTerms.conversionId}", + "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "{$request.body.conversionTerms.expiration}", + "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}" + } + }, + "homeTransactionId": "homeTransactionId-123" + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + }, + "delay": 300000 + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 6, + "priority": 1, + "description": "FXP - post /fxQuotes", + "apiVersion": { + "asynchronous": false, + "majorVersion": 2, + "minorVersion": 1, + "type": "mojaloop_connector_outbound" + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "params": { + "body": { + "conversionTerms": { + "amountType": "SEND", + "conversionId": "{$request.body.conversionTerms.conversionId}", + "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "{$request.body.conversionTerms.expiration}", + "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}" + } + }, + "homeTransactionId": "homeTransactionId-123" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const fxQuoteBody = JSON.parse(request.body)", + "const fxRates = {", + " \"base\": \"USD\",", + " \"date\": \"2023-03-03\",", + " \"rates\": {", + " \"AED\": 3.670595,", + " \"AFN\": 88.881425,", + " \"ALL\": 108.376523,", + " \"AMD\": 390.471399,", + " \"ANG\": 1.804308,", + " \"AOA\": 505.839998,", + " \"ARS\": 197.689779,", + " \"AUD\": 1.48222,", + " \"AWG\": 1.799566,", + " \"AZN\": 1.699337,", + " \"BAM\": 1.842544,", + " \"BBD\": 1.998973,", + " \"BDT\": 107.07517,", + " \"BGN\": 1.843505,", + " \"BHD\": 0.376919,", + " \"BIF\": 2079.526363,", + " \"BMD\": 0.999953,", + " \"BND\": 1.34899,", + " \"BOB\": 6.915241,", + " \"BRL\": 5.198354,", + " \"BSD\": 0.999335,", + " \"BTC\": 0.000044,", + " \"BTN\": 82.647688,", + " \"BWP\": 13.237335,", + " \"BYN\": 2.526074,", + " \"BZD\": 2.01736,", + " \"CAD\": 1.357836,", + " \"CDF\": 2086.44176,", + " \"CHF\": 0.940605,", + " \"CLF\": 0.02963,", + " \"CLP\": 812.200511,", + " \"CNH\": 6.904663,", + " \"CNY\": 6.898567,", + " \"COP\": 4833.056834,", + " \"CRC\": 558.748547,", + " \"CUC\": 0.99935,", + " \"CUP\": 25.728404,", + " \"CVE\": 103.850722,", + " \"CZK\": 22.089353,", + " \"DJF\": 178.175863,", + " \"DKK\": 7.009313,", + " \"DOP\": 55.539156,", + " \"DZD\": 136.526375,", + " \"EGP\": 30.743014,", + " \"ERN\": 14.987908,", + " \"ETB\": 53.840023,", + " \"EUR\": 0.942228,", + " \"FJD\": 2.210902,", + " \"FKP\": 0.83471,", + " \"GBP\": 0.834759,", + " \"GEL\": 2.598071,", + " \"GGP\": 0.834647,", + " \"GHS\": 12.759418,", + " \"GIP\": 0.834672,", + " \"GMD\": 60.98912,", + " \"GNF\": 8615.060299,", + " \"GTQ\": 7.816555,", + " \"GYD\": 211.148725,", + " \"HKD\": 7.843114,", + " \"HNL\": 24.676398,", + " \"HRK\": 7.096534,", + " \"HTG\": 151.107107,", + " \"HUF\": 354.546511,", + " \"IDR\": 15305.816425,", + " \"ILS\": 3.659591,", + " \"IMP\": 0.83482,", + " \"INR\": 82.271752,", + " \"IQD\": 1460.523392,", + " \"IRR\": 42214.667089,", + " \"ISK\": 142.311052,", + " \"JEP\": 0.83532,", + " \"JMD\": 154.109032,", + " \"JOD\": 0.709871,", + " \"JPY\": 136.579884,", + " \"KES\": 127.794041,", + " \"KGS\": 87.345932,", + " \"KHR\": 4067.915978,", + " \"KMF\": 464.562389,", + " \"KPW\": 899.247674,", + " \"KRW\": 1302.190934,", + " \"KWD\": 0.307326,", + " \"KYD\": 0.83405,", + " \"KZT\": 436.101643,", + " \"LAK\": 16873.790213,", + " \"LBP\": 15020.521133,", + " \"LKR\": 345.92388,", + " \"LRD\": 159.117366,", + " \"LSL\": 18.20456,", + " \"LYD\": 4.835853,", + " \"MAD\": 10.388795,", + " \"MDL\": 18.888917,", + " \"MGA\": 4296.352625,", + " \"MKD\": 58.02969,", + " \"MMK\": 2101.470623,", + " \"MNT\": 3404.116439,", + " \"MOP\": 8.091167,", + " \"MRU\": 36.386096,", + " \"MUR\": 46.641155,", + " \"MVR\": 15.347871,", + " \"MWK\": 1027.828846,", + " \"MXN\": 18.098725,", + " \"MYR\": 4.474645,", + " \"MZN\": 63.797698,", + " \"NAD\": 18.214751,", + " \"NGN\": 460.317636,", + " \"NIO\": 36.600644,", + " \"NOK\": 10.424506,", + " \"NPR\": 132.235448,", + " \"NZD\": 1.604879,", + " \"OMR\": 0.385743,", + " \"PAB\": 0.999902,", + " \"PEN\": 3.770718,", + " \"PGK\": 3.527422,", + " \"PHP\": 54.844041,", + " \"PKR\": 278.695386,", + " \"PLN\": 4.423791,", + " \"PYG\": 7220.315472,", + " \"QAR\": 3.651532,", + " \"RON\": 4.637626,", + " \"RSD\": 110.496314,", + " \"RUB\": 75.238572,", + " \"RWF\": 1091.764956,", + " \"SAR\": 3.750399,", + " \"SBD\": 8.239938,", + " \"SCR\": 13.476738,", + " \"SDG\": 590.506115,", + " \"SEK\": 10.481266,", + " \"SGD\": 1.346505,", + " \"SHP\": 0.834776,", + " \"SLL\": 17650.226858,", + " \"SOS\": 568.863447,", + " \"SRD\": 33.904806,", + " \"SSP\": 130.15096,", + " \"STD\": 22804.902808,", + " \"STN\": 23.075404,", + " \"SVC\": 8.756667,", + " \"SYP\": 2510.429835,", + " \"SZL\": 18.20316,", + " \"THB\": 34.771491,", + " \"TJS\": 10.006042,", + " \"TMT\": 3.507758,", + " \"TND\": 3.129616,", + " \"TOP\": 2.355679,", + " \"TRY\": 18.879408,", + " \"TTD\": 6.789468,", + " \"TWD\": 30.624624,", + " \"TZS\": 2330.0501,", + " \"UAH\": 36.958426,", + " \"UGX\": 3718.628848,", + " \"USD\": 1,", + " \"UYU\": 38.884596,", + " \"UZS\": 11371.806807,", + " \"VES\": 24.306068,", + " \"VND\": 23702.143038,", + " \"VUV\": 117.94585,", + " \"WST\": 2.695482,", + " \"XAF\": 617.756757,", + " \"XAG\": 0.047556,", + " \"XAU\": 0.0011,", + " \"XCD\": 2.700451,", + " \"XDR\": 0.751352,", + " \"XOF\": 617.756728,", + " \"XPD\": 0.001709,", + " \"XPF\": 112.382643,", + " \"XPT\": 0.001221,", + " \"YER\": 250.041827,", + " \"ZAR\": 18.172541,", + " \"ZMW\": 19.989716,", + " \"ZWL\": 321.731101", + " }", + "}", + "", + "const sourceCurrency = fxQuoteBody.conversionTerms.sourceAmount?.currency", + "const targetCurrency = fxQuoteBody.conversionTerms.targetAmount?.currency", + "let conversionRate = 1", + "", + "if(sourceCurrency === fxRates.base) {", + " conversionRate = fxRates.rates[targetCurrency]", + "} else {", + " const invertConvRate1 = fxRates.rates[sourceCurrency]", + " const baseConvRate = fxRates.rates[targetCurrency]", + " conversionRate = (baseConvRate / invertConvRate1)", + "}", + "", + "const sourceAmount = fxQuoteBody.conversionTerms.sourceAmount.amount", + "const targetAmount = fxQuoteBody.conversionTerms.targetAmount.amount", + "", + "let newSourceAmount = sourceAmount", + "let newTargetAmount = targetAmount", + "", + "if (!sourceAmount) {", + " newSourceAmount = Math.round(targetAmount / conversionRate)", + "}", + "", + "if (!targetAmount) {", + " newTargetAmount = Math.round(sourceAmount * conversionRate)", + "}", + "", + "const chargesPercent = 5", + "const chargesSourceAmount = Math.round(newSourceAmount * chargesPercent) / 100", + "const chargesTargetAmount = Math.round(newTargetAmount * chargesPercent) / 100", + "", + "custom.appendEventBody({", + " conversionTerms: {", + " sourceAmount: {", + " amount: newSourceAmount + \"\"", + " },", + " targetAmount: {", + " amount: newTargetAmount + \"\"", + " },", + " charges: [", + " {", + " chargeType: \"currency conversion\",", + " sourceAmount: {", + " amount: chargesSourceAmount + \"\",", + " currency: sourceCurrency", + " },", + " targetAmount: {", + " amount: chargesTargetAmount + \"\",", + " currency: targetCurrency", + " }", + " }", + " ]", + " }", + "})" + ], + "scriptingEngine": "javascript" + } + }, + "path": null, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 13, + "priority": 1, + "description": "FXP - Generic error for post /fxTransfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false, + "specFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/mojaloop_connector_backend_2.1/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "502", + "path": "sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "statusCode": "5002", + "message": "Generic forex transfer error" + }, + "statusCode": "500", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 15, + "priority": 1, + "description": "FXP - Timeout scenario for post /fxTransfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false, + "specFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/mojaloop_connector_backend_2.1/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "504", + "path": "sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeTransactionId": "{$request.body.homeTransactionId}", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + }, + "delay": 300000 + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 16, + "priority": 1, + "description": "FXP - ABORTED state for post /fxTransfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false, + "specFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/api_spec.yaml", + "callbackMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/callback_map.json", + "responseMapFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/response_map.json", + "jsfRefFile": "spec_files/api_definitions/mojaloop_connector_backend_2.1/mockRef.json", + "triggerTemplatesFolder": "spec_files/api_definitions/mojaloop_connector_backend_2.1/trigger_templates" + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "506", + "path": "sourceAmount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeTransactionId": "{$request.body.homeTransactionId}", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "ABORTED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 7, + "priority": 1, + "description": "FXP - post /fxTransfers response", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeTransactionId": "{$request.body.homeTransactionId}", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 8, + "priority": 1, + "description": "get /parties/{idType}/{idValue}", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{idType}/{idValue}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "dateOfBirth": "1966-06-16", + "displayName": "Chikondi Banda", + "firstName": "Chikondi", + "fspId": "testpayee", + "idType": "MSISDN", + "idValue": "{$request.params.idValue}", + "lastName": "Banda", + "merchantClassificationCode": "1234", + "middleName": "", + "kycInformation": "This is encrypted KYC information" + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 9, + "priority": 1, + "description": "post /quoterequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quoterequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "quoteId": "{$request.body.quoteId}", + "transactionId": "{$request.body.transactionId}", + "transferAmount": "{$request.body.amount}", + "transferAmountCurrency": "{$request.body.currency}" + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 10, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "completedTimestamp": "{$environment.completedTimestamp}", + "homeTransactionId": "123", + "transferState": "COMMITTED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()", + "", + "const requestBody = JSON.parse(request.body)", + "", + "const toPartyId = requestBody.to.idType + '/' + requestBody.to.idValue", + "", + "if (!environment.partyData) {", + " environment.partyData = {}", + "}", + "", + "if (!environment.partyData[toPartyId]) {", + " environment.partyData[toPartyId] = {}", + "}", + "", + "const partyData = environment.partyData[toPartyId]", + "", + "if (!partyData.balance) {", + " partyData.balance = {}", + "}", + "", + "if (!partyData.balance[requestBody.currency]) {", + " partyData.balance[requestBody.currency] = 0", + "}", + "", + "partyData.balance[requestBody.currency] += +requestBody.amount", + "", + "", + "if (!partyData.transactionHistory) {", + " partyData.transactionHistory = []", + "}", + "const creditDate = new Date(request.headers.date)", + "const transaction = {", + " date: creditDate.getTime(),", + " transferId: requestBody.transferId,", + " amount: requestBody.amount,", + " currency: requestBody.currency,", + " from: {", + " idType: requestBody.from.idType,", + " idValue: requestBody.from.idValue", + " }", + "}", + "partyData.transactionHistory.push(transaction)", + "", + "custom.pushMessage({ transaction: transaction, newBalance: partyData.balance , transactionHistory: partyData.transactionHistory }, toPartyId)" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 11, + "priority": 1, + "description": "post /transactionrequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactionrequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeR2PTransactionId": "cba321", + "transactionId": "{$function.generic.generateUUID}", + "transactionRequestState": "RECEIVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const reqBody = JSON.parse(request.body)", + "const outEndpoint = userConfig.CALLBACK_ENDPOINT", + "const outReqBody = {", + " transactionRequestId: reqBody.transactionRequestId,", + " homeR2PTransactionId: 'abc123',", + " from: reqBody.to,", + " to: reqBody.from,", + " amountType: \"RECEIVE\",", + " currency: reqBody.currency,", + " amount: reqBody.amount,", + " scenario: \"DEPOSIT\",", + " initiator: reqBody.initiator,", + " initiatorType: reqBody.initiatorType,", + " note: \"Note sent to Payee.\"", + "}", + "try {", + " const axioResponse = await axios({", + " method: 'post',", + " url: outEndpoint + '/requestToPayTransfer',", + " data: outReqBody", + " });", + " res = axioResponse.data;", + " responseCode = axioResponse.code || axioResponse.status", + "} catch (err) {", + " console.log(err)", + "}", + "" + ], + "scriptingEngine": "javascript" + } + }, + "type": "MOCK_RESPONSE" + }, + "type": "response", + "version": 1 + } +] \ No newline at end of file diff --git a/rules/pm4ml/fxp_response_rules.json b/rules/pm4ml/fxp_response_rules.json deleted file mode 100644 index 14a3a8af..00000000 --- a/rules/pm4ml/fxp_response_rules.json +++ /dev/null @@ -1,547 +0,0 @@ -[ - { - "ruleId": 6, - "priority": 1, - "description": "FXP - post /fxQuotes", - "apiVersion": { - "asynchronous": false, - "majorVersion": 2, - "minorVersion": 1, - "type": "mojaloop_connector_outbound" - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/fxQuotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "params": { - "body": { - "conversionTerms": { - "amountType": "SEND", - "conversionId": "{$request.body.conversionTerms.conversionId}", - "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", - "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", - "expiration": "{$request.body.conversionTerms.expiration}", - "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", - "sourceAmount": { - "currency": "{$request.body.conversionTerms.sourceAmount.currency}" - }, - "targetAmount": { - "currency": "{$request.body.conversionTerms.targetAmount.currency}" - } - }, - "homeTransactionId": "homeTransactionId-123" - }, - "statusCode": "200", - "scripts": { - "exec": [ - "const fxQuoteBody = JSON.parse(request.body)", - "const fxRates = {", - " \"base\": \"USD\",", - " \"date\": \"2023-03-03\",", - " \"rates\": {", - " \"AED\": 3.670595,", - " \"AFN\": 88.881425,", - " \"ALL\": 108.376523,", - " \"AMD\": 390.471399,", - " \"ANG\": 1.804308,", - " \"AOA\": 505.839998,", - " \"ARS\": 197.689779,", - " \"AUD\": 1.48222,", - " \"AWG\": 1.799566,", - " \"AZN\": 1.699337,", - " \"BAM\": 1.842544,", - " \"BBD\": 1.998973,", - " \"BDT\": 107.07517,", - " \"BGN\": 1.843505,", - " \"BHD\": 0.376919,", - " \"BIF\": 2079.526363,", - " \"BMD\": 0.999953,", - " \"BND\": 1.34899,", - " \"BOB\": 6.915241,", - " \"BRL\": 5.198354,", - " \"BSD\": 0.999335,", - " \"BTC\": 0.000044,", - " \"BTN\": 82.647688,", - " \"BWP\": 13.237335,", - " \"BYN\": 2.526074,", - " \"BZD\": 2.01736,", - " \"CAD\": 1.357836,", - " \"CDF\": 2086.44176,", - " \"CHF\": 0.940605,", - " \"CLF\": 0.02963,", - " \"CLP\": 812.200511,", - " \"CNH\": 6.904663,", - " \"CNY\": 6.898567,", - " \"COP\": 4833.056834,", - " \"CRC\": 558.748547,", - " \"CUC\": 0.99935,", - " \"CUP\": 25.728404,", - " \"CVE\": 103.850722,", - " \"CZK\": 22.089353,", - " \"DJF\": 178.175863,", - " \"DKK\": 7.009313,", - " \"DOP\": 55.539156,", - " \"DZD\": 136.526375,", - " \"EGP\": 30.743014,", - " \"ERN\": 14.987908,", - " \"ETB\": 53.840023,", - " \"EUR\": 0.942228,", - " \"FJD\": 2.210902,", - " \"FKP\": 0.83471,", - " \"GBP\": 0.834759,", - " \"GEL\": 2.598071,", - " \"GGP\": 0.834647,", - " \"GHS\": 12.759418,", - " \"GIP\": 0.834672,", - " \"GMD\": 60.98912,", - " \"GNF\": 8615.060299,", - " \"GTQ\": 7.816555,", - " \"GYD\": 211.148725,", - " \"HKD\": 7.843114,", - " \"HNL\": 24.676398,", - " \"HRK\": 7.096534,", - " \"HTG\": 151.107107,", - " \"HUF\": 354.546511,", - " \"IDR\": 15305.816425,", - " \"ILS\": 3.659591,", - " \"IMP\": 0.83482,", - " \"INR\": 82.271752,", - " \"IQD\": 1460.523392,", - " \"IRR\": 42214.667089,", - " \"ISK\": 142.311052,", - " \"JEP\": 0.83532,", - " \"JMD\": 154.109032,", - " \"JOD\": 0.709871,", - " \"JPY\": 136.579884,", - " \"KES\": 127.794041,", - " \"KGS\": 87.345932,", - " \"KHR\": 4067.915978,", - " \"KMF\": 464.562389,", - " \"KPW\": 899.247674,", - " \"KRW\": 1302.190934,", - " \"KWD\": 0.307326,", - " \"KYD\": 0.83405,", - " \"KZT\": 436.101643,", - " \"LAK\": 16873.790213,", - " \"LBP\": 15020.521133,", - " \"LKR\": 345.92388,", - " \"LRD\": 159.117366,", - " \"LSL\": 18.20456,", - " \"LYD\": 4.835853,", - " \"MAD\": 10.388795,", - " \"MDL\": 18.888917,", - " \"MGA\": 4296.352625,", - " \"MKD\": 58.02969,", - " \"MMK\": 2101.470623,", - " \"MNT\": 3404.116439,", - " \"MOP\": 8.091167,", - " \"MRU\": 36.386096,", - " \"MUR\": 46.641155,", - " \"MVR\": 15.347871,", - " \"MWK\": 1027.828846,", - " \"MXN\": 18.098725,", - " \"MYR\": 4.474645,", - " \"MZN\": 63.797698,", - " \"NAD\": 18.214751,", - " \"NGN\": 460.317636,", - " \"NIO\": 36.600644,", - " \"NOK\": 10.424506,", - " \"NPR\": 132.235448,", - " \"NZD\": 1.604879,", - " \"OMR\": 0.385743,", - " \"PAB\": 0.999902,", - " \"PEN\": 3.770718,", - " \"PGK\": 3.527422,", - " \"PHP\": 54.844041,", - " \"PKR\": 278.695386,", - " \"PLN\": 4.423791,", - " \"PYG\": 7220.315472,", - " \"QAR\": 3.651532,", - " \"RON\": 4.637626,", - " \"RSD\": 110.496314,", - " \"RUB\": 75.238572,", - " \"RWF\": 1091.764956,", - " \"SAR\": 3.750399,", - " \"SBD\": 8.239938,", - " \"SCR\": 13.476738,", - " \"SDG\": 590.506115,", - " \"SEK\": 10.481266,", - " \"SGD\": 1.346505,", - " \"SHP\": 0.834776,", - " \"SLL\": 17650.226858,", - " \"SOS\": 568.863447,", - " \"SRD\": 33.904806,", - " \"SSP\": 130.15096,", - " \"STD\": 22804.902808,", - " \"STN\": 23.075404,", - " \"SVC\": 8.756667,", - " \"SYP\": 2510.429835,", - " \"SZL\": 18.20316,", - " \"THB\": 34.771491,", - " \"TJS\": 10.006042,", - " \"TMT\": 3.507758,", - " \"TND\": 3.129616,", - " \"TOP\": 2.355679,", - " \"TRY\": 18.879408,", - " \"TTD\": 6.789468,", - " \"TWD\": 30.624624,", - " \"TZS\": 2330.0501,", - " \"UAH\": 36.958426,", - " \"UGX\": 3718.628848,", - " \"USD\": 1,", - " \"UYU\": 38.884596,", - " \"UZS\": 11371.806807,", - " \"VES\": 24.306068,", - " \"VND\": 23702.143038,", - " \"VUV\": 117.94585,", - " \"WST\": 2.695482,", - " \"XAF\": 617.756757,", - " \"XAG\": 0.047556,", - " \"XAU\": 0.0011,", - " \"XCD\": 2.700451,", - " \"XDR\": 0.751352,", - " \"XOF\": 617.756728,", - " \"XPD\": 0.001709,", - " \"XPF\": 112.382643,", - " \"XPT\": 0.001221,", - " \"YER\": 250.041827,", - " \"ZAR\": 18.172541,", - " \"ZMW\": 19.989716,", - " \"ZWL\": 321.731101", - " }", - "}", - "", - "const sourceCurrency = fxQuoteBody.conversionTerms.sourceAmount?.currency", - "const targetCurrency = fxQuoteBody.conversionTerms.targetAmount?.currency", - "let conversionRate = 1", - "", - "if(sourceCurrency === fxRates.base) {", - " conversionRate = fxRates.rates[targetCurrency]", - "} else {", - " const invertConvRate1 = fxRates.rates[sourceCurrency]", - " const baseConvRate = fxRates.rates[targetCurrency]", - " conversionRate = (baseConvRate / invertConvRate1)", - "}", - "", - "const sourceAmount = fxQuoteBody.conversionTerms.sourceAmount.amount", - "const targetAmount = fxQuoteBody.conversionTerms.targetAmount.amount", - "", - "let newSourceAmount = sourceAmount", - "let newTargetAmount = targetAmount", - "", - "if (!sourceAmount) {", - " newSourceAmount = Math.round(targetAmount / conversionRate)", - "}", - "", - "if (!targetAmount) {", - " newTargetAmount = Math.round(sourceAmount * conversionRate)", - "}", - "", - "const chargesPercent = 2", - "const chargesSourceAmount = Math.round(newSourceAmount * chargesPercent) / 100", - "const chargesTargetAmount = Math.round(newTargetAmount * chargesPercent) / 100", - "", - "custom.appendEventBody({", - " conversionTerms: {", - " sourceAmount: {", - " amount: newSourceAmount + \"\"", - " },", - " targetAmount: {", - " amount: newTargetAmount + \"\"", - " },", - " charges: [", - " {", - " chargeType: \"currency conversion\",", - " sourceAmount: {", - " amount: chargesSourceAmount + \"\",", - " currency: sourceCurrency", - " },", - " targetAmount: {", - " amount: chargesTargetAmount + \"\",", - " currency: targetCurrency", - " }", - " }", - " ]", - " }", - "})" - ], - "scriptingEngine": "javascript" - } - }, - "path": null, - "type": "FIXED_RESPONSE" - }, - "type": "response", - "version": 1 - }, - { - "ruleId": 7, - "priority": 1, - "description": "FXP - post /fxTransfers response", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 2, - "type": "mojaloop_connector_outbound", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/fxTransfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "homeTransactionId": "{$request.body.homeTransactionId}", - "completedTimestamp": "{$environment.completedTimestamp}", - "conversionState": "RESERVED" - }, - "statusCode": "200", - "scripts": { - "exec": [ - "environment.completedTimestamp = new Date().toISOString()" - ], - "scriptingEngine": "javascript" - } - }, - "type": "FIXED_RESPONSE" - }, - "type": "response", - "version": 1 - }, - { - "ruleId": 8, - "priority": 1, - "description": "get /parties/{idType}/{idValue}", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 2, - "type": "mojaloop_connector_outbound", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{idType}/{idValue}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "dateOfBirth": "1966-06-16", - "displayName": "Yaro", - "firstName": "Yaro", - "fspId": "testpayee", - "idType": "MSISDN", - "idValue": "{$request.params.idValue}", - "lastName": "Smith", - "merchantClassificationCode": "1234", - "middleName": "", - "kycInformation": "This is encrypted KYC information" - }, - "statusCode": "200", - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "FIXED_RESPONSE" - }, - "type": "response", - "version": 1 - }, - { - "ruleId": 9, - "priority": 1, - "description": "post /quoterequests", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 2, - "type": "mojaloop_connector_backend", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/quoterequests" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "quoteId": "{$request.body.quoteId}", - "transactionId": "{$request.body.transactionId}", - "transferAmount": "{$request.body.amount}", - "transferAmountCurrency": "{$request.body.currency}" - }, - "statusCode": "200", - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "FIXED_RESPONSE" - }, - "type": "response", - "version": 1 - }, - { - "ruleId": 10, - "priority": 1, - "description": "post /transfers", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 2, - "type": "mojaloop_connector_backend", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "completedTimestamp": "{$environment.completedTimestamp}", - "homeTransactionId": "123", - "transferState": "COMMITTED" - }, - "statusCode": "200", - "scripts": { - "exec": [ - "environment.completedTimestamp = new Date().toISOString()" - ], - "scriptingEngine": "javascript" - } - }, - "type": "FIXED_RESPONSE" - }, - "type": "response", - "version": 1 - }, - { - "ruleId": 11, - "priority": 1, - "description": "post /transactionrequests", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 2, - "type": "mojaloop_connector_backend", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transactionrequests" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "homeR2PTransactionId": "cba321", - "transactionId": "{$function.generic.generateUUID}", - "transactionRequestState": "RECEIVED" - }, - "statusCode": "200", - "scripts": { - "exec": [ - "const reqBody = JSON.parse(request.body)", - "const outEndpoint = userConfig.CALLBACK_ENDPOINT", - "const outReqBody = {", - " transactionRequestId: reqBody.transactionRequestId,", - " homeR2PTransactionId: 'abc123',", - " from: reqBody.to,", - " to: reqBody.from,", - " amountType: \"RECEIVE\",", - " currency: reqBody.currency,", - " amount: reqBody.amount,", - " scenario: \"DEPOSIT\",", - " initiator: reqBody.initiator,", - " initiatorType: reqBody.initiatorType,", - " note: \"Note sent to Payee.\"", - "}", - "try {", - " const axioResponse = await axios({", - " method: 'post',", - " url: outEndpoint + '/requestToPayTransfer',", - " data: outReqBody", - " });", - " res = axioResponse.data;", - " responseCode = axioResponse.code || axioResponse.status", - "} catch (err) {", - " console.log(err)", - "}", - "" - ], - "scriptingEngine": "javascript" - } - }, - "type": "MOCK_RESPONSE" - }, - "type": "response", - "version": 1 - } -] \ No newline at end of file diff --git a/rules/pm4ml/proxy/rules_sync_response/default.json b/rules/pm4ml/proxy/rules_sync_response/default.json new file mode 100644 index 00000000..f2497a19 --- /dev/null +++ b/rules/pm4ml/proxy/rules_sync_response/default.json @@ -0,0 +1,550 @@ +[ + { + "ruleId": 6, + "priority": 1, + "description": "FXP - post /fxQuotes", + "apiVersion": { + "asynchronous": false, + "majorVersion": 2, + "minorVersion": 1, + "type": "mojaloop_connector_outbound" + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "params": { + "body": { + "conversionTerms": { + "amountType": "SEND", + "conversionId": "{$request.body.conversionTerms.conversionId}", + "counterPartyFsp": "{$request.body.conversionTerms.counterPartyFsp}", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "{$request.body.conversionTerms.expiration}", + "initiatingFsp": "{$request.body.conversionTerms.initiatingFsp}", + "sourceAmount": { + "currency": "{$request.body.conversionTerms.sourceAmount.currency}" + }, + "targetAmount": { + "currency": "{$request.body.conversionTerms.targetAmount.currency}" + } + }, + "homeTransactionId": "homeTransactionId-123" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const fxQuoteBody = JSON.parse(request.body)", + "const fxRates = {", + " \"base\": \"USD\",", + " \"date\": \"2023-03-03\",", + " \"rates\": {", + " \"AED\": 3.670595,", + " \"AFN\": 88.881425,", + " \"ALL\": 108.376523,", + " \"AMD\": 390.471399,", + " \"ANG\": 1.804308,", + " \"AOA\": 505.839998,", + " \"ARS\": 197.689779,", + " \"AUD\": 1.48222,", + " \"AWG\": 1.799566,", + " \"AZN\": 1.699337,", + " \"BAM\": 1.842544,", + " \"BBD\": 1.998973,", + " \"BDT\": 107.07517,", + " \"BGN\": 1.843505,", + " \"BHD\": 0.376919,", + " \"BIF\": 2079.526363,", + " \"BMD\": 0.999953,", + " \"BND\": 1.34899,", + " \"BOB\": 6.915241,", + " \"BRL\": 5.198354,", + " \"BSD\": 0.999335,", + " \"BTC\": 0.000044,", + " \"BTN\": 82.647688,", + " \"BWP\": 13.237335,", + " \"BYN\": 2.526074,", + " \"BZD\": 2.01736,", + " \"CAD\": 1.357836,", + " \"CDF\": 2086.44176,", + " \"CHF\": 0.940605,", + " \"CLF\": 0.02963,", + " \"CLP\": 812.200511,", + " \"CNH\": 6.904663,", + " \"CNY\": 6.898567,", + " \"COP\": 4833.056834,", + " \"CRC\": 558.748547,", + " \"CUC\": 0.99935,", + " \"CUP\": 25.728404,", + " \"CVE\": 103.850722,", + " \"CZK\": 22.089353,", + " \"DJF\": 178.175863,", + " \"DKK\": 7.009313,", + " \"DOP\": 55.539156,", + " \"DZD\": 136.526375,", + " \"EGP\": 30.743014,", + " \"ERN\": 14.987908,", + " \"ETB\": 53.840023,", + " \"EUR\": 0.942228,", + " \"FJD\": 2.210902,", + " \"FKP\": 0.83471,", + " \"GBP\": 0.834759,", + " \"GEL\": 2.598071,", + " \"GGP\": 0.834647,", + " \"GHS\": 12.759418,", + " \"GIP\": 0.834672,", + " \"GMD\": 60.98912,", + " \"GNF\": 8615.060299,", + " \"GTQ\": 7.816555,", + " \"GYD\": 211.148725,", + " \"HKD\": 7.843114,", + " \"HNL\": 24.676398,", + " \"HRK\": 7.096534,", + " \"HTG\": 151.107107,", + " \"HUF\": 354.546511,", + " \"IDR\": 15305.816425,", + " \"ILS\": 3.659591,", + " \"IMP\": 0.83482,", + " \"INR\": 82.271752,", + " \"IQD\": 1460.523392,", + " \"IRR\": 42214.667089,", + " \"ISK\": 142.311052,", + " \"JEP\": 0.83532,", + " \"JMD\": 154.109032,", + " \"JOD\": 0.709871,", + " \"JPY\": 136.579884,", + " \"KES\": 127.794041,", + " \"KGS\": 87.345932,", + " \"KHR\": 4067.915978,", + " \"KMF\": 464.562389,", + " \"KPW\": 899.247674,", + " \"KRW\": 1302.190934,", + " \"KWD\": 0.307326,", + " \"KYD\": 0.83405,", + " \"KZT\": 436.101643,", + " \"LAK\": 16873.790213,", + " \"LBP\": 15020.521133,", + " \"LKR\": 345.92388,", + " \"LRD\": 159.117366,", + " \"LSL\": 18.20456,", + " \"LYD\": 4.835853,", + " \"MAD\": 10.388795,", + " \"MDL\": 18.888917,", + " \"MGA\": 4296.352625,", + " \"MKD\": 58.02969,", + " \"MMK\": 2101.470623,", + " \"MNT\": 3404.116439,", + " \"MOP\": 8.091167,", + " \"MRU\": 36.386096,", + " \"MUR\": 46.641155,", + " \"MVR\": 15.347871,", + " \"MWK\": 1027.828846,", + " \"MXN\": 18.098725,", + " \"MYR\": 4.474645,", + " \"MZN\": 63.797698,", + " \"NAD\": 18.214751,", + " \"NGN\": 460.317636,", + " \"NIO\": 36.600644,", + " \"NOK\": 10.424506,", + " \"NPR\": 132.235448,", + " \"NZD\": 1.604879,", + " \"OMR\": 0.385743,", + " \"PAB\": 0.999902,", + " \"PEN\": 3.770718,", + " \"PGK\": 3.527422,", + " \"PHP\": 54.844041,", + " \"PKR\": 278.695386,", + " \"PLN\": 4.423791,", + " \"PYG\": 7220.315472,", + " \"QAR\": 3.651532,", + " \"RON\": 4.637626,", + " \"RSD\": 110.496314,", + " \"RUB\": 75.238572,", + " \"RWF\": 1091.764956,", + " \"SAR\": 3.750399,", + " \"SBD\": 8.239938,", + " \"SCR\": 13.476738,", + " \"SDG\": 590.506115,", + " \"SEK\": 10.481266,", + " \"SGD\": 1.346505,", + " \"SHP\": 0.834776,", + " \"SLL\": 17650.226858,", + " \"SOS\": 568.863447,", + " \"SRD\": 33.904806,", + " \"SSP\": 130.15096,", + " \"STD\": 22804.902808,", + " \"STN\": 23.075404,", + " \"SVC\": 8.756667,", + " \"SYP\": 2510.429835,", + " \"SZL\": 18.20316,", + " \"THB\": 34.771491,", + " \"TJS\": 10.006042,", + " \"TMT\": 3.507758,", + " \"TND\": 3.129616,", + " \"TOP\": 2.355679,", + " \"TRY\": 18.879408,", + " \"TTD\": 6.789468,", + " \"TWD\": 30.624624,", + " \"TZS\": 2330.0501,", + " \"UAH\": 36.958426,", + " \"UGX\": 3718.628848,", + " \"USD\": 1,", + " \"UYU\": 38.884596,", + " \"UZS\": 11371.806807,", + " \"VES\": 24.306068,", + " \"VND\": 23702.143038,", + " \"VUV\": 117.94585,", + " \"WST\": 2.695482,", + " \"XAF\": 617.756757,", + " \"XAG\": 0.047556,", + " \"XAU\": 0.0011,", + " \"XCD\": 2.700451,", + " \"XDR\": 0.751352,", + " \"XOF\": 617.756728,", + " \"XPD\": 0.001709,", + " \"XPF\": 112.382643,", + " \"XPT\": 0.001221,", + " \"YER\": 250.041827,", + " \"ZAR\": 18.172541,", + " \"ZMW\": 19.989716,", + " \"ZWL\": 321.731101", + " }", + "}", + "", + "const sourceCurrency = fxQuoteBody.conversionTerms.sourceAmount?.currency", + "const targetCurrency = fxQuoteBody.conversionTerms.targetAmount?.currency", + "let conversionRate = 1", + "", + "if(sourceCurrency === fxRates.base) {", + " conversionRate = fxRates.rates[targetCurrency]", + "} else {", + " const invertConvRate1 = fxRates.rates[sourceCurrency]", + " const baseConvRate = fxRates.rates[targetCurrency]", + " conversionRate = (baseConvRate / invertConvRate1)", + "}", + "", + "const sourceAmount = fxQuoteBody.conversionTerms.sourceAmount.amount", + "const targetAmount = fxQuoteBody.conversionTerms.targetAmount.amount", + "", + "let newSourceAmount = sourceAmount", + "let newTargetAmount = targetAmount", + "", + "if (!sourceAmount) {", + " newSourceAmount = Math.round(targetAmount / conversionRate)", + "}", + "", + "if (!targetAmount) {", + " newTargetAmount = Math.round(sourceAmount * conversionRate)", + "}", + "", + "const chargesPercent = 2", + "const chargesSourceAmount = Math.round(newSourceAmount * chargesPercent) / 100", + "const chargesTargetAmount = Math.round(newTargetAmount * chargesPercent) / 100", + "", + "custom.appendEventBody({", + " conversionTerms: {", + " sourceAmount: {", + " amount: newSourceAmount + \"\"", + " },", + " targetAmount: {", + " amount: newTargetAmount + \"\"", + " },", + " charges: [", + " {", + " chargeType: \"currency conversion\",", + " sourceAmount: {", + " amount: chargesSourceAmount + \"\",", + " currency: sourceCurrency", + " },", + " targetAmount: {", + " amount: chargesTargetAmount + \"\",", + " currency: targetCurrency", + " }", + " }", + " ]", + " }", + "})" + ], + "scriptingEngine": "javascript" + } + }, + "path": null, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 7, + "priority": 1, + "description": "FXP - post /fxTransfers response", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/fxTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeTransactionId": "{$request.body.homeTransactionId}", + "completedTimestamp": "{$environment.completedTimestamp}", + "conversionState": "RESERVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 8, + "priority": 1, + "description": "get /parties/{idType}/{idValue}", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_outbound", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{idType}/{idValue}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "dateOfBirth": "1966-06-16", + "displayName": "Yaro", + "firstName": "Yaro", + "fspId": "testpayee", + "idType": "MSISDN", + "idValue": "{$request.params.idValue}", + "lastName": "Smith", + "merchantClassificationCode": "1234", + "middleName": "", + "kycInformation": "This is encrypted KYC information", + "supportedCurrencies": [ + "ZMW" + ] + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 9, + "priority": 1, + "description": "post /quoterequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quoterequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "quoteId": "{$request.body.quoteId}", + "transactionId": "{$request.body.transactionId}", + "transferAmount": "{$request.body.amount}", + "transferAmountCurrency": "{$request.body.currency}" + }, + "statusCode": "200", + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 10, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "completedTimestamp": "{$environment.completedTimestamp}", + "homeTransactionId": "123", + "transferState": "COMMITTED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "environment.completedTimestamp = new Date().toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "type": "FIXED_RESPONSE" + }, + "type": "response", + "version": 1 + }, + { + "ruleId": 11, + "priority": 1, + "description": "post /transactionrequests", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 2, + "type": "mojaloop_connector_backend", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactionrequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "homeR2PTransactionId": "cba321", + "transactionId": "{$function.generic.generateUUID}", + "transactionRequestState": "RECEIVED" + }, + "statusCode": "200", + "scripts": { + "exec": [ + "const reqBody = JSON.parse(request.body)", + "const outEndpoint = userConfig.CALLBACK_ENDPOINT", + "const outReqBody = {", + " transactionRequestId: reqBody.transactionRequestId,", + " homeR2PTransactionId: 'abc123',", + " from: reqBody.to,", + " to: reqBody.from,", + " amountType: \"RECEIVE\",", + " currency: reqBody.currency,", + " amount: reqBody.amount,", + " scenario: \"DEPOSIT\",", + " initiator: reqBody.initiator,", + " initiatorType: reqBody.initiatorType,", + " note: \"Note sent to Payee.\"", + "}", + "try {", + " const axioResponse = await axios({", + " method: 'post',", + " url: outEndpoint + '/requestToPayTransfer',", + " data: outReqBody", + " });", + " res = axioResponse.data;", + " responseCode = axioResponse.code || axioResponse.status", + "} catch (err) {", + " console.log(err)", + "}", + "" + ], + "scriptingEngine": "javascript" + } + }, + "type": "MOCK_RESPONSE" + }, + "type": "response", + "version": 1 + } +] \ No newline at end of file