Skip to content

Commit

Permalink
Merge pull request #14 from gurch101/wizard-country-restriction
Browse files Browse the repository at this point in the history
Restrict addon to Finland only in wizard (SH-478)
  • Loading branch information
tulimaki authored Nov 22, 2016
2 parents 5f9a2ab + 74b6e52 commit 26a9783
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion shuup_checkoutfi/admin_forms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from django import forms

from shuup.admin.forms import ShuupAdminForm
from shuup.admin.modules.service_providers.forms import (ServiceWizardForm,
ServiceWizardFormDef)
from shuup.core.models import Shop

from .models import CheckoutFiPaymentProcessor

Expand All @@ -29,3 +29,7 @@ def __init__(self):
form_class=CheckoutFiWizardForm,
template_name="shuup/checkoutfi/wizard_form.jinja"
)

def visible(self):
shop = Shop.objects.first()
return not shop or not shop.contact_address or shop.contact_address.country == "FI"
6 changes: 4 additions & 2 deletions shuup_checkoutfi/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-11 23:50+0000\n"
"POT-Creation-Date: 2016-11-21 21:09+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -54,7 +54,9 @@ msgstr ""

#, python-format
msgid ""
"Accept credit cards using <a target='_blank' href='%(url)s'>Checkout.fi</a>"
"Accept credit cards using <a target='_blank' href='%(url)s'>Checkout.fi</a>. "
"Checkout.fi is one of the largest Finnish payment service providers and "
"supports bank payments, Visa, and Mastercard."
msgstr ""

msgid "Don't have an account?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{% call service_provider_section(
identifier=form_def.name,
header="Checkout.fi",
description=gettext("Accept credit cards using <a target='_blank' href='%(url)s'>Checkout.fi</a>", url="http://www.checkout.fi")
description=gettext("Accept credit cards using <a target='_blank' href='%(url)s'>Checkout.fi</a>. Checkout.fi is one of the largest Finnish payment service providers and supports bank payments, Visa, and Mastercard.", url="http://www.checkout.fi"),
allowed_countries="FI"
)%}
{% set form = pane.forms[form_def.name] %}
<input type="hidden" name="{{ form.name.html_name }}" value="Checkout.fi">
Expand Down

0 comments on commit 26a9783

Please sign in to comment.