Skip to content

Conversation

priyanshu-ap
Copy link
Contributor

No description provided.

server.js Outdated

// store the token request
var request = await member.storeTokenRequest(tokenRequest);
var requestId = request.id;
tokenRequestId = request.id;
const d = "http://localhost:5000/app/request-token/" + requestId;
console.log('d', d)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm log pls

server.js Outdated
app.get('/callback', urlencodedParser, async function (req, res){
var redirectUrl = req.protocol + '://' + req.get('host') + req.url;
var queryData = Token.parseSetTransferDestinationsUrl(redirectUrl);
if(queryData.supportedTransferDestinationTypes && queryData.supportedTransferDestinationTypes.includes('SEPA')){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing after keywords, if and before {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

server.js Outdated
@@ -11,7 +11,7 @@ var urlencodedParser = bodyParser.json({ extended: false });
var TokenClient = require('@token-io/tpp').TokenClient; // main Token SDK entry object

// Connect to Token's development sandbox, if you change this, you also need to change window.Token({env}) in client.js
var Token = new TokenClient({ env: 'sandbox', developerKey: '4qY7lqQw8NOl9gng0ZHgT4xdiDqxqoGVutuZwrUYQsI', keyDir: './keys' });
var Token = new TokenClient({ env: 'dev', developerKey: '4qY7lqQw8NOl9gng0ZHgT4xdiDqxqoGVutuZwrUYQsI', keyDir: './keys' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we change this to dev? Would you need to change the developerKey (to make sure this works for dev)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think there is a need to change the key. I think it's same for all env unless we pass some other

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but why are we changing this from sandbox to dev?

Copy link

@daniellin215 daniellin215 May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

popup + one step breaks Uncaught (in promise) EXCEPTION_INVALID_BANK: Could not find bank with ID ngp-cbi-05034

This bank needs a dev key in dev environment, in sandbox it will not need one. https://github.com/tokenio/configurations/blob/09694b2cfa431b35006513a5d7cd25c9f8732ff1/banks/nextgenpsd2.k8s.conf#L1282

You need to use global-test as the dev key

@priyanshu-ap priyanshu-ap requested a review from daniellin215 May 25, 2020 11:27
server.js Outdated
@@ -596,8 +596,10 @@ async function initServer(member, alias) {

app.get('/callback', urlencodedParser, async function (req, res){
var redirectUrl = req.protocol + '://' + req.get('host') + req.url;
console.log('object', req.protocol + '://' + req.get('host'))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the logs.

server.js Outdated
var queryData = Token.parseSetTransferDestinationsUrl(redirectUrl);
if(queryData.supportedTransferDestinationTypes && queryData.supportedTransferDestinationTypes.includes('SEPA')){
console.log('object', queryData.supportedTransferDestinationTypes)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link

@daniellin215 daniellin215 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you walked through the flows to make sure they work? Cross border with pop up throws the following:

xhr.js:178 Refused to connect to 'http://localhost:3000/callback?bankName=Wood%20Bank&country=GB&supportedTransferDestinationTypes=FASTER_PAYMENTS&supportedTransferDestinationTypes=SEPA&supportedTransferDestinationTypes=BACS&supportedTransferDestinationTypes=CHAPS' because it violates the following Content Security Policy directive: "connect-src *.token.io".

server.js Outdated
@@ -11,7 +11,7 @@ var urlencodedParser = bodyParser.json({ extended: false });
var TokenClient = require('@token-io/tpp').TokenClient; // main Token SDK entry object

// Connect to Token's development sandbox, if you change this, you also need to change window.Token({env}) in client.js
var Token = new TokenClient({ env: 'sandbox', developerKey: '4qY7lqQw8NOl9gng0ZHgT4xdiDqxqoGVutuZwrUYQsI', keyDir: './keys' });
var Token = new TokenClient({ env: 'dev', developerKey: '4qY7lqQw8NOl9gng0ZHgT4xdiDqxqoGVutuZwrUYQsI', keyDir: './keys' });
Copy link

@daniellin215 daniellin215 May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

popup + one step breaks Uncaught (in promise) EXCEPTION_INVALID_BANK: Could not find bank with ID ngp-cbi-05034

This bank needs a dev key in dev environment, in sandbox it will not need one. https://github.com/tokenio/configurations/blob/09694b2cfa431b35006513a5d7cd25c9f8732ff1/banks/nextgenpsd2.k8s.conf#L1282

You need to use global-test as the dev key

@priyanshu-ap
Copy link
Contributor Author

@daniellin215 Can you try to do testing on local web-app. You can first generate a web-app URL having request-id and then change URL to localhost:5000. and test this functionality. It is working in that scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants