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

Add form to configure payment gateways in dashboard #4807

Merged
merged 34 commits into from
Oct 11, 2019

Conversation

szewczykmira
Copy link
Contributor

@szewczykmira szewczykmira commented Oct 4, 2019

Right now there is no option to set payments data in dashboard 1.0 In this pull request I've added a section in the dashboard with listed all available payment gateways in settings.PLUGINS and option to configure them.
From developers side I've created model form for Plugin Configuration with dynamic fields created from CONFIGURATION_STRUCTURE.

Closes #4784

Screenshots

New views introduced:
Zrzut ekranu 2019-10-4 o 15 29 04
Zrzut ekranu 2019-10-4 o 15 30 21

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. Database migration files are up to date.
  6. The changes are tested.
  7. GraphQL schema and type definitions are up to date.
  8. Changes are mentioned in the changelog.

Copy link

django-queries commented Oct 4, 2019

Here is the report for ea1e79b (mirumee/saleor @ fix/payment-configuration)
Base comparison is c0fd7c6.

No differences were found. (click me)

# api.benchmark checkout
  test name                                  	left count 	right count	duplicate count
  -------------------------------------------	-----------	-----------	---------------
  add billing address to checkout            	         34	         34	             20
  add shipping to checkout                   	          7	          7	              0
  checkout payment charge                    	         14	         14	              0
  complete checkout                          	          6	          6	              0
  create checkout                            	         48	         48	             24

# api.benchmark homepage
  test name                                  	left count 	right count	duplicate count
  -------------------------------------------	-----------	-----------	---------------
  retrieve main menu                         	          5	          5	              0
  retrieve product list                      	          4	          4	              0
  retrieve secondary menu                    	          5	          5	              0
  retrieve shop                              	          2	          2	              0

# api.benchmark product
  test name                                  	left count 	right count	duplicate count
  -------------------------------------------	-----------	-----------	---------------
  product details                            	         15	         15	              3
  retrieve product attributes                	         13	         13	              2

# api.benchmark variant
  test name                                  	left count 	right count	duplicate count
  -------------------------------------------	-----------	-----------	---------------
  retrieve variant list                      	         18	         18	              8

# api product sorting attributes
  test name                                  	left count 	right count	duplicate count
  -------------------------------------------	-----------	-----------	---------------
  sort product not having attribute data     	         21	         21	              0

@codecov
Copy link

codecov bot commented Oct 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@d3c8757). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4807   +/-   ##
=========================================
  Coverage          ?   91.49%           
=========================================
  Files             ?      347           
  Lines             ?    20709           
  Branches          ?     1963           
=========================================
  Hits              ?    18947           
  Misses            ?     1222           
  Partials          ?      540
Impacted Files Coverage Δ
saleor/core/payments.py 65.78% <100%> (ø)
saleor/dashboard/urls.py 100% <100%> (ø)
saleor/dashboard/payment/forms.py 100% <100%> (ø)
saleor/dashboard/payment/views.py 100% <100%> (ø)
saleor/extensions/manager.py 89.89% <100%> (ø)
saleor/dashboard/forms.py 85.38% <100%> (ø)
saleor/dashboard/payment/urls.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3c8757...1e0437b. Read the comment docs.

saleor/dashboard/payment/forms.py Outdated Show resolved Hide resolved
saleor/dashboard/payment/forms.py Outdated Show resolved Hide resolved
saleor/dashboard/payment/forms.py Outdated Show resolved Hide resolved
saleor/dashboard/payment/views.py Outdated Show resolved Hide resolved
saleor/dashboard/payment/views.py Outdated Show resolved Hide resolved
tests/dashboard/test_payment_form.py Outdated Show resolved Hide resolved
@szewczykmira
Copy link
Contributor Author

@korycins Could you re-review?

saleor/extensions/manager.py Outdated Show resolved Hide resolved
tests/dashboard/test_permissions.py Show resolved Hide resolved
saleor/dashboard/payment/forms.py Outdated Show resolved Hide resolved
@maarcingebala maarcingebala merged commit a3b5c7d into master Oct 11, 2019
@maarcingebala maarcingebala deleted the fix/payment-configuration branch October 11, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add configuration of payments gateway to dashboard 1.0
5 participants