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

✨ webserver: payments-method RCP client and new one-time payments with payment-method #4979

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Nov 5, 2023

What do these changes do?

This PR completes the last connection missing between the webserver/payments plugin and the payments service.
It adds the client-side of RPC API for payments-methods and mplements entrypoint for one-time-payment using given payment-method

  • ✨ adds client methods for the api/rpc/_payment_methods API in the payments service
  • services/webserver api version: 0.36.0 → 0.37.0:
    • exposes init_payment_with_payment_method: implements one-time payment using stored payment-method
    • New openapi.json specs
    • front-end:
      • resource payWithPaymentMethod
      • @ignapas @jsaq007 I need some help to double check that it is correctly connected/used.
  • ♻️ ⚗️ Note that fake payment completion in the web-server (via PAYMENTS_FAKE_*) is still available until payment-gateway dev service is available. This code is also reused to fake the payments RPC api for testing. SEE services/web/server/tests/unit/with_dbs/03/wallets/payments/conftest.py::mock_rpc_payments_service_api
  • ♻️ tests fixtures for with_dbs/03/wallets/payments

Related issue/s

How to test

  • Driving tests:
cd services/web/server
make install-dev
pytest -vv -k test_one_time_payment_with_payment_method tests/units

DevOps

Reminder, please ensure that

  • master deploy PAYMENTS_FAKE_COMPLETION=1
  • elsewhere PAYMENTS_FAKE_COMPLETION=0

@pcrespov pcrespov self-assigned this Nov 5, 2023
@pcrespov pcrespov marked this pull request as draft November 5, 2023 11:46
@pcrespov pcrespov added this to the 7peaks milestone Nov 5, 2023
@pcrespov pcrespov added a:webserver issue related to the webserver service a:api framework api, data schemas, a:payments payments service labels Nov 5, 2023
Copy link

codecov bot commented Nov 5, 2023

Codecov Report

Merging #4979 (634f447) into master (73c5414) will increase coverage by 2.7%.
The diff coverage is 78.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4979      +/-   ##
=========================================
+ Coverage    78.7%   81.4%    +2.7%     
=========================================
  Files        1113     619     -494     
  Lines       46226   29731   -16495     
  Branches      722     195     -527     
=========================================
- Hits        36403   24222   -12181     
+ Misses       9664    5460    -4204     
+ Partials      159      49     -110     
Flag Coverage Δ
integrationtests 63.5% <37.8%> (-1.7%) ⬇️
unittests 86.2% <78.5%> (+9.3%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...core_service_payments/api/rpc/_payments_methods.py 100.0% <ø> (ø)
...core_service_payments/services/payments_methods.py 91.8% <ø> (ø)
...re_service_webserver/wallets/_payments_handlers.py 98.5% <96.2%> (+39.2%) ⬆️
...simcore_service_webserver/payments/_onetime_api.py 97.6% <92.8%> (+56.9%) ⬆️
...simcore_service_webserver/payments/_methods_api.py 95.4% <89.5%> (+57.0%) ⬆️
...ver/src/simcore_service_webserver/payments/_rpc.py 58.2% <40.5%> (-4.3%) ⬇️

... and 724 files with indirect coverage changes

@pcrespov pcrespov changed the title WIP: ✨ Is4751/payment methods connect WIP: ✨ webserver: connects payment-methods with payments service rcp api and exposes one-time payments with payment-method Nov 5, 2023
@pcrespov pcrespov changed the title WIP: ✨ webserver: connects payment-methods with payments service rcp api and exposes one-time payments with payment-method WIP: ✨ webserver: connects payment-methods with payments service's rcp api and exposes one-time payments with payment-method Nov 5, 2023
@pcrespov pcrespov changed the title WIP: ✨ webserver: connects payment-methods with payments service's rcp api and exposes one-time payments with payment-method WIP: ✨ webserver payment-methods API: connects with payments service's rcp api and exposes one-time payments with payment-method Nov 5, 2023
@pcrespov pcrespov changed the title WIP: ✨ webserver payment-methods API: connects with payments service's rcp api and exposes one-time payments with payment-method WIP: ✨ webserver payments: payments-method RCP client and adds one-time payments with payment-method Nov 5, 2023
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good thanks 👍 (I would like to catch up sometimes in person about RPC methods and how/when to use them) Thanks!

@pcrespov pcrespov marked this pull request as ready for review November 5, 2023 18:56
@pcrespov pcrespov changed the title WIP: ✨ webserver payments: payments-method RCP client and adds one-time payments with payment-method ✨ webserver: payments-method RCP client and new one-time payments with payment-method Nov 5, 2023
@pcrespov pcrespov enabled auto-merge (squash) November 5, 2023 18:57
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check code climate warnings. you have some assertions without #nosec

@pcrespov
Copy link
Member Author

pcrespov commented Nov 6, 2023

Please check code climate warnings. you have some assertions without #nosec

That was before. Those comments are fixed.

Copy link

codeclimate bot commented Nov 6, 2023

Code Climate has analyzed commit 634f447 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

sonarcloud bot commented Nov 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.9% 2.9% Duplication

@pcrespov pcrespov merged commit 99c1763 into ITISFoundation:master Nov 6, 2023
55 checks passed
@pcrespov pcrespov deleted the is4751/payment-methods-connect branch November 6, 2023 13:08
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Nov 23, 2023
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:payments payments service a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants