From 72fe2a679f27d81c92c65cf005ebf13fae7c7e34 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 15 Apr 2022 16:55:13 +0200 Subject: [PATCH 1/1] Club renewal procedure fixes. --- src/catalogue/locale/pl/LC_MESSAGES/django.po | 16 ++- .../templates/catalogue/2022/book_detail.html | 2 +- .../catalogue/audiobook_zip_readme.txt | 4 +- .../templates/catalogue/book_short.html | 2 +- .../templates/catalogue/book_wide.html | 2 +- src/club/civicrm.py | 5 +- src/club/locale/pl/LC_MESSAGES/django.mo | Bin 8653 -> 8143 bytes src/club/locale/pl/LC_MESSAGES/django.po | 40 +++--- .../management/commands/payu_fake_notify.py | 25 ++++ src/club/models.py | 2 +- src/club/payment_methods.py | 7 + src/club/payu/models.py | 2 +- src/club/payu/tests/integration.py | 2 +- src/club/static/club/form.js | 2 +- src/club/templates/club/dummy_payment.html | 128 +++++++++--------- src/club/templates/club/index.html | 4 +- .../templates/club/membership_form_app.html | 15 +- src/club/templates/club/schedule.html | 120 +++++++++++----- src/club/templates/club/thanks.html | 12 +- src/club/templates/club/year_summary.html | 2 +- src/club/templates/payu/rec_payment.html | 40 +++--- src/club/urls.py | 5 +- src/club/views.py | 11 -- src/paypal/urls.py | 4 +- src/wolnelektury/templates/board_base.html | 2 +- src/wolnelektury/templates/user.html | 2 +- src/wolnelektury/urls.py | 14 +- 27 files changed, 273 insertions(+), 197 deletions(-) create mode 100644 src/club/management/commands/payu_fake_notify.py diff --git a/src/catalogue/locale/pl/LC_MESSAGES/django.po b/src/catalogue/locale/pl/LC_MESSAGES/django.po index 07af503db..9c9c66192 100644 --- a/src/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/src/catalogue/locale/pl/LC_MESSAGES/django.po @@ -164,7 +164,7 @@ msgstr "slug" msgid "language code" msgstr "Kod języka" -#: catalogue/models/book.py:67 catalogue/models/book.py:429 +#: catalogue/models/book.py:67 catalogue/models/book.py:436 #: catalogue/models/collection.py:16 catalogue/models/tag.py:61 #: catalogue/models/tag.py:137 msgid "description" @@ -253,21 +253,21 @@ msgstr "książka" msgid "books" msgstr "książki" -#: catalogue/models/book.py:621 +#: catalogue/models/book.py:628 #, python-format msgid "Book \"%s\" does not exist." msgstr "Utwór \"%s\" nie istnieje." -#: catalogue/models/book.py:637 +#: catalogue/models/book.py:644 #, python-format msgid "Book %s already exists" msgstr "Książka %s już istnieje" -#: catalogue/models/book.py:955 +#: catalogue/models/book.py:962 msgid "This work needs modernisation" msgstr "Ten utwór wymaga uwspółcześnienia" -#: catalogue/models/book.py:1045 catalogue/models/bookmedia.py:34 +#: catalogue/models/book.py:1052 catalogue/models/bookmedia.py:34 #, python-format msgid "%s file" msgstr "plik %s" @@ -792,12 +792,14 @@ msgstr "Przepraszamy! Zapytanie jest zbyt długie." msgid "Sorry! Search query must have at least two characters." msgstr "Przepraszamy! Zapytanie musi zawierać co najmniej dwa znaki." -#: catalogue/templates/catalogue/snippets/2022_jplayer.html:53 +#: catalogue/templates/catalogue/snippets/2022_jplayer.html:47 +#: catalogue/templates/catalogue/snippets/2022_jplayer.html:113 #: catalogue/templates/catalogue/snippets/jplayer.html:36 msgid "Artist:" msgstr "Czyta" -#: catalogue/templates/catalogue/snippets/2022_jplayer.html:54 +#: catalogue/templates/catalogue/snippets/2022_jplayer.html:48 +#: catalogue/templates/catalogue/snippets/2022_jplayer.html:114 #: catalogue/templates/catalogue/snippets/jplayer.html:37 msgid "director:" msgstr "reż." diff --git a/src/catalogue/templates/catalogue/2022/book_detail.html b/src/catalogue/templates/catalogue/2022/book_detail.html index a265abef8..a70cba0f7 100644 --- a/src/catalogue/templates/catalogue/2022/book_detail.html +++ b/src/catalogue/templates/catalogue/2022/book_detail.html @@ -321,7 +321,7 @@

Ta książka jest dostępna dla tysięcy dzieciaków dzięki darowiznom od osób takich jak Ty!

- Dorzuć się! + Dorzuć się!
Dorzuć się! diff --git a/src/catalogue/templates/catalogue/audiobook_zip_readme.txt b/src/catalogue/templates/catalogue/audiobook_zip_readme.txt index 9ffa03ff4..f7933ba48 100644 --- a/src/catalogue/templates/catalogue/audiobook_zip_readme.txt +++ b/src/catalogue/templates/catalogue/audiobook_zip_readme.txt @@ -1,7 +1,7 @@ Ten audiobook pochodzi z darmowej biblioteki internetowej Wolne Lektury. Znajdziesz w niej tysiące ebooków i setki audiobooków. Wolne Lektury to projekt prowadzony przez fundację Nowoczesna Polska. Jesteśmy organizacją pozarządową. Działamy dzięki wsparciu darczyńców takich jak Ty. Wspólnie możemy udostępnić kolejne książki. Wspieraj Wolne Lektury stałą comiesięczną kwotą. Dzięki temu wcześniej uzyskasz dostęp do wyjątkowych publikacji! Możesz też wesprzeć nas jednorazowo. -Wejdź na https://wolnelektury.pl/towarzystwo/ i dorzuć się do nowych nagrań. +Wejdź na https://wolnelektury.pl/pomagam/ i dorzuć się do nowych nagrań. Audiobooki Wolnych Lektur są udostępniane na wolnych licencjach, co oznacza, że możesz je swobodnie wykorzystywać, udostępniać i publikować pod warunkiem zachowania warunków licencji i zgodnie z Zasadami wykorzystania Wolnych Lektur: https://wolnelektury.pl/info/zasady-wykorzystania/ @@ -9,7 +9,7 @@ Audiobooki Wolnych Lektur są udostępniane na wolnych licencjach, co oznacza, {% endif %}Przekaż 1% na wolną bibliotekę KRS 0000070056: https://wolnelektury.pl/info/wesprzyj-nas/ -Zostań Przyjacielem Wolnych Lektur: https://wolnelektury.pl/towarzystwo/ +Zostań Przyjacielem Wolnych Lektur: https://wolnelektury.pl/pomagam/ Słuchaj nas na YouTube: https://wolnelektury.pl/re/WolneLekturyYT/ diff --git a/src/catalogue/templates/catalogue/book_short.html b/src/catalogue/templates/catalogue/book_short.html index 25c130908..6f88cf0b6 100644 --- a/src/catalogue/templates/catalogue/book_short.html +++ b/src/catalogue/templates/catalogue/book_short.html @@ -150,7 +150,7 @@ {% block preview-info %}

{% trans "For now this work is only available for our subscribers." %} - Dołącz do Towarzystwa Przyjaciół Wolnych Lektur + Wspieraj Wolne Lektury

{% content_warning book %}
{% endblock %} diff --git a/src/catalogue/templates/catalogue/book_wide.html b/src/catalogue/templates/catalogue/book_wide.html index d7c2a09d5..9413ee70f 100644 --- a/src/catalogue/templates/catalogue/book_wide.html +++ b/src/catalogue/templates/catalogue/book_wide.html @@ -46,7 +46,7 @@ {% if book|status:request.user == 'closed' %} {% with form=club_form %} -
+ {% csrf_token %} {% include "club/payment_form.html" %} {% chunk 'club_form_bottom' %} diff --git a/src/club/civicrm.py b/src/club/civicrm.py index c44f6f893..ac3de7039 100644 --- a/src/club/civicrm.py +++ b/src/club/civicrm.py @@ -9,8 +9,8 @@ import yaml class CiviCRM: def __init__(self, base, key): self.base = base - self.api_base = base + 'civicrm/ajax/api4/' self.key = key + self.api_base = (base or '') + 'civicrm/ajax/api4/' self.enabled = bool(self.base and self.key) def request(self, resource, method, params): @@ -89,6 +89,9 @@ class CiviCRM: def report_activity(self, email, tpwl_key, key, name, datetime, details): + if not self.enabled: + return + contact_id = self.create_or_update_contact(email, tpwl_key) activity_id = self.get_activity_id(key) diff --git a/src/club/locale/pl/LC_MESSAGES/django.mo b/src/club/locale/pl/LC_MESSAGES/django.mo index 882e493a674af6fde0e1bc9db1697caba30a8f31..34073f1ec164f619d33fd181b0f9494f9c221a93 100644 GIT binary patch delta 2489 zcmY+_eN5F=9LMnk_<#y>0n10=2Z2(i@+1nHLYN{+ky4tPdXb;R)4h0sDL&z9;M`z6 z{KBbQ)2(4^TAA0ispTK3%Rkf_f3&5|w$_?!ZEDTAiF3U__a53h<9lD{ckb_=hwty4 zAJ;2>SlWF%Wz>M7G!Qe0+BjnlV&51(D5v9%Ie}l{eOx!rm@QZ}-k2;riJ5o<^^<#; zf)A0OnDG;gNyb#1jyX6A%aN|S&2lPbG}PEHK0tMJ2*={bI0*+)9iPV~cpY;vA;Fk5 zEI>`91~st|CgA}3a1b?-uTlM6#qo@9Zc(8x^9O3czcCRXp*o1?Vlqxattb!meF+~= z;|g4coA4?81gGFRWQAr3^Y9m(gNYN38I6l@3geq{Dq6vMJb*iK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!caqLf?ej2qm2nzB^_P;S#F|r5lK~ zL@m)k%qCV7Iukb%7p4*l9-)JJjrLthr?{JFBbF02guaIB37uS}TZs+CIu%GdfOqF} zh09f<|DE9v6%TG&v3zxZWaNxNxh*B9O50PO=On$&>4X=CUMlC7)(mgU_=%XGY|rf| zU04=+Cgz5o6U3c1KNWW5_LZ($lk%dW6Z6{q(8T=z3TaB|?jY^9B|Ik#I=!Uv>bqP& zVZ6e1OE*uaTiwva{Zu-1l5Ur0;t4m*HI(fd>-Kbc$ZH3rA&86kjxz_`*fnW z#iWBwD(abZ=%zw1=FmnuWbnDZ@*Sfh^|P<4Z?~GP!Rmo66nL z)f%`?CKbeby`-O;Qq|Gc9VEOc1<&bqy9c(rVUIaq<^ETdUj=8A7fS{yw>Q|_^Zymu z+|%x+UE_E82cI*AZo7Oh-P`FVeK)te>S$elHG1NHryB+-C*M&r7}yo{?c<@B@Zv!- kliND^*Gg`C2X~r*Pf`c^V*}fR!fKgJ!jHPS`=_k^2TuTjVgLXD diff --git a/src/club/locale/pl/LC_MESSAGES/django.po b/src/club/locale/pl/LC_MESSAGES/django.po index 729cb8b17..e8dabe1cf 100644 --- a/src/club/locale/pl/LC_MESSAGES/django.po +++ b/src/club/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-08-23 11:23+0200\n" +"PO-Revision-Date: 2022-04-15 16:32+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: pl\n" @@ -17,7 +17,7 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" "%100<12 || n%100>=14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" "%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" -"X-Generator: Poedit 2.4.1\n" +"X-Generator: Poedit 3.0\n" #: club/admin.py:46 msgid "payment complete" @@ -226,12 +226,6 @@ msgstr "ambasador" msgid "ambassadors" msgstr "ambasadorowie" -#: club/models.py:281 club/templates/club/index.html:7 -#: club/templates/club/index.html:13 club/templates/club/thanks.html:6 -#: club/templates/payu/rec_payment.html:5 -msgid "Towarzystwo Przyjaciół Wolnych Lektur" -msgstr "" - #: club/payu/models.py:17 club/payu/models.py:29 msgid "POS id" msgstr "" @@ -316,6 +310,15 @@ msgstr "Aktywne roczne wpłaty cykliczne" msgid "One-time donations in last 30 days" msgstr "Jednorazowe wpłaty w ciągu ostatnich 30 dni" +#: club/templates/club/dummy_payment.html:4 club/templates/club/index.html:7 +#: club/templates/club/index.html:13 +#: club/templates/club/membership_form_app.html:5 +#: club/templates/club/schedule.html:5 club/templates/club/thanks.html:6 +#: club/templates/club/year_summary.html:5 +#: club/templates/payu/rec_payment.html:5 +msgid "Wolne Lektury need your help!" +msgstr "Wolne Lektury potrzebują Twojej pomocy!" + #: club/templates/club/index.html:20 msgid "Congratulations – you're already a supporter of Wolne Lektury!" msgstr "Gratulacje – należysz już do Towarzystwa Przyjaciół Wolnych Lektur!" @@ -341,19 +344,19 @@ msgid "Thank you for your support! Support us again!" msgstr "" "Dziękujemy za Twoje dotychczasowe zaangażowanie! Wesprzyj nas ponownie!" -#: club/templates/club/membership_form.html:21 -msgid "Thank you for wanting to free the books with us!" -msgstr "Dziękujemy, że chcesz razem z nami uwalniać książki!" - -#: club/templates/club/membership_form.html:26 +#: club/templates/club/membership_form.html:20 msgid "See your past support." msgstr "Zobacz swoje dotychczasowe wsparcie." -#: club/templates/club/membership_form.html:41 +#: club/templates/club/membership_form.html:24 +msgid "Thank you for wanting to free the books with us!" +msgstr "Dziękujemy, że chcesz razem z nami uwalniać książki!" + +#: club/templates/club/membership_form.html:43 msgid "Help us get 100 new Friends by the end of the school semester." msgstr "Pomóż nam zdobyć 100 nowych Przyjaciół do końca semestru szkolnego." -#: club/templates/club/membership_form.html:42 +#: club/templates/club/membership_form.html:44 #, python-format msgid "" "\n" @@ -382,7 +385,7 @@ msgstr[3] "" "Od początku tej kampanii stałą wpłatą wsparło nas już %(supporters)s czytelników i czytelniczek," -#: club/templates/club/membership_form.html:47 +#: club/templates/club/membership_form.html:49 #, python-format msgid "" "\n" @@ -509,6 +512,11 @@ msgstr "" "\n" "Zlecasz comiesięczną płatność w wysokości %(amount)s zł. Dziękujemy!" +#, fuzzy +#~| msgid "Support Wolne Lektury" +#~ msgid "Wolne Lektury" +#~ msgstr "Wspieraj Wolne Lektury" + #~ msgid "sex" #~ msgstr "płeć" diff --git a/src/club/management/commands/payu_fake_notify.py b/src/club/management/commands/payu_fake_notify.py new file mode 100644 index 000000000..a216ac5b7 --- /dev/null +++ b/src/club/management/commands/payu_fake_notify.py @@ -0,0 +1,25 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +import json +from django.core.management.base import BaseCommand +from club.models import PayUOrder + + +class Command(BaseCommand): + def add_arguments(self, parser): + parser.add_argument('--rejected', '-r', type=bool, default=False) + parser.add_argument('order_id', type=int) + + def handle(self, **options): + order = PayUOrder.objects.get(id=options['order_id']) + status = 'REJECTED' if options['rejected'] else 'COMPLETED' + notification = order.notification_set.create( + body=json.dumps({ + 'order': { + 'status': status, + 'fake': True, + } + }) + ) + notification.apply() diff --git a/src/club/models.py b/src/club/models.py index 548423a1b..f09b68ec7 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -278,7 +278,7 @@ class PayUOrder(payu_models.Order): self.schedule.get_thanks_url()) def get_description(self): - return ugettext('Towarzystwo Przyjaciół Wolnych Lektur') + return 'Wolne Lektury' def is_recurring(self): return self.schedule.get_payment_method().is_recurring diff --git a/src/club/payment_methods.py b/src/club/payment_methods.py index c20768546..0c187a826 100644 --- a/src/club/payment_methods.py +++ b/src/club/payment_methods.py @@ -9,6 +9,9 @@ from paypal.rest import agreement_approval_url class PaymentMethod(object): is_onetime = False is_recurring = False + expiration_reliable = False + cancellable = False + updateable = False def initiate(self, request, schedule): return reverse('club_dummy_payment', args=[schedule.key]) @@ -16,6 +19,7 @@ class PaymentMethod(object): class PayU(PaymentMethod): is_onetime = True + expiration_reliable = True slug = 'payu' name = 'PayU' template_name = 'club/payment/payu.html' @@ -39,6 +43,9 @@ class PayURe(PaymentMethod): name = 'PayU recurring' template_name = 'club/payment/payu-re.html' is_recurring = True + expiration_reliable = True + cancellable = True + updateable = True def __init__(self, pos_id): self.pos_id = pos_id diff --git a/src/club/payu/models.py b/src/club/payu/models.py index 5764f8842..6ed329da8 100644 --- a/src/club/payu/models.py +++ b/src/club/payu/models.py @@ -89,7 +89,7 @@ class Order(models.Model): "merchantPosId": self.pos_id, "currencyCode": self.get_pos().currency_code, "totalAmount": str(int(self.get_amount() * 100)), - "extOrderId": "wolne-lektury-rcz-%d" % self.pk, + "extOrderId": "wolne-lektury-%d" % self.pk, "buyer": self.get_buyer() or {}, "continueUrl": self.get_continue_url(), diff --git a/src/club/payu/tests/integration.py b/src/club/payu/tests/integration.py index 3cef8ae41..64f2fe7d5 100644 --- a/src/club/payu/tests/integration.py +++ b/src/club/payu/tests/integration.py @@ -18,6 +18,6 @@ class SandboxTestCase(StaticLiveServerTestCase): super().tearDownClass() def test_payment(self): - self.selenium.get('%s%s' % (self.live_server_url, '/towarzystwo/')) + self.selenium.get('%s%s' % (self.live_server_url, '/pomagam/')) from time import sleep sleep(10) diff --git a/src/club/static/club/form.js b/src/club/static/club/form.js index 3b85a4e11..a32a5896e 100644 --- a/src/club/static/club/form.js +++ b/src/club/static/club/form.js @@ -26,7 +26,7 @@ $(function() { $("#payment-form").submit(function() { let camp = qs('pk_campaign'); - if (!camp && window.location.pathname !== "/towarzystwo/") { + if (!camp && window.location.pathname !== "/pomagam/") { camp = window.location.pathname; } let dims = camp ? {dimension1: camp} : {}; diff --git a/src/club/templates/club/dummy_payment.html b/src/club/templates/club/dummy_payment.html index 2809c5e1a..d776e75a8 100644 --- a/src/club/templates/club/dummy_payment.html +++ b/src/club/templates/club/dummy_payment.html @@ -1,72 +1,72 @@ {% extends request.session.from_app|yesno:"base/app.html,base/base.html" %} -{% block titleextra %}Towarzystwo Wolnych Lektur{% endblock %} +{% block titleextra %}{% trans "Wolne Lektury need your help!" %}{% endblock %} {% block body %} -
- -

Testowa płatność

- -

{{ schedule.email }}

-

{{ schedule.amount }}

-

{{ schedule.plan.get_interval_display }}

- - - - -{% if request.GET.p == 'inline' %} -
-{% else %} -{% if request.GET.p == 'popup' %} - - - - - - -{% else %} -
- {% csrf_token %} - - {{ form.as_p }} - -
-{% endif %} -{% endif %} - -
- - + + + {% else %} +
+ {% csrf_token %} + + {{ form.as_p }} + +
+ {% endif %} + {% endif %} + +
+ + + -
- + success-callback="paymentcallback" + sig="{{ widget_sig }}"> + diff --git a/src/club/urls.py b/src/club/urls.py index d55ef171f..9b9d89725 100644 --- a/src/club/urls.py +++ b/src/club/urls.py @@ -2,12 +2,15 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.urls import path +from django.views.generic import RedirectView from annoy.utils import banner_exempt from . import views urlpatterns = [ path('', banner_exempt(views.JoinView.as_view()), name='club_join'), + path('dolacz/', RedirectView.as_view( + url='/pomagam/', permanent=False)), path('info/', banner_exempt(views.ClubView.as_view()), name='club'), path('plan//', banner_exempt(views.ScheduleView.as_view()), name='club_schedule'), @@ -23,7 +26,5 @@ urlpatterns = [ path('notify//', views.PayUNotifyView.as_view(), name='club_payu_notify'), - path('czlonek/', views.MembershipView.as_view(), name='club_membership'), - path('weryfikacja/', views.member_verify, name='club_member_verify'), ] diff --git a/src/club/views.py b/src/club/views.py index dc1bef07b..74d86de9e 100644 --- a/src/club/views.py +++ b/src/club/views.py @@ -149,17 +149,6 @@ class PayUNotifyView(payu_views.NotifyView): order_model = models.PayUOrder -class MembershipView(UpdateView): - fields = ['name'] - - def get_success_url(self): - # TODO: get only current schedule if multiple. - return self.object.schedule_set.first().get_absolute_url() - - def get_object(self): - return self.request.user.membership - - class ScheduleThanksView(DetailView): model = models.Schedule slug_field = slug_url_kwarg = 'key' diff --git a/src/paypal/urls.py b/src/paypal/urls.py index 7adf644a2..7c4f6933d 100644 --- a/src/paypal/urls.py +++ b/src/paypal/urls.py @@ -6,8 +6,8 @@ from django.views.generic import RedirectView from . import views urlpatterns = ( - path('form/', RedirectView.as_view(url='/towarzystwo/dolacz/')), - path('app-form/', RedirectView.as_view(url='/towarzystwo/dolacz/app/')), + path('form/', RedirectView.as_view(url='/pomagam/')), + path('app-form/', RedirectView.as_view(url='/pomagam/?pk_campaign=aplikacja')), path('return//', views.paypal_return, name='paypal_return'), path('app-return//', views.paypal_return, kwargs={'app': True}, name='paypal_app_return'), diff --git a/src/wolnelektury/templates/board_base.html b/src/wolnelektury/templates/board_base.html index 29dff3c56..0a83b8077 100644 --- a/src/wolnelektury/templates/board_base.html +++ b/src/wolnelektury/templates/board_base.html @@ -14,7 +14,7 @@