GoCardless Node API error in Angular 12 app

134 views Asked by At

Trying to use the gocardless-nodejs api module on an Angular 12 app, and followed the instructions.

Importing the module as follows:

const gocardless = require('gocardless-nodejs');
const constants = require("gocardless-nodejs/constants");

Then trying to create the client:

const client = gocardless(
    [gcAccessToken],
    // Change this to constants.Environments.Live when you're ready to go live
    constants.Environments.Sandbox
);

but keeps showing this error: ERROR TypeError: gocardless is not a function

0

There are 0 answers