Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Onboarding
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
3lisvequii
Onboarding
Commits
99346f3c
Verified
Commit
99346f3c
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Separate payment details and do payments view
parent
96a3105e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/tezor/models/invoice.py
+2
-2
2 additions, 2 deletions
aleksis/apps/tezor/models/invoice.py
aleksis/apps/tezor/urls.py
+1
-1
1 addition, 1 deletion
aleksis/apps/tezor/urls.py
aleksis/apps/tezor/views.py
+6
-2
6 additions, 2 deletions
aleksis/apps/tezor/views.py
with
9 additions
and
5 deletions
aleksis/apps/tezor/models/invoice.py
+
2
−
2
View file @
99346f3c
...
...
@@ -80,7 +80,7 @@ class Invoice(BasePayment, PureDjangoModel):
return
TotalsTable
(
values
)
def
get_success_url
(
self
):
return
reverse
(
"
payment_details
"
,
kwargs
=
{
"
token
"
:
self
.
token
})
return
reverse
(
"
invoice_by_pk
"
,
kwargs
=
{
"
pk
"
:
self
.
pk
})
def
get_failure_url
(
self
):
return
reverse
(
"
payment_details
"
,
kwargs
=
{
"
token
"
:
self
.
token
})
return
reverse
(
"
invoice_by_pk
"
,
kwargs
=
{
"
pk
"
:
self
.
pk
})
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/urls.py
+
1
−
1
View file @
99346f3c
...
...
@@ -5,7 +5,7 @@ from . import views
urlpatterns
=
[
path
(
"
payments/
"
,
include
(
"
payments.urls
"
)),
path
(
"
invoice/<int:pk>/print
"
,
views
.
GetInvoicePDF
.
as_view
(),
name
=
"
get_invoice_by_pk
"
),
path
(
"
invoice/<str:token>/payment
"
,
views
.
payment
_details
,
name
=
"
payment
_details
"
),
path
(
"
invoice/<str:token>/payment
"
,
views
.
do_
payment
,
name
=
"
do_
payment
"
),
path
(
"
clients/list
"
,
views
.
ClientListView
.
as_view
(),
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/views.py
+
6
−
2
View file @
99346f3c
...
...
@@ -6,7 +6,7 @@ from django.urls import reverse, reverse_lazy
from
django.utils.decorators
import
method_decorator
from
django.utils.translation
import
ugettext
as
_
from
payments
import
get_payment_model
,
RedirectNeeded
from
payments
import
get_payment_model
,
PaymentStatus
,
RedirectNeeded
from
rules.contrib.views
import
PermissionRequiredMixin
from
django_tables2.views
import
SingleTableView
,
RequestConfig
...
...
@@ -32,9 +32,13 @@ class GetInvoicePDF(PermissionRequiredMixin, RenderPDFView):
print
(
invoice
.
group
.
__dict__
)
return
context
def
payment_details
(
request
,
token
):
def
do_payment
(
request
,
token
):
payment
=
get_object_or_404
(
get_payment_model
(),
token
=
token
)
if
payment
.
status
not
in
[
PaymentStatus
.
WAITING
,
PaymentStatus
.
INPUT
,
PaymentStatus
.
REJECTED
]:
return
redirect
(
payment
.
get_success_url
())
try
:
form
=
payment
.
get_form
(
data
=
request
.
POST
or
None
)
except
RedirectNeeded
as
redirect_to
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment