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

✨ New pay with payment-method implementation #5017

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Nov 11, 2023

What do these changes do?

Reimplements "pay with payment-method" since app-motion changed the design from Init-Prompt-Ack worfklow to a direct http request-response. SEE all changes of openapi-specs in https://github.com/ITISFoundation/appmotion-exchange/issues/12

  • webserver:
    • ✨ keeps the same interface for POST /wallets/{w_id}/payments-method/{pm_id}:pay but changes implementation
      • ack notification done as a fire&forget
    • ✨ new pay_with_payment_method on rpc
  • payments:
    • 🎨 changes in PaymentMethodGet model. Needed to remove some info from the front-end
    • ✨ new pay_with_payment_method on rpc and gateway interfaces
    • improves tests against external (specifically app-motion's gateway service)
    • 🐛 fixes and changes in openapi specs for gateway and ack APIs (upon agreement with app-motion)
      - AckPayment.provider_payment_id to keep stripe payment identifier
      - AckPaymentWithPaymentMethod.payment_id
    • 🎨 gateway error handling
  • 🔨 useful extensions for openapi specs and makefile

Related issue/s

How to test

Driving tests are

cd services/web/server
make install-dev
pytest -vv -k test_one_time_payment_with_payment_method tests/unit

and

cd services/payments
make install-dev
pytest -vv -k test_webserver_pay_with_payment_method_workflow tests/unit

Dev Checklist

DevOps

None

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

Merging #5017 (c698c6b) into master (633ec55) will increase coverage by 0.0%.
The diff coverage is 96.1%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #5017   +/-   ##
======================================
  Coverage    87.2%   87.2%           
======================================
  Files        1252    1252           
  Lines       51339   51418   +79     
  Branches     1107    1107           
======================================
+ Hits        44790   44869   +79     
  Misses       6310    6310           
  Partials      239     239           
Flag Coverage Δ
integrationtests 64.9% <27.0%> (-0.1%) ⬇️
unittests 85.0% <96.1%> (+<0.1%) ⬆️

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

Files Coverage Δ
...rc/models_library/api_schemas_webserver/wallets.py 100.0% <100.0%> (ø)
...simcore_service_payments/api/rest/_dependencies.py 100.0% <100.0%> (ø)
...core_service_payments/api/rpc/_payments_methods.py 100.0% <100.0%> (ø)
..._service_payments/db/payments_transactions_repo.py 84.2% <ø> (ø)
...payments/src/simcore_service_payments/models/db.py 100.0% <100.0%> (ø)
...imcore_service_payments/models/payments_gateway.py 100.0% <100.0%> (ø)
...ervice_payments/models/schemas/acknowledgements.py 94.2% <100.0%> (+1.4%) ⬆️
...ments/src/simcore_service_payments/models/utils.py 100.0% <ø> (ø)
.../src/simcore_service_payments/services/payments.py 61.9% <100.0%> (+6.3%) ⬆️
.../src/simcore_service_payments/services/postgres.py 100.0% <100.0%> (ø)
... and 6 more

... and 2 files with indirect coverage changes

@pcrespov pcrespov self-assigned this Nov 11, 2023
@pcrespov pcrespov added a:webserver issue related to the webserver service a:payments payments service labels Nov 11, 2023
@pcrespov pcrespov added this to the 7peaks milestone Nov 11, 2023
@pcrespov pcrespov force-pushed the is4657/new-pay-w-payment-method branch 5 times, most recently from 5607864 to 3a5cfbd Compare November 15, 2023 10:38
@pcrespov pcrespov changed the title WIP: ✨ Is4657/new pay w payment method ✨ New pay-with-payment method implementation Nov 15, 2023
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.

looking good!

Copy link

codeclimate bot commented Nov 16, 2023

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

View more on Code Climate.

Copy link

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
0.6% 0.6% Duplication

@pcrespov pcrespov added the a:frontend issue affecting the front-end (area group) label Nov 16, 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.

Thanks! I will adjust my PR to this one. I have just one question regarding the retry statement.

@GitHK GitHK changed the title ✨ New pay-with-payment method implementation ✨ New pay with-payment method implementation Nov 16, 2023
@GitHK GitHK changed the title ✨ New pay with-payment method implementation ✨ New pay with payment-method implementation Nov 16, 2023
@pcrespov pcrespov disabled auto-merge November 16, 2023 08:59
@pcrespov pcrespov merged commit 5477e3d into ITISFoundation:master Nov 16, 2023
55 checks passed
@pcrespov pcrespov deleted the is4657/new-pay-w-payment-method branch November 16, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:frontend issue affecting the front-end (area group) 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