Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
Staging Server committed Nov 7, 2017
2 parents bfec96a + c651c78 commit 35241b0
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 58 deletions.
2 changes: 1 addition & 1 deletion gateway_selector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

__version__ = '1.0.0'
__version__ = '1.0.1'

4 changes: 2 additions & 2 deletions gateway_selector/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
@frappe.whitelist(allow_guest=True)
def login(payment_request_name, payment_reference):

pr = frappe.get_doc("Payment Request", payment_request_name)
pr = frappe.get_doc("Payment Request", payment_request_name.strip().upper())

if pr.get("status") != "Initiated":
return "This Payment Request was Already Fulfilled"

if pr.reference_name == payment_reference:
if pr.reference_name.strip().upper() == payment_reference.strip().upper():

awc_session = get_awc_session()
awc_session["gateway_selector_pr_access"] = pr.name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,70 @@
<form id="gateway-selector-billing-form" class="awc-form">
<div class="row no-gutter">
<div class="col-sm-12">
<div class="col-sm-6">
<div class="field required">
<label for="billing_title">Address Label</label>
<input id="billing_title" name="title" placeholder="Address Label" data-type="title" maxlength="35" />
</div>
</div>
<div class="col-sm-6">
<div class="field required">
<label for="billing_phone">Phone</label>
<input id="billing_phone" name="phone" placeholder="Contact Number" data-type="phone" maxlength="35" />
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field required">
<label for="billing_line1">Address</label>
<input id="billing_line1" name="address_1" placeholder="Address 1" data-type="address_1" maxlength="35"/>
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field">
<label for="billing_line2">Address 2</label>
<input id="billing_line2" name="address_2" placeholder="Address 2" data-type="address_2" maxlength="35"/>
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-6 nopad-right">
<div class="field required">
<label for="billing_city">City</label>
<input id="billing_city" name="city" placeholder="City" data-type="city" maxlength="35"/>
</div>
</div>
<div class="col-xs-3 nopad-right">
<div class="field">
<label for="billing_state">State</label>
<input id="billing_state" name="state" placeholder="State" data-type="state" maxlength="35"/>
</div>
</div>
<div class="col-xs-3 nopad-left">
<div class="field required">
<label for="billing_pincode">Postal Code</label>
<input id="billing_pincode" name="pincode" placeholder="Postal Code" data-type="pincode" maxlength="35"/>
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field required">
<label for="billing_country">Country</label>
<select id="billing_country" name="country" data-type="country">
<option selected>- Select Country -</option>
{% for country in billing_countries %}
<option value="{{country.name}}">{{country.country_name}}</option>
{% endfor %}
</select>
<span class="select-arrow glyphicon glyphicon-triangle-bottom"></span>
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field required">
<label for="billing_line1">Address</label>
<input id="billing_line1" name="address_1" placeholder="Address 1" data-type="address_1" maxlength="35" />
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field">
<label for="billing_line2">Address 2</label>
<input id="billing_line2" name="address_2" placeholder="Address 2" data-type="address_2" maxlength="35" />
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-6 nopad-right">
<div class="field required">
<label for="billing_city">City</label>
<input id="billing_city" name="city" placeholder="City" data-type="city" maxlength="35" />
</div>
</div>
<div class="col-xs-3 nopad-right">
<div class="field">
<label for="billing_state">State</label>
<input id="billing_state" name="state" placeholder="State" data-type="state" maxlength="35" />
</div>
</div>
<div class="col-xs-3 nopad-left">
<div class="field required">
<label for="billing_pincode">Postal Code</label>
<input id="billing_pincode" name="pincode" placeholder="Postal Code" data-type="pincode" maxlength="35" />
</div>
</div>
</div>
<div class="row no-gutter">
<div class="col-sm-12">
<div class="field required">
<label for="billing_country">Country</label>
<select id="billing_country" name="country" data-type="country">
<option selected>- Select Country -</option>
{% for country in billing_countries %}
<option value="{{country.name}}">{{country.country_name}}</option>
{% endfor %}
</select>
<span class="select-arrow glyphicon glyphicon-triangle-bottom"></span>
</div>
</div>
</div>
</form>
<div style="text-align: center;">
<button style="display: inline; margin-right: 10px;" class="btn btn-default btn-primary btn-back">Back</button>
<button style="display: inline;" class="btn btn-default btn-primary btn-nextbtn">Next</button>
</div>
<div style="text-align: center;">
<button style="display: inline; margin-right: 10px;" class="btn btn-default btn-primary btn-back">Back</button>
<button style="display: inline;" class="btn btn-default btn-primary btn-nextbtn">Next</button>
</div>
6 changes: 6 additions & 0 deletions gateway_selector/templates/pages/payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ def get_context(context):
except:
proxy = None

if isinstance(payment_request_name, unicode):
payment_request_name = payment_request_name.strip().upper()

context["payment_request_name"] = form.get("payment_request_name", payment_request_name)
context["payment_reference"] = form.get("payment_reference")

if isinstance(context["payment_reference"], unicode):
context["payment_reference"] = context["payment_reference"].strip().upper()

return context

0 comments on commit 35241b0

Please sign in to comment.