Mangopay / mangopay2-nodejs-sdk

Node.js SDK for MANGOPAY
https://www.npmjs.com/package/mangopay2-nodejs-sdk
MIT License
51 stars 38 forks source link

Problems importing the SDK from a Meteor project #17

Closed jonathanazulay closed 8 years ago

jonathanazulay commented 8 years ago

Trying to import the SDK from a Meteor project (with meteor-webpack), for some reason it fails to read the directories

screen shot 2016-06-21 at 14 32 04

Maybe using a relative path would work better?

gabriellupu commented 8 years ago

Hello ! Thanks for bringing this up - I will look over the meteor-webpack compatibility. Is there any particularity I need to be aware of in your project ? Also what system are you trying to run on ? Thanks !

jonathanazulay commented 8 years ago

@lupugabriel1 I'm running OS X 10.11.5 with Meteor 1.3.2.4. It seems to be a problem with meteor-webpack. (I tried creating a new project without meteor-webpack and it worked.)

gabriellupu commented 8 years ago

I will try to reproduce it locally, maybe I can provide a fix that includes using relative paths for the services loader.

yns01 commented 8 years ago

Hello,

@jonathanazulay

If it's any help, I managed to import the SDK from a meteor project and make it work.

meteor npm install mangopay2-nodejs-sdk --save
meteor npm install --save meteor-node-stubs

/* Mangopay SDK */
import mp2 from 'mangopay2-nodejs-sdk';
let mangoPayApi = new mp2({
  clientId: Meteor.settings.private.mangopay.clientId,
  clientPassword: Meteor.settings.private.mangopay.clientPassword,
  // debugMode: true,
  // Set the right production API url. If testing, omit the property since it defaults to sandbox URL
  // baseUrl: 'https://api.mangopay.com'
});

export { mangoPayApi };
jonathanazulay commented 8 years ago

@yns01 Thanks but unfortunately installing meteor-node-stubs did not help. The problem is with webpack.

hobailey commented 8 years ago

@jonathanazulay sorry for the delay getting back to you. Are you still experiencing this problem?

Ahskaniz commented 6 years ago

Hello, I'm having this same issue and not sure how to solve it. Any suggestion?