diff --git a/.gitignore b/.gitignore index 82d8c5c..bb95aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ apimanager/apimanager/local_settings.py .idea API-Manager.iml apimanager/.DS_Store -venv \ No newline at end of file +venv +.env \ No newline at end of file diff --git a/apimanager/.env b/apimanager/.env new file mode 100644 index 0000000..5762de9 --- /dev/null +++ b/apimanager/.env @@ -0,0 +1 @@ +OAUTH_CONSUMER_KEY = dmi4bhpdjtsjka5ed5a32wawitwwfftm4xoiksnu \ No newline at end of file diff --git a/apimanager/atms/forms.py b/apimanager/atms/forms.py index 1297832..d606cf9 100644 --- a/apimanager/atms/forms.py +++ b/apimanager/atms/forms.py @@ -29,6 +29,7 @@ class CreateAtmForm(forms.Form): ), choices=[], ) + name = forms.CharField( label='Name', widget=forms.TextInput( @@ -39,6 +40,7 @@ class CreateAtmForm(forms.Form): ), required=True ) + address = forms.CharField( label='Address', widget=forms.Textarea( @@ -103,16 +105,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) - """drive_up = forms.CharField( - label='Drive Up', - widget=forms.Textarea( - attrs={ - 'placeholder': 'None', # noqa - 'class': 'form-control', - } - ), - required=False, - )""" + located_at = forms.CharField( label='ATM location', widget=forms.TextInput( @@ -123,6 +116,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) + is_accessible = forms.ChoiceField( label='is accessible', widget=forms.Select( @@ -132,6 +126,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) + accessibleFeatures = forms.CharField( label='Accessible Features', widget=forms.TextInput( @@ -142,6 +137,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) + services = forms.CharField( label='Services', widget=forms.TextInput( @@ -152,6 +148,7 @@ class CreateAtmForm(forms.Form): ), required=False, ) + more_info = forms.CharField( label='More information', widget=forms.TextInput( @@ -172,24 +169,27 @@ class CreateAtmForm(forms.Form): ), required=False, ) + notes = forms.ChoiceField( - label='Write Notes', - widget=forms.Select( - attrs={ - 'class': 'form-control', - } - ), - required=False, - ) + label='Write Notes', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + location_categories = forms.ChoiceField( - label='Write location Category', - widget=forms.Select( - attrs={ - 'class': 'form-control', - } - ), - required=False, - ) + label='Write location Category', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + minimum_withdrawal = forms.CharField( label='Minimum Withdrawal', widget=forms.TextInput( @@ -200,97 +200,103 @@ class CreateAtmForm(forms.Form): ), required=False, ) + site_name = forms.CharField( - label='Site Name', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Enter your Site Name ', - 'class': 'form-control', - } - ), - required=False, - ) + label='Site Name', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Site Name ', + 'class': 'form-control', + } + ), + required=False, + ) + branch_identification = forms.CharField( - label='Branch Identification', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Enter your Branch Identification', - 'class': 'form-control', - } - ), - required=False, - ) + label='Branch Identification', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Branch Identification', + 'class': 'form-control', + } + ), + required=False, + ) + site_identification = forms.CharField( - label='Site Identification', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Enter your Site Identification', - 'class': 'form-control', - } - ), - required=False, - ) + label='Site Identification', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Enter your Site Identification', + 'class': 'form-control', + } + ), + required=False, + ) services = forms.CharField( - label='Services', - widget=forms.TextInput( + label='Services', + widget=forms.TextInput( attrs={ 'placeholder': 'Services Are', 'class': 'form-control', - } - ), - required=False, - ) + } + ), + required=False, + ) supported_languages = forms.ChoiceField( - label='supported_languages', - widget=forms.Select( - attrs={ - 'class': 'form-control', - } - ), - required=False, - ) - has_deposit_capability = forms.ChoiceField( - label='Deposit Capabilities', - widget=forms.Select( - attrs={ - 'class': 'form-control', - } - ), - required=False, - ) - cash_withdrawal_national_fee = forms.CharField( - label='Cash Withdrawal National fee', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Cash withdrawal national fee', - 'class': 'form-control', - } - ), - required=False, - ) - cash_withdrawal_international_fee = forms.CharField( - label='Cash Withdrawal international fee', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Cash withdrawal international fee', - 'class': 'form-control', - } - ), - required=False, - ) - balance_inquiry_fee = forms.CharField( - label='Balance Inquiry Fee', - widget=forms.TextInput( - attrs={ - 'placeholder': 'Balance Inquiry Fee', - 'class': 'form-control', - } - ), - required=False, - ) + label='supported_languages', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + has_deposit_capability = forms.ChoiceField( + label='Deposit Capabilities', + widget=forms.Select( + attrs={ + 'class': 'form-control', + } + ), + required=False, + ) + + cash_withdrawal_national_fee = forms.CharField( + label='Cash Withdrawal National fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Cash withdrawal national fee', + 'class': 'form-control', + } + ), + required=False, + ) + + cash_withdrawal_international_fee = forms.CharField( + label='Cash Withdrawal international fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Cash withdrawal international fee', + 'class': 'form-control', + } + ), + required=False, + ) + + balance_inquiry_fee = forms.CharField( + label='Balance Inquiry Fee', + widget=forms.TextInput( + attrs={ + 'placeholder': 'Balance Inquiry Fee', + 'class': 'form-control', + } + ), + required=False, + ) def __init__(self, *args, **kwargs): kwargs.setdefault('label_suffix', '') diff --git a/apimanager/atms/templates/atms/index.html b/apimanager/atms/templates/atms/index.html index edd0f36..f49d92a 100644 --- a/apimanager/atms/templates/atms/index.html +++ b/apimanager/atms/templates/atms/index.html @@ -173,118 +173,114 @@
{% if form.cash_withdrawal_national_fee.errors %} -
{{ form.cash_withdrawal_national_fee.errors }}
{% endif %} -
{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }} -
-
- - -
-
- {% if form.balance_inquiry_fee.errors %} -
{{ form.balance_inquiry_fee.errors }}
{% endif %} -
- {{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }} -
-
-
- {% if form.cash_withdrawal_international_fee.errors %} -
{{ form.cash_withdrawal_international_fee.errors }}
{% endif %} -
- {{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }} -
+
{{ form.cash_withdrawal_national_fee.errors }}
{% endif %} +
{{ form.cash_withdrawal_national_fee.label_tag }} {{ form.cash_withdrawal_national_fee }}
-
-
- {% if form.address.errors %} -
{{ form.address.errors }}
{% endif %} -
- {{ form.address.label_tag }} {{ form.address }} +
-
-
- {% if form.lobby.errors %} -
{{ form.lobby.errors }}
{% endif %} -
- {{ form.lobby.label_tag }} {{ form.lobby }} +
+
+ {% if form.balance_inquiry_fee.errors %} +
{{ form.balance_inquiry_fee.errors }}
{% endif %} +
+ {{ form.balance_inquiry_fee.label_tag }} {{ form.balance_inquiry_fee }} +
+
+
+ {% if form.cash_withdrawal_international_fee.errors %} +
{{ form.cash_withdrawal_international_fee.errors }}
{% endif %} +
+ {{ form.cash_withdrawal_international_fee.label_tag }} {{ form.cash_withdrawal_international_fee }} +
+
+
+
+ {% if form.address.errors %} +
{{ form.address.errors }}
{% endif %} +
+ {{ form.address.label_tag }} {{ form.address }} +
+
+
+ {% if form.lobby.errors %} +
{{ form.lobby.errors }}
{% endif %} +
+ {{ form.lobby.label_tag }} {{ form.lobby }} +
+
+
+
+ +
+ + +
+ + + + + + + + + + {% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %} + + + + + + + + {% endfor %} + +
ATM IdBank IdATM NameMore_infoUpdate Button
{{ atm.id }}{{ atm.bank_id }}{{ atm.name }} +
+
    +
  • Address: +
      +
    • line1: {{atm.address.line_1}}
    • +
    • line2: {{atm.address.line_2}}
    • +
    • line3: {{atm.address.line_3}}
    • +
    • city: {{atm.address.city}}
    • +
    • county: {{atm.address.county}}
    • +
    • state: {{atm.address.state}}
    • +
    • postcode: {{atm.address.postcode}}
    • +
    • country_code: {{atm.address.country_code}}
    • +
    +
  • +
  • Location: +
      +
    • latitude: {{atm.location.latitude}}
    • +
    • longitude: {{atm.location.longitude}}
    • +
    +
  • +
  • Meta License: +
      +
    • id: {{atm.meta.license.id}}
    • +
    • name: {{atm.meta.license.name}}
    • +
    +
  • +
  • ATM Routing +
      +
    • Scheme: {{atm.atm_routing.scheme}}
    • +
    • Address: {{atm.atm_routing.address}}
    • +
    +
  • +
  • ATM Type: {{atm.branch_type}}
  • +
  • More Info: {{atm.more_info}}
  • + +
  • Accessible Features: {{atm.accessibleFeatures}}
  • +
+
+
Update
- - - - -
- -
- - -
- - - - - - - - - - {% for atm in atms_list %} {% url 'atms_update' atm.id atm.bank_id as url_atm_update %} - - - - - - - - {% endfor %} - -
ATM IdBank IdATM NameMore_infoUpdate Button
{{ atm.id }}{{ atm.bank_id }}{{ atm.name }} -
-
    -
  • Address: -
      -
    • line1: {{atm.address.line_1}}
    • -
    • line2: {{atm.address.line_2}}
    • -
    • line3: {{atm.address.line_3}}
    • -
    • city: {{atm.address.city}}
    • -
    • county: {{atm.address.county}}
    • -
    • state: {{atm.address.state}}
    • -
    • postcode: {{atm.address.postcode}}
    • -
    • country_code: {{atm.address.country_code}}
    • -
    -
  • -
  • Location: -
      -
    • latitude: {{atm.location.latitude}}
    • -
    • longitude: {{atm.location.longitude}}
    • -
    -
  • -
  • Meta License: -
      -
    • id: {{atm.meta.license.id}}
    • -
    • name: {{atm.meta.license.name}}
    • -
    -
  • -
  • ATM Routing -
      -
    • Scheme: {{atm.atm_routing.scheme}}
    • -
    • Address: {{atm.atm_routing.address}}
    • -
    -
  • -
  • ATM Type: {{atm.branch_type}}
  • -
  • More Info: {{atm.more_info}}
  • - -
  • Accessible Features: {{atm.accessibleFeatures}}
  • -
-
-
Update
-
-
-{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %} +{% endblock %} {% block extrajs %} {% endblock extrajs %} {% block extracss %} {% endblock extracss %} \ No newline at end of file diff --git a/apimanager/atms/templates/atms/update.html b/apimanager/atms/templates/atms/update.html index 8169785..ddb1311 100644 --- a/apimanager/atms/templates/atms/update.html +++ b/apimanager/atms/templates/atms/update.html @@ -1,169 +1,170 @@ -{% extends 'base.html' %} -{% load static %} - -{% block page_title %}{{ block.super }} / Atms{% endblock page_title %} - -{% block content %} +{% extends 'base.html' %} {% load static %} {% block page_title %}{{ block.super }} / Atms{% endblock page_title %} {% block content %}

Update atm

{{ bank_id }} : {{ atm_id }}

- {% csrf_token %} - {% if form.non_field_errors %} + {% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
- {% if form.name.errors %}
{{ form.name.errors }}
{% endif %} + {% if form.name.errors %} +
{{ form.name.errors }}
{% endif %}
- {{ form.name.label_tag }} - {{ form.name }} + {{ form.name.label_tag }} {{ form.name }}
- {% if form.location_latitude.errors %}
{{ form.location_latitude.errors }}
{% endif %} + {% if form.location_latitude.errors %} +
{{ form.location_latitude.errors }} +
{% endif %}
- {{ form.location_latitude.label_tag }} - {{ form.location_latitude }} + {{ form.location_latitude.label_tag }} {{ form.location_latitude }}
- {% if form.location_longitude.errors %}
{{ form.location_longitude.errors }}
{% endif %} + {% if form.location_longitude.errors %} +
{{ form.location_longitude.errors }} +
{% endif %}
- {{ form.location_longitude.label_tag }} - {{ form.location_longitude }} + {{ form.location_longitude.label_tag }} {{ form.location_longitude }}
- {% if form.meta_license_id.errors %}
{{ form.meta_license_id.errors }}
{% endif %} + {% if form.meta_license_id.errors %} +
{{ form.meta_license_id.errors }} +
{% endif %}
- {{ form.meta_license_id.label_tag }} - {{ form.meta_license_id }} + {{ form.meta_license_id.label_tag }} {{ form.meta_license_id }}
- {% if form.meta_license_name.errors %}
{{ form.meta_license_name.errors }}
{% endif %} + {% if form.meta_license_name.errors %} +
{{ form.meta_license_name.errors }} +
{% endif %}
- {{ form.meta_license_name.label_tag }} - {{ form.meta_license_name }} + {{ form.meta_license_name.label_tag }} {{ form.meta_license_name }}
- {% if form.accessibleFeatures.errors %}
{{ form.accessibleFeatures.errors }}
{% endif %} + {% if form.accessibleFeatures.errors %} +
{{ form.accessibleFeatures.errors }} +
{% endif %}
- {{ form.accessibleFeatures.label_tag }} - {{ form.accessibleFeatures }} + {{ form.accessibleFeatures.label_tag }} {{ form.accessibleFeatures }}
- {% if form.atm_routing_scheme.errors %}
{{ form.atm_routing_scheme.errors }}
{% endif %} + {% if form.atm_routing_scheme.errors %} +
{{ form.atm_routing_scheme.errors }} +
{% endif %}
- {{ form.atm_routing_scheme.label_tag }} - {{ form.atm_routing_scheme }} + {{ form.atm_routing_scheme.label_tag }} {{ form.atm_routing_scheme }}
- {% if form.atm_routing_address.errors %}
{{ form.branch_routing_address.errors }}
{% endif %} + {% if form.atm_routing_address.errors %} +
{{ form.branch_routing_address.errors }}
{% endif %}
- {{ form.atm_routing_address.label_tag }} - {{ form.atm_routing_address }} + {{ form.atm_routing_address.label_tag }} {{ form.atm_routing_address }}
- {% if form.is_accessible.errors %}
{{ form.is_accessible.errors }}
{% endif %} + {% if form.is_accessible.errors %} +
{{ form.is_accessible.errors }}
+ {% endif %}
- {{ form.is_accessible.label_tag }} - {{ form.is_accessible }} + {{ form.is_accessible.label_tag }} {{ form.is_accessible }}
- {% if form.services.errors %}
{{ form.services.errors }}
{% endif %} + {% if form.services.errors %} +
{{ form.services.errors }}
{% endif %}
- {{ form.services.label_tag }} - {{ form.services }} + {{ form.services.label_tag }} {{ form.services }}
- {% if form.more_info.errors %}
{{ form.more_info.errors }}
{% endif %} + {% if form.more_info.errors %} +
{{ form.more_info.errors }}
{% endif %}
- {{ form.more_info.label_tag }} - {{ form.more_info }} + {{ form.more_info.label_tag }} {{ form.more_info }}
- {% if form.supported_currencies.errors %}
{{ form.supported_currencies.errors }}
{% endif %} + {% if form.supported_currencies.errors %} +
{{ form.supported_currencies.errors }}
{% endif %}
- {{ form.supported_currencies.label_tag }} - {{ form.supported_currencies }} + {{ form.supported_currencies.label_tag }} {{ form.supported_currencies }}
- {% if form.services.errors %}
{{ form.services.errors }}
{% endif %} + {% if form.services.errors %} +
{{ form.services.errors }}
{% endif %}
- {{ form.services.label_tag }} - {{ form.services }} + {{ form.services.label_tag }} {{ form.services }}
- {% if form.has_deposit_capability.errors %}
{{ form.has_deposit_capability.errors }}
{% endif %} + {% if form.has_deposit_capability.errors %} +
{{ form.has_deposit_capability.errors }}
{% endif %}
- {{ form.has_deposit_capability.label_tag }} - {{ form.has_deposit_capability }} + {{ form.has_deposit_capability.label_tag }} {{ form.has_deposit_capability }}
-
+
- {% if form.address.errors %}
{{ form.address.errors }}
{% endif %} + {% if form.address.errors %} +
{{ form.address.errors }}
{% endif %}
- {{ form.address.label_tag }} - {{ form.address }} + {{ form.address.label_tag }} {{ form.address }}
- {% if form.lobby.errors %}
{{ form.lobby.errors }}
{% endif %} + {% if form.lobby.errors %} +
{{ form.lobby.errors }}
{% endif %}
- {{ form.lobby.label_tag }} - {{ form.lobby }} + {{ form.lobby.label_tag }} {{ form.lobby }}
- +
diff --git a/apimanager/obp/directlogin.py b/apimanager/obp/directlogin.py index f395a33..f68145b 100644 --- a/apimanager/obp/directlogin.py +++ b/apimanager/obp/directlogin.py @@ -5,6 +5,7 @@ DirectLogin authenticator for OBP app import requests +from apimanager import local_settings from django.conf import settings @@ -28,11 +29,14 @@ class DirectLoginAuthenticator(Authenticator): data is a dict which contains keys username, password and consumer_key """ + requestheaders['consumer_key']=local_settings.OAUTH_CONSUMER_KEY + #print("hello",local_settings.OAUTH_CONSUMER_KEY) url = settings.API_HOST + settings.DIRECTLOGIN_PATH authorization = 'DirectLogin username="{}",password="{}",consumer_key="{}"'.format( # noqa requestheaders['username'], requestheaders['password'], - requestheaders['consumer_key']) + requestheaders['consumer_key'] + ) headers = {'Authorization': authorization} try: diff --git a/apimanager/obp/forms.py b/apimanager/obp/forms.py index 24ad01f..b836af8 100644 --- a/apimanager/obp/forms.py +++ b/apimanager/obp/forms.py @@ -15,8 +15,8 @@ class DirectLoginForm(forms.Form): attrs={'class': 'form-control'})) password = forms.CharField(widget=forms.PasswordInput( attrs={'class': 'form-control'})) - consumer_key = forms.CharField(widget=forms.TextInput( - attrs={'class': 'form-control'})) + #consumer_key = forms.CharField(widget=forms.TextInput( + #attrs={'class': 'form-control'})) def clean(self): """