Skip to content

Issue 1 private api#21

Open
PaIIadium wants to merge 10 commits intomainfrom
issue-1-private-api
Open

Issue 1 private api#21
PaIIadium wants to merge 10 commits intomainfrom
issue-1-private-api

Conversation

@PaIIadium
Copy link

No description provided.

Copy link
Member

@ALEGATOR1209 ALEGATOR1209 left a comment

Choose a reason for hiding this comment

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

Where is implementation of Bank Data Source

* @property {number} cardId - Card's id in Lemon DB.
* @property {string} bank - Name of the bank card belongs to
* @property {number} cardNum - Card number (can be either all number or last 4 digits only)
* @property {number} cardNum - Card number (must be full number)
Copy link
Member

Choose a reason for hiding this comment

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

Why so?

Copy link
Author

Choose a reason for hiding this comment

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

Because Privat API needs full number of card (check data sample in privat24.js)

Copy link
Member

Choose a reason for hiding this comment

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

But other API's don't. And don't provide it.

@@ -1,5 +1,3 @@
'use strict';
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Author

Choose a reason for hiding this comment

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

Because of eslint error

Copy link
Member

Choose a reason for hiding this comment

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

It can't be an ESLint error...

Copy link
Author

Choose a reason for hiding this comment

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

image

@ALEGATOR1209 ALEGATOR1209 linked an issue Jan 8, 2021 that may be closed by this pull request
5 tasks
@ALEGATOR1209 ALEGATOR1209 added this to the Server milestone Jan 8, 2021
@ALEGATOR1209 ALEGATOR1209 added the bank API Issue about implementation of Banks API label Jan 8, 2021
Comment on lines 163 to 164
merchantPassword: '55x3Ft9C96yx7s1cAMO2KVn1apuDA0X6',
merchantId: 123456,
Copy link
Member

Choose a reason for hiding this comment

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

Don't commit things like this!

Copy link
Contributor

Choose a reason for hiding this comment

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

Move it to some sort of config file maybe?

Comment on lines 183 to 190
// example of using
(async () => {
const tranData = await getTransactionsData(dataForTransactionsRequest);
const balanceData = await getBalanceData([dataForBalanceRequest]);
// dataForBalanceRequest is array of data objects
console.log(tranData);
console.log(balanceData);
})();
Copy link
Member

Choose a reason for hiding this comment

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

Move it to another file, it shouldn't been executed every time we use this file

Copy link
Author

Choose a reason for hiding this comment

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

Ok, i will just put this in comment

Comment on lines 193 to 206
class PrivatDataSource extends BankDataSource {
constructor() {
super();
}
// conf is similar to dataForTransactionsRequest
async getTransactions(card, conf) {
conf.cardNumber = card.cardNum + '';
return await getTransactionsData(conf);
}
// additional method for getting balances of cards array
// conf is array of objects similar to dataForBalanceRequest
async getBalance(conf) {
return await getBalanceData(conf);
}
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you put declarations of these functions inside class methods?

Comment on lines 163 to 164
merchantPassword: '55x3Ft9C96yx7s1cAMO2KVn1apuDA0X6',
merchantId: 123456,
Copy link
Contributor

Choose a reason for hiding this comment

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

Move it to some sort of config file maybe?

@ALEGATOR1209 ALEGATOR1209 temporarily deployed to lemon-server-pr-21 June 3, 2021 23:11 Inactive
}

module.exports = BankDataSource;

Copy link
Contributor

Choose a reason for hiding this comment

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

Why delete newline?

Copy link
Author

Choose a reason for hiding this comment

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

Why delete newline?

It was a mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bank API Issue about implementation of Banks API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Privat24 API

4 participants