From c40b8cc02ddcb8fc82c73b00ecb5831c759f184a Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Wed, 21 Sep 2016 19:40:38 +1000 Subject: [PATCH] Templates for stripe. --- pinaxcon/settings.py | 1 + pinaxcon/templates/registrasion/invoice.html | 3 ++- .../registrasion/stripe/credit_card_payment.html | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index e98073c..45863ff 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -230,6 +230,7 @@ PINAX_BOXES_HOOKSET = "pinaxcon.hooks.PinaxBoxesHookSet" PINAX_STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "your test public key") PINAX_STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "your test secret key") +PINAX_STRIPE_SEND_EMAIL_RECEIPTS = False # Registrasion Attendee profile model ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile" diff --git a/pinaxcon/templates/registrasion/invoice.html b/pinaxcon/templates/registrasion/invoice.html index 3eb1ac5..0a0bae5 100644 --- a/pinaxcon/templates/registrasion/invoice.html +++ b/pinaxcon/templates/registrasion/invoice.html @@ -16,7 +16,8 @@ You can give this URL to your accounts department to pay your registration.

- Pay this invoice + Pay this invoice (dummy) + Pay this invoice with Stripe {% if user.is_staff %} Apply manual payment {% endif %} diff --git a/pinaxcon/templates/registrasion/stripe/credit_card_payment.html b/pinaxcon/templates/registrasion/stripe/credit_card_payment.html index 6bbaa86..d46d56c 100644 --- a/pinaxcon/templates/registrasion/stripe/credit_card_payment.html +++ b/pinaxcon/templates/registrasion/stripe/credit_card_payment.html @@ -35,13 +35,14 @@ function stripeResponseHandler(status, response) { // Grab the form: var $form = $('#payment-form'); + var $submit = $form.find('input[type=submit]') if (response.error) { // Problem! console.log(response.error.message); // Show the errors on the form: $form.find('#payment-errors').text(response.error.message); $form.find('#payment-errors-outer').show(); - $form.find('input[type=submit]').prop('disabled', false); // Re-enable submission + $submit.prop('disabled', false); // Re-enable submission } else { // Token was created! console.log(response); @@ -53,8 +54,11 @@ $form = $form.append($('').val(token)); // Submit the form: - $form.find('input[type=submit]').prop('disabled', false); - $form.find('input[type=submit]').click(); + + $submit.prop('disabled', false); + $submit.click(); + $submit.prop('disabled', true); + $form.append($('

').text("Processing your payment. Please do not refresh.")); } };