Open ekkis opened 2 years ago
I've had a gander at the code. I can see that the missing information is in the config/default.json
in the package but I don't see that the code loads that anywhere
changing the constructor to something like this makes it work:
module.exports = class {
constructor(cfg = {}) {
this.config = Object.assign(require('./config/default.json'), cfg);
}
also missing from the documentation is the fact that the client initialisation needs to be given credentials. something like this:
const client = new Client(require('./config/sandbox.json'))
with a little modification to the code it could be called without a parameter. my recommendation would be that for niladic calls the code look in ./acogd
for the files and that it use the NODE_ENV
environment variable to look for the name of the file, defaulting to development if not set
if the above is acceptable I'm happy to submit a PR
as a nice enhancement, I would make the call to createGiftCard
accept a country code instead of a region. this would allow developers to create a list of the supported countries, so they can present them to the user since users don't know and don't care about regions, then that can be fed to the call. again, if these enhancements are welcome, I'm happy to submit a PR. please advise
also, I don't know if it's possible to create a USD card for Japan. probably not. in that case we should codify the currencies for the countries involved so the createGiftCard
doesn't have to be supplied it
see 'Sundry fixes' PR
followed the simple instructions in the README. I have a file with the sample code and when I run it I get the following:
what am I missing?