Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

SDK-Scheme-Adapter is not returning Party Sub-Id #2574

Closed
mdebarros opened this issue Nov 9, 2021 · 2 comments
Closed

SDK-Scheme-Adapter is not returning Party Sub-Id #2574

mdebarros opened this issue Nov 9, 2021 · 2 comments
Assignees
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
Milestone

Comments

@mdebarros
Copy link
Member

Summary:
The p2p_money_transfer - p2p_happy_path with subID test-case on the Golden-Path collection fails as the get /parties/{Type}/{ID}/{SubId} assertion fails due to the SubId not being returned in the callback.

Captured Raw HTTP traffic from the SDK-Scheme-Adapter

SDK receiving GET:
T 2021/11/09 14:37:24.190065 10.42.4.191:57256 -> 10.42.4.189:4000 [AP] #2418
  GET /parties/MSISDN/27713803912/30 HTTP/1.1..x-request-id: 4327306d6115f4a25ba8082c4b6ed18a..x-real-ip: 10.1.2.119..x-forwarded-for: 10.1.2.119..x-forwarded-host: account-lookup.moj
  a2.test.mojaloop.live..x-forwarded-port: 80..x-forwarded-proto: http..x-scheme: http..date: Tue, 09 Nov 2021 13:34:04 GMT..fspiop-source: testingtoolkitdfsp..authorization: {$inputs
  .TTK_BEARER_TOKEN}..traceparent: 00-aabbb30ca88d7d0ded99b88cdd8750b1-47e507d5d819b7a6-30..user-agent: axios/0.21.1..cache-control: no-cache..postman-token: f27f6609-db1c-49f3-836b-2
  272a39fa893..accept-encoding: gzip, deflate, br..traceid: 34ee3373-1e59-40bf-9a4a-745aface4400..fspiop-destination: mojapayeefsp..tracestate: mojaloop=eyJzcGFuSWQiOiI0N2U1MDdkNWQ4MT
  liN2E2In0=..Accept: application/vnd.interoperability.parties+json;version=1.0..Content-Type: application/vnd.interoperability.parties+json;version=1.0..Host: moja2-sim-mojapayeefsp-
  scheme-adapter:4000..Connection: close....

T 2021/11/09 14:37:24.192322 10.42.4.189:4000 -> 10.42.4.191:57256 [AP] #2426
  HTTP/1.1 202 Accepted..Content-Type: text/plain; charset=utf-8..Content-Length: 0..Date: Tue, 09 Nov 2021 14:37:24 GMT..Connection: close....

Simulator receiving GET:
T 2021/11/09 14:37:24.193132 10.42.4.189:35272 -> 10.43.152.184:3000 [AP] #2433
  GET /parties/MSISDN/27713803912/30 HTTP/1.1..Content-Type: application/json..Accept: application/json..Date: Tue, 09 Nov 2021 14:37:24 GMT..Host: moja2-sim-mojapayeefsp-backend:3000
  ..Connection: keep-alive....

Simulator responding to GET:
T 2021/11/09 14:37:24.245141 10.43.152.184:3000 -> 10.42.4.189:35272 [AP] #2437
  HTTP/1.1 200 OK..Content-Type: application/json; charset=utf-8..Content-Length: 175..Date: Tue, 09 Nov 2021 14:37:24 GMT..Connection: keep-alive....{"displayName":"Test PayeeFSP","f
  irstName":"Test","middleName":"Test","lastName":"Test","dateOfBirth":"1984-01-01","idType":"MSISDN","idValue":"27713803912","subIdValue":"30"} <-- SUB-ID returned

SDK responding to GET with a PUT callback:
T 2021/11/09 14:37:24.279175 10.42.4.189:37004 -> 10.1.2.171:80 [AP] #2452
  PUT /parties/MSISDN/27713803912/30 HTTP/1.1..content-type: application/vnd.interoperability.parties+json;version=1.0..date: Tue, 09 Nov 2021 14:37:24 GMT..fspiop-source: mojapayeefs
  p..fspiop-destination: testingtoolkitdfsp..fspiop-http-method: PUT..fspiop-uri: /parties/MSISDN/27713803912/30..fspiop-signature: {"signature":"gdkSNvFJPfvbuAmG_PZala1r5VEcBvFPkH2r1
6V8b6B_RbuGwiFp3NAkHkd4vcJcxN9OeaekuAaCwJyhl8RaECWjclOgn98HlUz7jncveqLk3KzCCShpVx5bnyiTjIa8m0ugMVX2I1Ukylehr4kmBV1a3gfNsiDTNzKQBqjYU1afhs0uXJJmoOEEmnF9vW-AGj687xpIA3J6ViJg8q6QJTbTVA
  wNoENgkItCicvX9HqQ65aPHeQSwjQtFjJ5T3CKi9fJvwGmcIvEV62Or7U-L3WFUpNz3gl6YFzE4emnPbZCVWNtoZm0qCWpKVMTiQfi4x-ASvA3sjBtl9c2rJtzbw","protectedHeader":"eyJhbGciOiJSUzI1NiIsIkZTUElPUC1VUkki
OiIvcGFydGllcy9NU0lTRE4vMjc3MTM4MDM5MTIvMzAiLCJGU1BJT1AtSFRUUC1NZXRob2QiOiJQVVQiLCJGU1BJT1AtU291cmNlIjoibW9qYXBheWVlZnNwIiwiRlNQSU9QLURlc3RpbmF0aW9uIjoidGVzdGluZ3Rvb2xraXRkZnNwIiwiR
  GF0ZSI6IlR1ZSwgMDkgTm92IDIwMjEgMTQ6Mzc6MjQgR01UIn0"}..content-length: 245..Host: account-lookup.moja2.test.mojaloop.live..Connection: close....{"party":{"partyIdInfo":{"partyIdType"
  :"MSISDN","partyIdentifier":"27713803912","fspId":"mojapayeefsp"},"personalInfo":{"complexName":{"firstName":"Test","middleName":"Test","lastName":"Test"},"dateOfBirth":"1984-01-01"
  },"name":"Test PayeeFSP"}} <-- MISSING SUB-ID

The simulator is returning the SubId as per the above log, but the SDK is not including it in the PUT Callback to the switch.

Severity:
Medium

Priority:
Medium

Expected Behavior

The SDK should send the callback with the missing SubId ( "partySubIdOrType": "30"):

PUT /parties/MSISDN/27713803912/30 HTTP/1.1..content-type: application/vnd.interoperability.parties+json;version=1.0..date: Tue, 09 Nov 2021 14:37:24 GMT..fspiop-source: mojapayeefs
  p..fspiop-destination: testingtoolkitdfsp..fspiop-http-method: PUT..fspiop-uri: /parties/MSISDN/27713803912/30..fspiop-signature: {"signature":"gdkSNvFJPfvbuAmG_PZala1r5VEcBvFPkH2r1
6V8b6B_RbuGwiFp3NAkHkd4vcJcxN9OeaekuAaCwJyhl8RaECWjclOgn98HlUz7jncveqLk3KzCCShpVx5bnyiTjIa8m0ugMVX2I1Ukylehr4kmBV1a3gfNsiDTNzKQBqjYU1afhs0uXJJmoOEEmnF9vW-AGj687xpIA3J6ViJg8q6QJTbTVA
  wNoENgkItCicvX9HqQ65aPHeQSwjQtFjJ5T3CKi9fJvwGmcIvEV62Or7U-L3WFUpNz3gl6YFzE4emnPbZCVWNtoZm0qCWpKVMTiQfi4x-ASvA3sjBtl9c2rJtzbw","protectedHeader":"eyJhbGciOiJSUzI1NiIsIkZTUElPUC1VUkki
OiIvcGFydGllcy9NU0lTRE4vMjc3MTM4MDM5MTIvMzAiLCJGU1BJT1AtSFRUUC1NZXRob2QiOiJQVVQiLCJGU1BJT1AtU291cmNlIjoibW9qYXBheWVlZnNwIiwiRlNQSU9QLURlc3RpbmF0aW9uIjoidGVzdGluZ3Rvb2xraXRkZnNwIiwiR
  GF0ZSI6IlR1ZSwgMDkgTm92IDIwMjEgMTQ6Mzc6MjQgR01UIn0"}..content-length: 245..Host: account-lookup.moja2.test.mojaloop.live..Connection: close....{"party":{"partyIdInfo":{"partyIdType"
  :"MSISDN","partyIdentifier":"27713803912","fspId":"mojapayeefsp","partySubIdOrType": "30"},"personalInfo":{"complexName":{"firstName":"Test","middleName":"Test","lastName":"Test"},"dateOfBirth":"1984-01-01"
  },"name":"Test PayeeFSP"}}

Steps to Reproduce

  1. Run GP tests with Mojaloop Helm release v13.1.0 WIP Release
  2. Test-case ``p2p_money_transfer - p2p_happy_path with subIDwill fail assertionCallback partyIdInfo (partyIdType, partyIdentifier)` due to the missing SubId

Specifications

  • Component (if known): SDK-Scheme-Adapter
  • Version: v11.18.8
  • Platform: Helm v13.1.0 WIP Release
  • Subsystem: TTK
  • Type of testing: Golden Path
  • Bug found/raised by: @mdebarros

Notes:

  • Severity when opened:
  • Priority when opened:
@mdebarros mdebarros added bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it labels Nov 9, 2021
@mdebarros
Copy link
Member Author

mdebarros commented Nov 9, 2021

Mojaloop-Simulators are not aligned to the Backend API Specification.

https://github.com/mojaloop/mojaloop-simulator/search?q=subIdValue <-- One can see that it is using the subIdValue instead of idSubValue. Thanks to @kleyow for the insight.

Specifically, the place where the incorrect mapping occurs on the Mojaloop-Simulators: https://github.com/mojaloop/mojaloop-simulator/blob/823d4a2399dbffa834e8f285aa800f260a5669a2/src/models/party.js#L78

Issue introduced with PISP changes: https://github.com/mojaloop/mojaloop-simulator/pull/115/files#diff-0d62261745b66669c1a496129be5b70d8039e9bd09f0d561396a1c64d4c60f0eR78

@elnyry-sam-k
Copy link
Member

Thanks for the analysis Miguel @mdebarros ..

@mdebarros mdebarros self-assigned this Nov 10, 2021
mdebarros added a commit to mdebarros/mojaloop-simulator that referenced this issue Nov 10, 2021
- fix for mojaloop/project#2574
- re-factored party model to break up the DB logic into discrete functions
- re-worked to correctly handle accounts
- added correct index'ing for the accounts table
- `subIdValue` has been replaced with `idSubValue` to be consistent with the DFSP API, note the Database will continue to use `subIdValue` to be backward compatible
- updated eslint to ignore some un-pragmatic rules
mdebarros added a commit to mojaloop/mojaloop-simulator that referenced this issue Nov 11, 2021
…#120)

 fix(mojaloop/#2574): sdk-scheme-adapter is not returning party sub-id:
    - fix for mojaloop/project#2574
    - re-factored party model to break up the DB logic into discrete functions
    - re-worked to correctly handle accounts
    - added correct index'ing for the accounts table
    - `subIdValue` has been replaced with `idSubValue` to be consistent with the DFSP API, note the Database will continue to use `subIdValue` to be backward compatible
    - updated eslint to ignore some un-pragmatic rules

fix(mojaloop/#2575): mojaloop-simulator rules are not executing as expected
    - updated unit tests to cover issues for mojaloop/project#2575
    - issue is caused by an update to the [json-rules-engine](https://github.com/CacheControl/json-rules-engine). The path defined in rules must now start with "$" (e.g. `$.<attribute>`), previously `.<attribute>` would work but no longer functional due to the dependency being updated
    - updated example rule paths with the missing `$` prefix

chore: updating dependencies
    - updated dependencies
    - added node-fetch & eslint to ncurc ignore list due to a breaking change due to node version incomptability
    - fixed audit-resolve issues
    - fixed some typos/spacing/lines in readme
mdebarros added a commit to mojaloop/testing-toolkit-test-cases that referenced this issue Nov 12, 2021
- updated unit tests p2p_happy_path_subid to resolve this issue: mojaloop/project#2574
- Mojaloop-Simulator DFSP API incorrectly set the subIdValue instead of the idSubValue when creating the Party
@elnyry-sam-k elnyry-sam-k added this to the Sprint 16.1 milestone Nov 18, 2021
mdebarros added a commit to mojaloop/testing-toolkit-test-cases that referenced this issue Dec 14, 2021
- fix: fspiop api version negotiation not handled
    - Updates for Transfer Service: mojaloop/project#2536
- fix(mojaloop/#2574): sdk-scheme-adapter is not returning party sub-id
    - updated unit tests p2p_happy_path_subid to resolve this issue: mojaloop/project#2574
    - Mojaloop-Simulator DFSP API incorrectly set the subIdValue instead of the idSubValue when creating the Party
- feat: update GP tests to use v1.1 by default and v1.0 only for specific test cases #2530 - mojaloop/project#2530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
Projects
None yet
Development

No branches or pull requests

2 participants