Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1093 allow !swedish phone numbers for swish #119

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
48 changes: 43 additions & 5 deletions templates/form/swish.liquid
Original file line number Diff line number Diff line change
@@ -1,32 +1,70 @@
<div class="container">
<form class="form-horizontal" method="post" autocomplete="on" action="process_swish">
<form class="form-horizontal" method="post" autocomplete="on" action="process_swish" id="swish-form">
<input type="hidden" name="session_id" value="{{ model.session_id }}" />
<div class="row">
<div class="col-sm-4 col-sm-push-8 col-xs-6 col-xs-push-3">
<img src="/assets/v2/images/brands/swish.svg" alt="swish" title="swish" style="width:100%">
</div>

<div class="col-sm-8 col-sm-pull-4 col-xs-12">
<div class="form-group">
<div class="col-xs-12">
<div class="form-group{% if model.invalid_number? or model.country_not_chosen? %} has-error{% endif %}">
<div class="col-xs-5">
<label for="swish-country-select" class="control-label" >{% t Country %}</label>
<select id="swish-country-select" class="form-control" name="country_code" style= "height: 40px !important;" required>
<option value=""> - Select - </option>
{% for country_code in model.country_codes %}
<option value="{{ country_code }}" {% if model.country_codes_in_number contains country_code %}selected{% endif %}>
{% case country_code %}
{% when '31' %}
{% t 🇳🇱 +31 %}
{% when '41' %}
{% t 🇨🇭 +41 %}
{% when '43' %}
{% t 🇦🇹 +43 %}
{% when '44' %}
{% t 🇬🇧 +44 %}
{% when '45' %}
{% t 🇩🇰 +45 %}
{% when '46' %}
{% t 🇸🇪 +46 %}
{% when '47' %}
{% t 🇳🇴 +47 %}
{% when '49' %}
{% t 🇩🇪 +49 %}
{% when '358' %}
{% t 🇫🇮 +358 %}
{% endcase %}
</option>
{% endfor %}
</select>
<span id="no_country_selected" class="help-block{% if model.country_not_chosen? != true %} hidden{% endif %}">
{% t Choose a country %}
</span>
</div>

<div class="col-xs-7">
<label for="mobile" class="control-label">{% t Mobile number %}</label>
<input
type="tel"
id="mobile"
name="mobile"
class="form-control"
autocomplete="tel"
pattern="^\s*(?:\+?(\d{1,9}))?[-. (]*[0-9\s]*"
pattern="^\s*(?:\+?(\d{1,14}))?[-. (]*[0-9\s]*"
inputmode="numeric"
value="{{ model.mobile_number }}"
placeholder="07XXXXXX"
required
/>
<span id="invalid_number_length" class="help-block{% if model.invalid_number? != true %} hidden{% endif %}">
{% t Number too long for selected country %}
</span>
</div>
</div>

<div class="form-group">
<div class="col-xs-12">
<button type="submit" class="btn btn-info btn">{% t Proceed %}</button>
<button type="submit" class="btn btn-info btn" id="button-proceed">{% t Proceed %} </button>
</div>
</div>
</div>
Expand Down