diff --git a/app/config.py b/app/config.py index f92347d9d..487afa31a 100644 --- a/app/config.py +++ b/app/config.py @@ -1,3 +1,4 @@ +import json import os if os.environ.get('VCAP_APPLICATION'): @@ -78,6 +79,19 @@ class Config(object): NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553' + NOTIFY_BILLING_DETAILS = json.loads( + os.environ.get('NOTIFY_BILLING_DETAILS') or 'null' + ) or { + 'account_number': '98765432', + 'sort_code': '01-23-45', + 'IBAN': 'GB33BUKB20201555555555', + 'swift': 'ABCDEF12', + 'notify_billing_email_addresses': [ + 'generic@digital.cabinet-office.gov.uk', + 'first.last@digital.cabinet-office.gov.uk', + ] + } + class Development(Config): NOTIFY_LOG_PATH = 'application.log' diff --git a/app/main/views/index.py b/app/main/views/index.py index 57d537796..f37a2b3c7 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -1,5 +1,6 @@ from flask import ( abort, + current_app, make_response, redirect, render_template, @@ -86,6 +87,7 @@ def billing_details(): if current_user.is_authenticated: return render_template( 'views/pricing/billing-details.html', + billing_details=current_app.config['NOTIFY_BILLING_DETAILS'], navigation_links=pricing_nav(), ) return render_template( diff --git a/app/templates/views/pricing/billing-details.html b/app/templates/views/pricing/billing-details.html index 9ee53b27c..e94216c63 100644 --- a/app/templates/views/pricing/billing-details.html +++ b/app/templates/views/pricing/billing-details.html @@ -39,12 +39,11 @@

@@ -82,7 +81,7 @@
{{ copy_to_clipboard( - '98765432', + billing_details['account_number'], name='Account number', thing='account number', ) }} @@ -90,7 +89,7 @@
{{ copy_to_clipboard( - '01-23-45', + billing_details['sort_code'], name='Sort code', thing='sort code', ) }} @@ -98,7 +97,7 @@
{{ copy_to_clipboard( - 'GB33BUKB20201555555555', + billing_details['IBAN'], name='IBAN', thing='IBAN', ) }} @@ -106,7 +105,7 @@
{{ copy_to_clipboard( - 'ABCDEF12', + billing_details['swift'], name='Swift code', thing='Swift code', ) }} diff --git a/manifest.yml.j2 b/manifest.yml.j2 index f97dbc232..320eedd14 100644 --- a/manifest.yml.j2 +++ b/manifest.yml.j2 @@ -59,3 +59,5 @@ applications: REDIS_ENABLED: '{{ REDIS_ENABLED }}' REDIS_URL: '{{ REDIS_URL }}' + + NOTIFY_BILLING_DETAILS: '{{ NOTIFY_BILLING_DETAILS | tojson }}'