This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b58d2c6
commit 07d6164
Showing
9 changed files
with
237 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
{{ _("Payment for open source") }} | ||
{{ _("Invoice from Gratipay") }} | ||
|
||
[---] text/html | ||
{{ _( "Congratulations! You now have a moral license to use community-built open source software, because you paid {amount} to the open source community through Gratipay. Thank you for your purchase!" | ||
{{ _( "Thank you for your payment of {amount} for open source!" | ||
, amount=format_currency(amount, 'USD') | ||
) }} | ||
<br> | ||
<br> | ||
<a href="{{ receipt_url }}" | ||
style="{{ button_style }}">{{ _("View Receipt") }}</a> | ||
<a href="{{ invoice_url }}" style="{{ button_style }}">{{ _("View Invoice") }}</a> | ||
|
||
[---] text/plain | ||
{{ _( "Congratulations! You now have a moral license to use community-built open source software, because you paid {amount} to the open source community through Gratipay. Thank you for your purchase!" | ||
{{ _( "Thank you for your payment of {amount} for open source!" | ||
, amount=format_currency(amount, 'USD') | ||
) }} | ||
|
||
{{ _("Follow this link to view your receipt:") }} | ||
{{ _("Follow this link to view your invoice:") }} | ||
|
||
{{ receipt_url }} | ||
{{ invoice_url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,14 +126,14 @@ def test_stores_info(self): | |
|
||
class Send(QueuedEmailHarness): | ||
|
||
def test_sends_receipt_link(self): | ||
def test_sends_invoice_link(self): | ||
parsed, errors = _parse(GOOD) | ||
parsed.pop('payment_method_nonce') | ||
payment_for_open_source = _store(parsed) | ||
_send(self.app, payment_for_open_source) | ||
msg = self.get_last_email() | ||
assert msg['to'] == '[email protected]' | ||
assert msg['subject'] == 'Payment for open source' | ||
assert msg['subject'] == 'Invoice from Gratipay' | ||
|
||
|
||
class PayForOpenSource(PayForOpenSourceHarness): | ||
|
@@ -155,13 +155,13 @@ def test_pays_for_open_source(self): | |
assert self.fetch() is None | ||
result = pay_for_open_source(self.app, self.good) | ||
assert not result['errors'] | ||
assert result['receipt_url'].endswith('receipt.html') | ||
assert result['invoice_url'].endswith('invoice.html') | ||
assert self.fetch().succeeded | ||
|
||
def test_flags_errors_and_doesnt_store(self): | ||
assert self.fetch() is None | ||
result = pay_for_open_source(self.app, self.bad) | ||
assert result == {'errors': ALL, 'receipt_url': None} | ||
assert result == {'errors': ALL, 'invoice_url': None} | ||
assert self.fetch() is None | ||
|
||
def test_flags_errors_with_no_transaction_id(self): | ||
|
@@ -189,7 +189,7 @@ def test_post_gets_json(self): | |
assert response.headers['Content-Type'] == 'application/json' | ||
result = json.loads(response.body) | ||
assert not result['errors'] | ||
assert result['receipt_url'].endswith('receipt.html') | ||
assert result['invoice_url'].endswith('invoice.html') | ||
assert self.fetch().succeeded | ||
|
||
def test_bad_post_gets_400(self): | ||
|
@@ -213,5 +213,5 @@ def test_partial_post_is_fine(self): | |
assert response.headers['Content-Type'] == 'application/json' | ||
result = json.loads(response.body) | ||
assert not result['errors'] | ||
assert result['receipt_url'].endswith('receipt.html') | ||
assert result['invoice_url'].endswith('invoice.html') | ||
assert self.fetch().succeeded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,9 @@ def test_anon_can_post(self): | |
'[email protected]', 'Wonderland', 'http://www.example.com/', | ||
'thebestbutter', 'Love me! Love me! Say that you love me!') | ||
assert self.submit_succeeds() | ||
self.wait_for('a.invoice').click() | ||
self.wait_for('#txnid') | ||
assert self.css('#items tbody tr').text == 'open source software $ 537.00' | ||
|
||
def test_options_are_optional(self): | ||
self.fill_form('537', '4242424242424242', '1020', '123') | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.