diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index 00dc618..2b18a62 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -13,9 +13,9 @@
 class Subscription(Document):
 	def before_insert(self):
 		# update start just before the subscription doc is created
-		self.update_subscription_period(self.start, init=True)
+		self.update_subscription_period(self.start)
 
-	def update_subscription_period(self, date=None, init=False):
+	def update_subscription_period(self, date=None):
 		"""
 		Subscription period is the period to be billed. This method updates the
 		beginning of the billing period and end of the billing period.
@@ -25,7 +25,7 @@
 		as `current_invoice_end`.
 		"""
 		self.set_current_invoice_start(date)
-		self.set_current_invoice_end(init=False)
+		self.set_current_invoice_end()
 
 	def set_current_invoice_start(self, date=None):
 		"""
@@ -40,7 +40,7 @@
 		else:
 			self.current_invoice_start = nowdate()
 
-	def set_current_invoice_end(self, init=False):
+	def set_current_invoice_end(self):
 		"""
 		This sets the date of the end of the current billing period.
 
@@ -51,9 +51,7 @@
 		current billing period where `x` is the billing interval from the
 		`Subscription Plan` in the `Subscription`.
 		"""
-		if init==True:
-			return
-		elif self.is_trialling():
+		if self.is_trialling():
 			self.current_invoice_end = self.trial_period_end
 		else:
 			billing_cycle_info = self.get_billing_cycle_data()
diff --git a/erpnext/templates/pages/integrations/__init__.py b/erpnext/templates/pages/integrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/templates/pages/integrations/__init__.py
diff --git a/erpnext/templates/pages/integrations/gocardless_checkout.html b/erpnext/templates/pages/integrations/gocardless_checkout.html
new file mode 100644
index 0000000..bbe5640
--- /dev/null
+++ b/erpnext/templates/pages/integrations/gocardless_checkout.html
@@ -0,0 +1,16 @@
+{% extends "templates/web.html" %}
+
+{% block title %} Payment {% endblock %}
+
+{%- block header -%}{% endblock %}
+
+{% block script %}
+<script>{% include "templates/includes/integrations/gocardless_checkout.js" %}</script>
+{% endblock %}
+
+{%- block page_content -%}
+<p class='lead text-center centered'>
+	<span class='gocardless-loading'>{{ _("Loading Payment System") }}</span>
+</p>
+
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/integrations/gocardless_checkout.py b/erpnext/templates/pages/integrations/gocardless_checkout.py
new file mode 100644
index 0000000..2ba7001
--- /dev/null
+++ b/erpnext/templates/pages/integrations/gocardless_checkout.py
@@ -0,0 +1,76 @@
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import flt
+import json
+from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import gocardless_initialization, get_gateway_controller
+from frappe.utils import get_url
+
+no_cache = 1
+no_sitemap = 1
+
+expected_keys = ('amount', 'title', 'description', 'reference_doctype', 'reference_docname',
+	'payer_name', 'payer_email', 'order_id', 'currency')
+
+def get_context(context):
+	context.no_cache = 1
+
+	# all these keys exist in form_dict
+	if not (set(expected_keys) - set(frappe.form_dict.keys())):
+		for key in expected_keys:
+			context[key] = frappe.form_dict[key]
+
+		context['amount'] = flt(context['amount'])
+
+		gateway_controller = get_gateway_controller(context.reference_docname)
+		context['header_img'] = frappe.db.get_value("GoCardless Settings", gateway_controller, "header_img")
+
+	else:
+		frappe.redirect_to_message(_('Some information is missing'),
+			_('Looks like someone sent you to an incomplete URL. Please ask them to look into it.'))
+		frappe.local.flags.redirect_location = frappe.local.response.location
+		raise frappe.Redirect
+
+@frappe.whitelist(allow_guest=True)
+def check_mandate(data, reference_doctype, reference_docname):
+	data = json.loads(data)
+
+	client = gocardless_initialization(reference_docname)
+
+	payer = frappe.get_doc("Customer", data["payer_name"])
+
+	if payer.customer_type == "Individual" and payer.customer_primary_contact is not None:
+		primary_contact = frappe.get_doc("Contact", payer.customer_primary_contact)
+		prefilled_customer = {
+			"company_name": payer.name,
+			"given_name": primary_contact.first_name,
+			"family_name": primary_contact.last_name,
+		}
+		if primary_contact.email_id is not None:
+			prefilled_customer.update({"email": primary_contact.email_id})
+		else:
+			prefilled_customer.update({"email": frappe.session.user})
+
+	else:
+		prefilled_customer = {
+			"company_name": payer.name,
+			"email": frappe.session.user
+		}
+
+	success_url = get_url("./integrations/gocardless_confirmation?reference_doctype=" + reference_doctype + "&reference_docname=" + reference_docname)
+
+	try:
+		redirect_flow = client.redirect_flows.create(params={
+							"description": _("Pay {0} {1}".format(data['amount'], data['currency'])),
+							"session_token": frappe.session.user,
+							"success_redirect_url": success_url,
+							"prefilled_customer": prefilled_customer
+						})
+
+		return {"redirect_to": redirect_flow.redirect_url}
+
+	except Exception as e:
+		frappe.log_error(e, "GoCardless Payment Error")
+		return {"redirect_to": '/integrations/payment-failed'}
\ No newline at end of file
diff --git a/erpnext/templates/pages/integrations/gocardless_confirmation.html b/erpnext/templates/pages/integrations/gocardless_confirmation.html
new file mode 100644
index 0000000..1567487
--- /dev/null
+++ b/erpnext/templates/pages/integrations/gocardless_confirmation.html
@@ -0,0 +1,16 @@
+{% extends "templates/web.html" %}
+
+{% block title %} Payment {% endblock %}
+
+{%- block header -%}{% endblock %}
+
+{% block script %}
+<script>{% include "templates/includes/integrations/gocardless_confirmation.js" %}</script>
+{% endblock %}
+
+{%- block page_content -%}
+<p class='lead text-center centered'>
+	<span class='gocardless-loading'>{{ _("Payment Confirmation") }}</span>
+</p>
+
+{% endblock %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/integrations/gocardless_confirmation.py b/erpnext/templates/pages/integrations/gocardless_confirmation.py
new file mode 100644
index 0000000..069d900
--- /dev/null
+++ b/erpnext/templates/pages/integrations/gocardless_confirmation.py
@@ -0,0 +1,85 @@
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.erpnext_integrations.doctype.gocardless_settings.gocardless_settings import gocardless_initialization, get_gateway_controller
+
+no_cache = 1
+no_sitemap = 1
+
+expected_keys = ('redirect_flow_id', 'reference_doctype', 'reference_docname')
+
+def get_context(context):
+	context.no_cache = 1
+
+	# all these keys exist in form_dict
+	if not (set(expected_keys) - set(frappe.form_dict.keys())):
+		for key in expected_keys:
+			context[key] = frappe.form_dict[key]
+
+	else:
+		frappe.redirect_to_message(_('Some information is missing'),
+			_('Looks like someone sent you to an incomplete URL. Please ask them to look into it.'))
+		frappe.local.flags.redirect_location = frappe.local.response.location
+		raise frappe.Redirect
+
+@frappe.whitelist(allow_guest=True)
+def confirm_payment(redirect_flow_id, reference_doctype, reference_docname):
+
+	client = gocardless_initialization(reference_docname)
+
+	try:
+		redirect_flow = client.redirect_flows.complete(
+			redirect_flow_id,
+			params={
+				"session_token": frappe.session.user
+		})
+
+		data = {
+			"mandate": redirect_flow.links.mandate,
+			"customer": redirect_flow.links.customer,
+			"redirect_to": redirect_flow.confirmation_url,
+			"redirect_message": "Mandate successfully created",
+			"reference_doctype": reference_doctype,
+			"reference_docname": reference_docname
+		}
+
+		try:
+			create_mandate(data)
+		except Exception as e:
+			frappe.log_error(e, "GoCardless Mandate Registration Error")
+
+		gateway_controller = get_gateway_controller(reference_docname)
+		frappe.get_doc("GoCardless Settings", gateway_controller).create_payment_request(data)
+
+		return {"redirect_to": redirect_flow.confirmation_url}
+
+	except Exception as e:
+		frappe.log_error(e, "GoCardless Payment Error")
+		return {"redirect_to": '/integrations/payment-failed'}
+
+
+def create_mandate(data):
+	data = frappe._dict(data)
+	frappe.logger().debug(data)
+
+	mandate = data.get('mandate')
+
+	if frappe.db.exists("GoCardless Mandate", mandate):
+		return
+
+	else:
+		reference_doc = frappe.db.get_value(data.get('reference_doctype'), data.get('reference_docname'), ["reference_doctype", "reference_name"], as_dict=1)
+		erpnext_customer = frappe.db.get_value(reference_doc.reference_doctype, reference_doc.reference_name, ["customer_name"], as_dict=1)
+
+		try:
+			frappe.get_doc({
+			"doctype": "GoCardless Mandate",
+			"mandate": mandate,
+			"customer": erpnext_customer.customer_name,
+			"gocardless_customer": data.get('customer')
+			}).insert(ignore_permissions=True)
+
+		except Exception:
+			frappe.log_error(frappe.get_traceback())
\ No newline at end of file
