Skip to content

Commit

Permalink
Change checkout url
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Sep 17, 2023
1 parent 6c769f6 commit d265b6d
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion booking/tests/test_checkout_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StripeCheckoutTests(TestSetupMixin, TestCase):
def setUpTestData(cls):
super().setUpTestData()
baker.make(Seller, site=Site.objects.get_current())
cls.url = reverse('booking:stripe_checkout')
cls.url = reverse('stripe_checkout')

def setUp(self):
super().setUp()
Expand Down
6 changes: 1 addition & 5 deletions booking/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
submit_zero_booking_payment, update_shopping_basket_count, \
toggle_waiting_list, \
OnlineTutorialListView, PurchasedTutorialsListView, OnlineTutorialDetailView, \
stripe_checkout, check_total
check_total

app_name = 'booking'

Expand Down Expand Up @@ -120,10 +120,6 @@
'bookings/shopping-basket/', shopping_basket,
name='shopping_basket'
),
path(
'bookings/shopping-basket/checkout', stripe_checkout,
name='stripe_checkout'
),
path(
'bookings/shopping-basket/submit-block/', submit_zero_block_payment,
name='submit_zero_block_payment'
Expand Down
2 changes: 2 additions & 0 deletions pipsevents/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from accounts.views import custom_email_view, CustomLoginView, \
DisclaimerCreateView, data_privacy_policy, cookie_policy, subscribe_view, \
NonRegisteredDisclaimerCreateView, nonregistered_disclaimer_submitted
from booking.views import stripe_checkout

urlpatterns = [
path('admin/', admin.site.urls),
Expand Down Expand Up @@ -40,6 +41,7 @@
path('payments/ipn-paypal-notify/', include('paypal.standard.ipn.urls')),
path('payments/', include('payments.urls')),
path('stripe/', include('stripe_payments.urls')),
path('checkout/', stripe_checkout, name='stripe_checkout'),
path('favicon.ico/',
RedirectView.as_view(url=settings.STATIC_URL+'favicon.ico',
permanent=False)),
Expand Down
2 changes: 1 addition & 1 deletion templates/booking/create_ticket_booking.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h5>Ticket # {{ ticketform.index }}</h5>
<div>Click below to be transferred to PayPal to make your payment.</div>
{% include 'payments/payment.html' %}</br>
{% elif ticketed_event.payment_open and payment_method == "stripe" %}
<form method="post" action="{% url 'booking:stripe_checkout' %}">
<form method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_ticket_booking_ref" id="cart_ticket_booking_ref" value="{{ ticket_booking.booking_reference }}">
<input type="hidden" name="cart_ticket_bookings_total" id="cart_ticket_bookings_total" value="{{ ticket_booking.cost }}">
Expand Down
2 changes: 1 addition & 1 deletion templates/booking/gift_voucher_purchase.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>{% if form.instance.activated %}Update Gift Voucher{% elif paypal_form %}Gif
<strong>{{ voucher_type }}{% if show_vat %} <span class="vat">(incl. VAT)</span>{% endif %}</strong><br>
</div>
{% if payment_method == "stripe" %}
<form method="post" action="{% url 'booking:stripe_checkout' %}">
<form method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_gift_voucher" id="cart_gift_voucher" value="{{ voucher.id }}">
<input type="hidden" name="cart_gift_voucher_total" id="cart_gift_voucher_total" value="{{ voucher.gift_voucher_type.cost }}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h3 class="checkout-total">
{% endif %}
</h3>

<form id="checkout-blocks-form" method="post" action="{% url 'booking:stripe_checkout' %}">
<form id="checkout-blocks-form" method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_blocks_total" id="cart_blocks_total_input" value="{{ total_unpaid_block_cost }}">
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3 class="checkout-total">Total: £ {% if total_unpaid_booking_cost %}{{ total_unpaid_booking_cost }}{% else %}0{% endif %}{% if show_vat %} <span class="vat">(incl. VAT)</span>{% endif %}</h3>

<form id="checkout-bookings-form" method="post" action="{% url 'booking:stripe_checkout' %}">
<form id="checkout-bookings-form" method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_bookings_total" id="cart_bookings_total_input" value="{{ total_unpaid_booking_cost }}">
<input
Expand Down
2 changes: 1 addition & 1 deletion templates/booking/ticket_bookings.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h1>Your ticket bookings</h1>
{% if payment_method == "stripe" and cart_ticket_bookings_total > 0 %}
<div>
<strong>Total pending: £{{ cart_ticket_bookings_total }}</strong>
<form method="post" action="{% url 'booking:stripe_checkout' %}">
<form method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_ticket_bookings_total" id="cart_ticket_bookings_total" value="{{ cart_ticket_bookings_total }}">
<input
Expand Down
2 changes: 1 addition & 1 deletion templates/studioadmin/stripe_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>Stripe Test Payment</h2>

<h3 class="checkout-total">Total: £0.30</h3>

<form id="checkout-test-stripe-form" method="post" action="{% url 'booking:stripe_checkout' %}">
<form id="checkout-test-stripe-form" method="post" action="{% url 'stripe_checkout' %}">
{% csrf_token %}
<input type="hidden" name="cart_stripe_test_total" id="cart_stripe_test_total" value="0.30">
<input
Expand Down

0 comments on commit d265b6d

Please sign in to comment.