Skip to content

Commit

Permalink
Merge pull request #2329 from liberapay/various
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Mar 25, 2024
2 parents 6dd98ef + 0bc1c4e commit b3202b5
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 63 deletions.
6 changes: 3 additions & 3 deletions liberapay/payin/paypal.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def create_order(db, payin, payer, return_url, cancel_url, state):
(f'-{locale.territory}' if locale.territory else '')
)
if not locale_re.match(locale_tag):
website.tell_sentry(Warning(
logger.warning(
f"the locale tag `{locale_tag}` doesn't match the format expected by PayPal; "
f"falling back to `{locale.language}`"
))
)
locale_tag = locale.language
data = {
"intent": "CAPTURE",
Expand Down Expand Up @@ -233,7 +233,7 @@ def record_order_result(db, payin, order):

)
record_payin_transfer_reversal(
db, pt_id, refund['id'], payin_refund.id, refund['create_time']
db, pt_id, refund['id'], refund_amount, payin_refund.id, refund['create_time']
)
if reversed_amount == 0:
reversed_amount = None
Expand Down
4 changes: 2 additions & 2 deletions style/base/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
margin-left: 2px;
}
.icon-16 {
height: 16px;
height: 17px;
margin-top: calc((1lh - 16px) / 2);
vertical-align: top;
width: 16px;
width: 17px;
}
.icon-32 {
height: 32px;
Expand Down
5 changes: 4 additions & 1 deletion tests/py/test_payins.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@ def test_payin_paypal(self):
assert pt.amount == EUR('10.00')

# 3rd request: redirect to PayPal
r = self.client.GxT('/donor/giving/pay/paypal/1', auth_as=self.donor)
r = self.client.GxT(
'/donor/giving/pay/paypal/1', HTTP_ACCEPT_LANGUAGE=b'es-419',
auth_as=self.donor,
)
assert r.code == 302, r.text
assert r.headers[b'Location'].startswith(b'https://www.sandbox.paypal.com/')
payin = self.db.one("SELECT * FROM payins")
Expand Down
2 changes: 1 addition & 1 deletion www/admin/users.spt
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ title = "Users Admin"
<span class="text-warning">{{ icon('warning-sign', "Unconfirmed") }}</span>
% endif
&nbsp;
<form action="/admin/emails" method="POST" target="_blank" class="inline-block middle">
<form action="/admin/emails" method="POST" target="_blank" class="inline-block">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<input type="hidden" name="email" value="{{ row.email.address }}" />
<button class="link" name="action" value="lookup">{{
Expand Down
Loading

0 comments on commit b3202b5

Please sign in to comment.