Skip to content

Commit

Permalink
feature/Tweak the main.html page for OBP Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Jul 3, 2024
1 parent 14e37de commit 6f404f3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/resources/static/js/main-html-obp-consent-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ function makePaymentOBP(button) {
console.log('Request Failed:', textStatus, error);
});
};
function clearMakePaymentOBP(button) {
let resultBox = $('#payment_details_obp_div');
resultBox.empty();
};

function getAccountDetails(button) {
let resultBox = $(button).siblings('.account_detail_obp').empty().append('<h3>Account Detail:</h3>');
let accountId = $(button).attr('account_id');
Expand All @@ -64,7 +61,7 @@ function getAccountDetails(button) {
});
};
function getBalances(button) {
let resultBox = $(button).siblings('.balances_obp').empty().append('<h3>Balance List:</h3>');
let resultBox = $(button).siblings('.balances_obp').empty().append('<h3>Balances:</h3>');
let bankId = $(button).attr('bank_id');
let accountId = $(button).attr('account_id');
const viewHtmlId = "views-" + accountId;
Expand All @@ -77,7 +74,7 @@ function getBalances(button) {
});
};
function getTransactions(button) {
let resultBox = $(button).siblings('.transactions_obp').empty().append('<h3>Transaction List:</h3>');
let resultBox = $(button).siblings('.transactions_obp').empty().append('<h3>Transactions:</h3>');
let bankId = $(button).attr('bank_id');
let accountId = $(button).attr('account_id');
const viewHtmlId = "views-" + accountId;
Expand Down Expand Up @@ -113,7 +110,7 @@ $(function () {
});
$('#get_accounts_obp').click(function () {
$.getJSON("/account_obp", function (data) {
const container = $('#account_list_obp').empty().append('<h1>Account List:</h1>');
const container = $('#account_list_obp').empty().append('<h1>Accounts:</h1>');
if (data.code > 399 ) {
let zson = JSON.stringify(data, null, 2);
container.append(`<pre>${zson}</pre>`).append('<br>');
Expand All @@ -126,6 +123,7 @@ $(function () {
const viewHtmlId = "views-" + accountId;

container.append(`
<div><h2>Account ID: ${accountId}</2></div>
<div>
<div id=${iconId} style="cursor:pointer;" onclick="copyJsonResultToClipboard(this)" class="fa-solid fa-copy"></div><pre><div id=${resultBoxId}>${zson}</div></pre><br>
<button onclick="getAccountDetails(this)" id="get_account_detail_obp_${account['id']}" class="btn btn-success" account_id="${account['id']}" bank_id="${account['bank_id']}" >Get Account detail</button>
Expand Down

0 comments on commit 6f404f3

Please sign in to comment.