resolve merge conflicts

pull/1/head
eric 2012-10-15 00:31:45 -04:00
commit 4484e504f8
10 changed files with 72 additions and 33 deletions

View File

@ -1,10 +1,9 @@
{% load humanize %}Congratulations!
Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. {{ transaction.host|capfirst }} will charge your credit card ${{ transaction.amount|intcomma }}.
Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. Your credit card will be charged ${{ transaction.amount|intcomma }}.
Pledge Summary
Amount pledged: ${{ transaction.amount|intcomma }}
Premium: {{ transaction.premium.description }}
Pledge summary
{% include "notification/pledge_summary.txt" %}
We will notify you when the unglued ebook is available for you to read. If you've requested special premiums, the rights holder, {{ transaction.campaign.rightsholder }}, will be in touch with you via email to request any information needed to deliver your premium.

View File

@ -2,20 +2,13 @@
Your canceled pledge
Amount: ${{ transaction.amount|intcomma }}
Premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}None requested{% endif %}
Premium: {{ transaction.premium.description }}
You will not be acknowledged in the unglued ebook.
{% else %}You have modified a pledge that you had previously made to the campaign to unglue {{ transaction.campaign.work.title }}.
Your new pledge summary
Amount pledged: ${{ transaction.amount|intcomma }}
Premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}None requested{% endif %}{% endif %}
Acknowledgements:
- The unglued ebook will be delivered to your inbox.</li>{% if not transaction.anonymous %}{% ifequal transaction.tier 1 %}
- You will be listed as a Supporter using the name "{{ transaction.ack_name }}".{% endifequal %}{% ifequal transaction.tier 2 %}
- You will be listed as a Benefactor using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% ifequal transaction.tier 3 %}
- You will be listed as a Bibliophile using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% endif %}{% if transaction.ack_dedication %}
- The following dedication will be included:
{{ transaction.ack_dedication }}{% endif %}
{% include "notification/pledge_summary.txt" %}
{% endif %}
If you'd like to visit the campaign page or make changes, click here:
https://{{site.domain}}{% url work transaction.campaign.work.id %}

View File

@ -0,0 +1,13 @@
{% load humanize %}
Amount pledged: ${{ transaction.amount|intcomma }}
Premium: {{ transaction.premium.description }}
You will also be acknowledged as follows:
- The unglued ebook will be delivered to your inbox.{% if not transaction.anonymous %}{% ifequal transaction.tier 1 %}
- You will be listed in the ebook as a Supporter using the name "{{ transaction.ack_name }}".{% endifequal %}{% ifequal transaction.tier 2 %}
- You will be listed in the ebook as a Benefactor using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% ifequal transaction.tier 3 %}
- You will be listed in the ebook as a Bibliophile using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% endif %}{% ifequal transaction.tier 3 %}{% if transaction.ack_dedication %}
- The following dedication will be included in the ebook:
{{ transaction.ack_dedication }}{% else %}
- You were eligible to include a dedication in the unglued ebook, but did not choose to do so. If you like, you can change this at https://{{ site.domain }}{% url pledge_modify work_id=transaction.campaign.work.id %}.
{% endif %}{% endifequal %}

View File

@ -2,17 +2,8 @@
Thank you, {{ transaction.user.username }}! You have pledged to unglue {{ transaction.campaign.work.title }}. If this campaign successfully raises ${{ transaction.campaign.target|intcomma }} by {{ transaction.campaign.deadline|date:"M d Y" }}, this book will be released in an unglued ebook edition for all to enjoy.
Pledge summary
Amount pledged: ${{ transaction.amount|intcomma }}
Premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}None requested{% endif %}
{% include "notification/pledge_summary.txt" %}
Acknowledgements:
- The unglued ebook will be delivered to your inbox.</li>{% if not transaction.anonymous %}{% ifequal transaction.tier 1 %}
- You will be listed as a Supporter using the name "{{ transaction.ack_name }}".{% endifequal %}{% ifequal transaction.tier 2 %}
- You will be listed as a Benefactor using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% ifequal transaction.tier 3 %}
- You will be listed as a Bibliophile using the name "{{ transaction.ack_name }}" with a link to your Unglue.it supporter page.{% endifequal %}{% endif %}{% if transaction.ack_dedication %}
- The following dedication will be included:
{{ transaction.ack_dedication }}{% endif %}
You can help even more by sharing this campaign with your friends.
Facebook: https://www.facebook.com/sharer.php?u=https://{{ site.domain }}{% url work transaction.campaign.work.id %}

View File

@ -17,7 +17,7 @@
<div><h2>Error: Card authorization for a pledge transaction</h2>
<div>
<p>Unglue.it would like to process your pledge, but there's some problem with our credit card processeng. We'd appreciate it if you'd contact <a href="mailto:support@gluejar.com?subject={{ request.get_full_path|urlencode }}">unglue.it support</a>.
<p>Unglue.it would like to process your pledge, but there's some problem with our credit card processing. (<b>{{exception.message}}</b>) We'd appreciate it if you'd contact <a href="mailto:support@gluejar.com?subject={{ request.get_full_path|urlencode }}">unglue.it support</a>.
</p>
</div>
</div>

View File

@ -39,6 +39,12 @@ $j(document).ready(function(){
</script>
{% endblock %}
{% block topsection %}
{% if request.user in work.last_campaign.managers.all and work.last_campaign.status != 'SUCCESSFUL' %}
<div class="launch_top pale">Hi, {{ request.user.username }}. Since you're a manager for this campaign, you can <a href="{% url manage_campaign id=work.last_campaign.id %}">edit this campaign</a>.</div>
{% endif %}
{% endblock %}
{% block content %}
{% with work.last_campaign_status as status %}
{% with work.id as work_id %}

View File

@ -774,7 +774,7 @@ class FundPledgeView(FormView):
if self.transaction.user.id != self.request.user.id:
# trouble!
return render(request, "pledge_user_error.html", {'transaction': self.transaction })
return render(self.request, "pledge_user_error.html", {'transaction': self.transaction })
p = PaymentManager()
@ -786,7 +786,7 @@ class FundPledgeView(FormView):
try:
p.make_account(user=self.request.user, host=settings.PAYMENT_PROCESSOR, token=stripe_token)
except baseprocessor.ProcessorError as e:
return HttpResponse("There was an error processing your credit card")
return render(self.request, "pledge_card_error.html", {'transaction': self.transaction, 'exception':e })
self.transaction.host = settings.PAYMENT_PROCESSOR
@ -801,7 +801,7 @@ class FundPledgeView(FormView):
if url is not None:
return HttpResponseRedirect(url)
else:
return render(request, "pledge_card_error.html", {'transaction': self.transaction })
return render(self.request, "pledge_card_error.html", {'transaction': self.transaction })
class NonprofitCampaign(FormView):
template_name="nonprofit.html"

View File

@ -344,6 +344,10 @@ a.success:hover {
.launch_top a {
font-size: 110%;
}
.launch_top.pale {
border-color: #d6dde0;
font-size: 13px;
}
.preview_content {
border: solid 3px #e35351;
-moz-border-radius: 7px;

View File

@ -26,6 +26,11 @@
a {
font-size: 110%;
}
&.pale {
border-color: @blue-grey;
font-size: @font-size-default;
}
}
.preview_content {

View File

@ -2,6 +2,8 @@ from regluit.core import models
from regluit.payment.models import Transaction, PaymentResponse, Receiver
from regluit.payment.manager import PaymentManager
from regluit.payment import stripelib
import django
from django.conf import settings
@ -222,12 +224,38 @@ def test_relaunch(unglue_it_url = settings.LIVE_SERVER_TEST_URL, do_local=True,
support_button = WebDriverWait(sel,10).until(lambda d: d.find_element_by_css_selector("input[value*='Pledge Now']"))
support_button.click()
# now fill out the credit card
sel.execute_script("""document.getElementById("card_Number").value="4242424242424242";""")
## now fill out the credit card
## CVC should fail but doesn't for now -- hmmm.
#
#sel.execute_script("""document.getElementById("card_Number").value={0};""".format(stripelib.ERROR_TESTING['CVC_CHECK_FAIL'][0]))
#sel.execute_script("""document.getElementById("card_ExpiryMonth").value="01";""")
#sel.execute_script("""document.getElementById("card_ExpiryYear").value="14";""")
#sel.execute_script("""document.getElementById("card_CVC").value="123";""")
#
#verify_cc_button = WebDriverWait(sel,10).until(lambda d: d.find_element_by_css_selector("input[value*='Complete Pledge']"))
#verify_cc_button.click()
#
#yield sel
# let's put in a Luhn-invalid # e.g., 4242424242424241
sel.execute_script("""document.getElementById("card_Number").value="4242424242424241";""")
sel.execute_script("""document.getElementById("card_ExpiryMonth").value="01";""")
sel.execute_script("""document.getElementById("card_ExpiryYear").value="14";""")
sel.execute_script("""document.getElementById("card_CVC").value="123";""")
sel.execute_script("""document.getElementById("card_CVC").value="321";""")
verify_cc_button = WebDriverWait(sel,10).until(lambda d: d.find_element_by_css_selector("input[value*='Complete Pledge']"))
verify_cc_button.click()
# should do a check for "Your card number is incorrect" -- but this doesn't stall -- so we're ok
time.sleep(2)
# should succeed
sel.execute_script("""document.getElementById("card_Number").value={0};""".format(stripelib.TEST_CARDS[0][0]))
sel.execute_script("""document.getElementById("card_ExpiryMonth").value="01";""")
sel.execute_script("""document.getElementById("card_ExpiryYear").value="14";""")
sel.execute_script("""document.getElementById("card_CVC").value="321";""")
time.sleep(2)
verify_cc_button = WebDriverWait(sel,10).until(lambda d: d.find_element_by_css_selector("input[value*='Complete Pledge']"))
verify_cc_button.click()