diff --git a/myproject/myapp/payments.py b/myproject/myapp/payments.py index db835be0adf89b58a6c2639da01a74b488e4477f..65a36827e99d129aa7b961a9fb97e9d848aa40df 100644 --- a/myproject/myapp/payments.py +++ b/myproject/myapp/payments.py @@ -46,7 +46,6 @@ def create_payment(request): }] }) - # Successfully communicated with API if payment.create(): print("Payment created successfully!") @@ -99,7 +98,7 @@ def execute_payment(request): #TODO: Change this to a more appropriate error message print("exiting at the end of execute_payment()") return redirect('handler404') - + def payment_cancelled(request): return render(request, 'payment_cancelled.html') diff --git a/myproject/myapp/urls.py b/myproject/myapp/urls.py index a53b69c7201bf7f2b8c4eb008a1616865c7da36b..f7c169ca586946c0e567e5743886c6cf0d40c6c3 100644 --- a/myproject/myapp/urls.py +++ b/myproject/myapp/urls.py @@ -1,6 +1,4 @@ from django.urls import path - - from .views import InstrumentDetectionView, index, users, maintenance, handler404, handler500, terms_conditions, privacy_policy, handling_music_file, pricing, generate_pdf, admin_table from .payments import create_payment, execute_payment, payment_cancelled, payment_success from django.contrib.auth import views as auth_views @@ -29,7 +27,11 @@ urlpatterns = [ path('password_change/', auth_views.PasswordChangeView.as_view(template_name='password_change_form.html'), name='password_change'), path('password_change/done/', auth_views.PasswordChangeDoneView.as_view(template_name='password_change_done.html'), name='password_change_done'), # path('user_logout/', auth_views.LogoutView.as_view(next_page='index'), name='user_logout'), - + path('payment/create/', create_payment, name='create_payment'), + path('payment/execute/', execute_payment, name='execute_payment'), + path('payment/cancel/', payment_cancelled, name='payment_cancelled'), + path('payment_success/', payment_success, name='success'), + # Authentication path('login/', CustomLoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'),