Changeset - bcd9fd777f07
[Not reviewed]
default
0 3 0
Dennis Fink - 3 years ago 2022-02-25 22:44:52
dennis.fink@c3l.lu
Add satispay
3 files changed with 11 insertions and 1 deletions:
0 comments (0 inline, 0 general)
c3l_membership/__init__.py
Show inline comments
 
@@ -37,12 +37,13 @@ def create_app():
 
    app.config["LANGUAGES"] = ["en", "de", "fr", "lb"]
 

	
 
    app.config.setdefault("SUPPORTING_FEE", 40)
 
    app.config.setdefault("REGULAR_FEE", 120)
 

	
 
    app.config.setdefault("DIGICASH_ENABLED", True)
 
    app.config.setdefault("SATISPAY_ENABLED", True)
 
    app.config.setdefault("CRYPTOCURRENCIES", dict())
 

	
 
    @babel.localeselector
 
    def get_locale():
 
        if not g.get("lang_code", None):
 
            g.lang_code = request.accept_languages.best_match(app.config["LANGUAGES"])
c3l_membership/templates/member.html
Show inline comments
 
@@ -108,12 +108,18 @@
 
    {% elif form.payment.data == 'digicash' %}
 
      <div class="digicash">
 
        {% set payconiq_url='https://payconiq.com/t/1/62068d4d71445b0006dfbd5d?A={amount}&R=Membership&D={username}'.format(amount=price, username=form.username.data) %}
 
        <div><p>{% trans %}Pay with DigiCash/Payconiq!{% endtrans %}</p></div>
 
        <div><img class="cryptoqrcode" src="{{ qrcode(payconiq_url) }}" /></div>
 
      </div>
 
    {% elif form.payment.data == 'satispay' %}
 
      <div class="digicash">
 
        {% set satispay_url='https://www.satispay.com/app/pay/shops/e5ca1df1-1f72-457e-88a2-7691ab630947?amount={amount}'.format(amount=price) %}
 
        <div><p>{% trans %}Pay with Satispay{% endtrans %}</p></div>
 
        <div><img class="crpytoqrcode" src="{{ qrcode(satispay_url) }}" /></div>
 
      </div>
 
    {% endif %}
 
    <div class="signature">
 
      <p class="membersignature">{% trans %}Luxembourg, the{% endtrans %}</p>
 
      <p class="adminsignature">
 
        {{ _("Signature of your legal representative") if form.minor_member.data else _("Your signature") }}
 
      </p>
c3l_membership/views.py
Show inline comments
 
@@ -35,12 +35,15 @@ def index():
 
        ("wire transfer", gettext("by wire transfer")),
 
    ]
 

	
 
    if current_app.config["DIGICASH_ENABLED"]:
 
        choices.append(("digicash", gettext("by DigiCash/Payconiq")))
 

	
 
    if current_app.config["SATISPAY_ENABLED"]:
 
        choices.append(("satispay", gettext("by Satispay")))
 

	
 
    choices.extend(
 
        (cryptocurrency_label, " ".join((gettext("by"), cryptocurrency_label.title())))
 
        for cryptocurrency_label, options in current_app.config[
 
            "CRYPTOCURRENCIES"
 
        ].items()
 
        if options["ENABLED"]
 
@@ -81,13 +84,13 @@ def index():
 
            else:
 
                current_conversion = current_conversion_r.json()
 
                commodity = current_app.config["CRYPTOCURRENCIES"][form.payment.data][
 
                    "COMMODITY"
 
                ]
 
                price = current_conversion[commodity][status.upper()]
 
        elif form.payment.data == "digicash":
 
        elif form.payment.data in ("digicash", "satispay"):
 
            price = price * 100
 

	
 
        now = date.today()
 
        xml_data = {
 
            "status": status,
 
            "name": form.fullname.data,
0 comments (0 inline, 0 general)