Skip to content

Commit

Permalink
Added integration to Open Banking Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
asburymr committed May 21, 2020
1 parent 6377cb4 commit 4568a1a
Show file tree
Hide file tree
Showing 34 changed files with 2,694 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM tomcat:9.0
EXPOSE 8080
COPY /target/bank##2.0.0.105.war /usr/local/tomcat/webapps/
COPY /target/bank##2.0.0.106.war /usr/local/tomcat/webapps/
COPY /target/classes/application.properties /usr/local/tomcat/conf/digitalbank.properties
HEALTHCHECK CMD curl -fail http://localhost:8080/bank/api/v1/health || exit 1
11 changes: 10 additions & 1 deletion docker-compose/docker-compose-h2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
# Digital Bank Service Configuration
# =====================================================================
bank:
image: asburymr/digitalbank:2.0.0.105
image: asburymr/digitalbank:2.0.0.106
container_name: bank
environment:

Expand Down Expand Up @@ -88,6 +88,15 @@ services:
IO_DEMO_BANK_VISA_PROTOCOL: https
IO_DEMO_BANK_VISA_HOST: creditservices.io
IO_DEMO_BANK_VISA_PORT:

# Open Banking API Service
IO_DEMO_BANK_OBP_ENABLED: 'true'
IO_DEMO_BANK_OBP_CONSUMER_KEY: vwfpvwfr1kngt0up2jelebzmvxrhst4vhxvw1jm3
IO_DEMO_BANK_OBP_VERSION: v4.0.0
IO_DEMO_BANK_OBP_PROTOCOL: https
IO_DEMO_BANK_OBP_HOST:
IO_DEMO_BANK_OBP_PORT:


ports:
- "8080:8080"
Expand Down
10 changes: 9 additions & 1 deletion docker-compose/docker-compose-mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ services:
# Digital Bank Service Configuration
# =====================================================================
bank:
image: asburymr/digitalbank:2.0.0.105
image: asburymr/digitalbank:2.0.0.106
container_name: bank
environment:

Expand Down Expand Up @@ -116,6 +116,14 @@ services:
IO_DEMO_BANK_VISA_HOST: creditservices.io
IO_DEMO_BANK_VISA_PORT:

# Open Banking API Service
IO_DEMO_BANK_OBP_ENABLED: 'true'
IO_DEMO_BANK_OBP_CONSUMER_KEY: vwfpvwfr1kngt0up2jelebzmvxrhst4vhxvw1jm3
IO_DEMO_BANK_OBP_VERSION: v4.0.0
IO_DEMO_BANK_OBP_PROTOCOL: https
IO_DEMO_BANK_OBP_HOST:
IO_DEMO_BANK_OBP_PORT:

# Database Configuration
SPRING_DATASOURCE_PLATFORM: mssql
SPRING_DATASOURCE_USERNAME: digitaluser
Expand Down
10 changes: 9 additions & 1 deletion docker-compose/docker-compose-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ services:
# Digital Bank Service Configuration
# =====================================================================
bank:
image: asburymr/digitalbank:2.0.0.105
image: asburymr/digitalbank:2.0.0.106
container_name: bank
environment:

Expand Down Expand Up @@ -118,6 +118,14 @@ services:
IO_DEMO_BANK_VISA_PROTOCOL: https
IO_DEMO_BANK_VISA_HOST: creditservices.io
IO_DEMO_BANK_VISA_PORT:

# Open Banking API Service
IO_DEMO_BANK_OBP_ENABLED: 'true'
IO_DEMO_BANK_OBP_CONSUMER_KEY: vwfpvwfr1kngt0up2jelebzmvxrhst4vhxvw1jm3
IO_DEMO_BANK_OBP_VERSION: v4.0.0
IO_DEMO_BANK_OBP_PROTOCOL: https
IO_DEMO_BANK_OBP_HOST:
IO_DEMO_BANK_OBP_PORT:

# Database Configuration
SPRING_DATASOURCE_PLATFORM: mysql
Expand Down
10 changes: 9 additions & 1 deletion docker-compose/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ services:
# Digital Bank Service Configuration
# =====================================================================
bank:
image: asburymr/digitalbank:2.0.0.105
image: asburymr/digitalbank:2.0.0.106
container_name: bank
environment:

Expand Down Expand Up @@ -113,6 +113,14 @@ services:
IO_DEMO_BANK_VISA_PROTOCOL: https
IO_DEMO_BANK_VISA_HOST: creditservices.io
IO_DEMO_BANK_VISA_PORT:

# Open Banking API Service
IO_DEMO_BANK_OBP_ENABLED: 'true'
IO_DEMO_BANK_OBP_CONSUMER_KEY: vwfpvwfr1kngt0up2jelebzmvxrhst4vhxvw1jm3
IO_DEMO_BANK_OBP_VERSION: v4.0.0
IO_DEMO_BANK_OBP_PROTOCOL: https
IO_DEMO_BANK_OBP_HOST:
IO_DEMO_BANK_OBP_PORT:

# Database Configuration
SPRING_DATASOURCE_PLATFORM: postgres
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,55 @@
"name": "io.demo.credit.enabled",
"type": "java.lang.String",
"description": "A description for 'io.demo.credit.enabled'"
},
{
"name": "io.demo.bank.obp.enabled",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.enabled'"
},
{
"name": "io.demo.bank.obp.protocol",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.protocol'"
},
{
"name": "io.demo.bank.obp.host",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.host'"
},
{
"name": "io.demo.bank.obp.port",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.port'"
},
{
"name": "io.demo.bank.obp.version",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.version'"
},
{
"name": "io.demo.bank.obp.user",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.user'"
},
{
"name": "io.demo.bank.obp.password",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.password'"
},
{
"name": "io.demo.bank.obp.consumer_key",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.consumer_key'"
},
{
"name": "io.demo.bank.obp.enabled",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.enabled'"
},
{
"name": "io.demo.bank.obp.consumer_key",
"type": "java.lang.String",
"description": "A description for 'io.demo.bank.obp.consumer_key'"
}
]}
33 changes: 33 additions & 0 deletions src/main/java/io/demo/bank/controller/web/WebCommonController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.ui.Model;
import io.demo.bank.model.security.Users;
import io.demo.bank.service.CreditCardService;
import io.demo.bank.service.ObpService;
import io.demo.bank.service.UserService;
import io.demo.bank.util.Constants;
import io.demo.bank.util.Patterns;
Expand All @@ -31,6 +32,9 @@ abstract class WebCommonController {
@Autowired
private CreditCardService ccService;

@Autowired
private ObpService obpService;

// private model attribute constants
private static final String MODEL_ATT_FIRST_NAME = "firstName";
private static final String MODEL_ATT_NOTIFICATIONS = "notifications";
Expand Down Expand Up @@ -106,6 +110,19 @@ abstract class WebCommonController {
public static final String MODEL_ATT_EXT_AMOUNT = "extAmount";
public static final String MODEL_ATT_EXT_RESPONSE = "visaResponse";

// model attribute constants -> Open Banking Project
public static final String MODEL_OBP_ENABLED = "obpEnabled";
public static final String MODEL_OBP_BANKS = "bankList";
public static final String MODEL_OBP_BANK_ID = "bankId";
public static final String MODEL_OBP_BANK = "bank";
public static final String MODEL_OBP_USERNAME = "username";
public static final String MODEL_OBP_PASSWORD = "password";
public static final String MODEL_OBP_ACCOUNT_ID = "accountId";
public static final String MODEL_OBP_ACCOUNTS = "accountList";
public static final String MODEL_OBP_TRANSACTIONS = "transactionList";
public static final String MODEL_OBP_HAS_LINKED_ACCT = "obpLinked";
public static final String MODEL_OBP_DELETE_ID = "deleteId";



/*
Expand Down Expand Up @@ -170,6 +187,22 @@ else if (ccService.userHasApplication(user)) {
}
}

// Check to see if we should enable the OBP Menu
if (obpService.isObpServiceEnabled()) {

LOG.debug("Open Banking Service is Enabled.");

// Determine what menu option to show
model.addAttribute(MODEL_OBP_ENABLED, true);

if (obpService.userHasLinkedAccount(user)) {

LOG.debug("User has linked accounts with the Open Banking Service.");

model.addAttribute(MODEL_OBP_HAS_LINKED_ACCT, true);
}
}

LOG.debug("End setting display defaults.");
}

Expand Down
Loading

0 comments on commit 4568a1a

Please sign in to comment.