From c40b8cc02ddcb8fc82c73b00ecb5831c759f184a 2016-09-21 09:40:38
From: Christopher Neugebauer
Date: 2016-09-21 09:40:38
Subject: [PATCH] Templates for stripe.
---
diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py
index e98073c09382d664ec3728ce4dbfef02a5938839..45863ffe00bd4d969498be46f2ea9b9761556adc 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 3eb1ac5d5e4dce6b8b770ebc8b97f694c72cd852..0a0bae55f30bc417392994e659300365079d13df 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 6bbaa86db73d5b3efe6fe9a3c1d4c3060bf3a8c7..d46d56caca05b42ab586bea487c5cd5c2ae8290a 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."));
}
};