3.2.3 • Published 6 months ago

edenred-transactions v3.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Node.js module to retrieve transactions from an Edenred card.

NOTE: Only tested with the Portuguese version (https://www.myedenred.pt)

Installation

Install the package using npm:

npm install edenred-transactions

After installing, import it into your project:

import edenred from 'edenred-transactions';

Example

Saving transactions to a CSV file:

import edenred from 'edenred-transactions';
try {
    await edenred.login({
        user: 'your-email@provider.com',
        password: 'YourPassword123456'
    });
    const transactions = await edenred.getTransactions(); 
    edenred.saveTransactions(transactions);
} catch(err) {
    console.error(err);
}

Methods

login

Logs in with the provided credentials.

edenred.login({
    endpoint: 'https://www.myedenred.pt/edenred-customer/api',
    user: 'your-email@provider.com',
    password: 'YourPassword123456'
});
PropertyDefinition
endpointOptional; defaults to the Portuguese endpoint
userThe user name or e-mail address
passwordThe user password

In order to validate the login process, the app will prompt the user to enter the 2FA code that is sent to their e-mail. This function returns the authentication token for later use, if needed.

getTransactions

Retrieves transactions for a specific card. If no card identification is provided, the app will attempt to retrieve one from the first card in the user's account.

edenred.getTransactions('123456');

saveTransactions

Saves the transactions to a file, either in CSV or JSON format.\ Use the second parameter in boolean to indicate whether to save in CSV format, which defaults to true.\ The third parameter indicates the folder where the file will be saved. Default is transactions.

edenred.saveTransactions(transactionsArray, false, 'some-folder');
3.2.2

6 months ago

3.2.1

7 months ago

3.2.0

7 months ago

3.2.3

6 months ago

3.1.0

8 months ago

3.0.0

8 months ago

2.0.1

12 months ago

2.0.0

12 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.0

3 years ago