These are chat archives for reactioncommerce/reaction

13th
Oct 2016
Hai Nguyen
@nguphoha
Oct 13 2016 01:59
@zenweasel I want to sign up/sign in with facebook accounts, so how can I do that?
Ajay Vijayasarathy
@ajayv14
Oct 13 2016 05:14
Hi, reaction-cli installation returns error
works when node-legacy installed
Brent Hoover
@zenweasel
Oct 13 2016 06:41
what does reaction -v return
Ivanthadev
@ivanthemeh
Oct 13 2016 13:32
hey all, anyone available to help out with a little issue? Im using mupx to deploy reaction to an ec2 instance and Im getting an error on the verify deploy (last step) Error: Meteor.userId can only be invoked in method calls. Use this.userId in publish functions. any help is appreciated. Thanks!
tdmoneybanks
@tdmoneybanks
Oct 13 2016 13:50
hi all, ive been looking through the code and noticed in /imports/core/ui there are multiple files that are either .jsx that has been commented out or .js files that still have jsx code in them. can anyone shed some light on the ui components and which ones are not used in the code base. Also, is react used in the code base at all?
Ivanthadev
@ivanthemeh
Oct 13 2016 13:55
I am getting a few different errors It looks like, I have installed gm and its telling me its not finding it I did the patch update for meteor but that didnt fix anything.. please help! :D
Ivanthadev
@ivanthemeh
Oct 13 2016 14:28
@all anyone? This works on my localhost with no errors bit when i try to deploy with mupx its giving me the error listed above. Also its not finding gm and i know its on the server and in the path. Please and thanks.
Jeremy Shimko
@jshimko
Oct 13 2016 15:31
mup doesn’t use our custom plugin loader
which is embedded in reaction-cli and our Docker build
that has nothing to do with the userId message you mentioned above, but it’s still a factor
Have you considered using Docker directly? That’s the recommended approach.
docker build -t your-reaction .

docker run -d -p 80:80 your-reaction
that’s it. running on port 80
or if you don’t have any customizations, you can use the official Docker image and skip the build process.
Jeremy Shimko
@jshimko
Oct 13 2016 15:37
I should point out that the example above assumes you’re running the development branch. The ability to run the database in the same container was just added and it isn’t merged into master yet.
The only difference on the master branch is you’d need to define a MONGO_URL
docker run -d -e MONGO_URL="mongodb://someurl"  -p 80:80 your-reaction
Jeremy Shimko
@jshimko
Oct 13 2016 15:43
also, see this full example of how to use Docker Machine to run a server and Docker to build/deploy the app with a free Let’s Encrypt SSL cert.
https://gist.github.com/jshimko/745ca66748846551692e24c267a56060
Other than setting your specific environment variables and cloud provider API key, that’s pretty much copy/paste as-is.
Ivanthadev
@ivanthemeh
Oct 13 2016 15:51
@jshimko I just tried to use docker and was unable to get it working..Im sure with a little help I could as I am new to docker but I can learn quickly.
@jshimko Im reading your messages now.
@jshimko so Im confused.. what is causing the error for Meteor.userId? I dont get any of those errors on my localhost. Is it possible for me to install the plugin loader pn my serveR?
@jshimko ok so If Im reading this correctly I can upload the repo on my server and install docker and run those two commands and it will work?
Jeremy Shimko
@jshimko
Oct 13 2016 16:02
You don’t need the code on your server. Everything happens locally on your machine. You start a server with Docker Machine and then run remote Docker commands on it from your local machine. That includes the build and run commands I mentioned above.
Docker Machine does all of the hard work of setting up the server from scratch and controlling it remotely.
you can use it on pretty much any major cloud provider
https://docs.docker.com/machine/drivers/
Ivanthadev
@ivanthemeh
Oct 13 2016 16:08
@jshimko I just did another deploy so I could see the error again and it worked! using mupx :D
Jeremy Shimko
@jshimko
Oct 13 2016 16:09
:thumbsup:
Ivanthadev
@ivanthemeh
Oct 13 2016 16:14
@jshimko why would it do that? Error once and then when I reset with a new server it works?
Jeremy Shimko
@jshimko
Oct 13 2016 16:25
that came from a publication, so you likely only subscribed to it that time you saw the error
And that’s a warning more than an error. There isn’t actually anything breaking when that happens.
Ivanthadev
@ivanthemeh
Oct 13 2016 16:57
@jshimko I am trying to set up the stripe section in the dashboard and Im trying to do a test sale, usually I just use the card number 4242424242424242 but its not working? Is there a special way to test if I have stripe hooked up correctly?
Spencer Norman
@spencern
Oct 13 2016 16:57
what error are you getting?
and do you have your API key setup?
Ivanthadev
@ivanthemeh
Oct 13 2016 16:58
Oops! Credit card is invalid. Please check your information and try again.
Spencer Norman
@spencern
Oct 13 2016 16:58
I’m actually dealing with that exact issue right now as well
Ivanthadev
@ivanthemeh
Oct 13 2016 16:58
oops one sec I think I know what I did
nope that didnt work
@spencern so youre trying to set up stripe too and its not working for testing?
@spencern what api key did you add?
Spencer Norman
@spencern
Oct 13 2016 17:01
using sk-test
@ivanthemeh - looks like in the StripeAPI the promise is returning undefined
Ivanthadev
@ivanthemeh
Oct 13 2016 17:07
are you using the test card info 4242..etc?
Spencer Norman
@spencern
Oct 13 2016 17:07
yeah, same
Jeremy Shimko
@jshimko
Oct 13 2016 17:08
can you actually get a promise when a callback is being passed in?
Spencer Norman
@spencern
Oct 13 2016 17:08
I’ve actually been seeing this issue for a few weeks now, but thought it was probably related to my existing deployment, just updated to the lastest stripe code from RC and am still seeing the issue though
Ivanthadev
@ivanthemeh
Oct 13 2016 17:08
so are you using a different payment gateway then?
Spencer Norman
@spencern
Oct 13 2016 17:09
@jshimko not sure, but that undefined is also getting passed back to the stripeSubmit method: https://github.com/reactioncommerce/reaction/blob/master/imports/plugins/included/stripe/server/methods/stripe.js#L127
Jeremy Shimko
@jshimko
Oct 13 2016 17:11
There aren’t any examples of using promises in the docs…
https://stripe.com/docs/api/node#create_charge
Except for this note on error handling…
// Note: Node.js API does not throw exceptions, and instead prefers the
// asynchronous style of error handling described below.
//
// An error from the Stripe API or an otheriwse asynchronous error
// will be available as the first argument of any Stripe method's callback:
// E.g. stripe.customers.create({...}, function(err, result) {});
//
// Or in the form of a rejected promise.
stripe.customers.create({...}).then(
   function(result) {},
   function(err) {}
 );
I’m almost certain that format in the code is not going to work.
and I’m not sure how it got this far if that’s the case
Spencer Norman
@spencern
Oct 13 2016 17:12
yeah, I’m not really sure where that came from
I just started digging in. Stripe was working for us previously
Jeremy Shimko
@jshimko
Oct 13 2016 17:13
that first file hasn’t changed in a long time, so maybe that actually works
that’s definitely not a typical syntax for promises though
Spencer Norman
@spencern
Oct 13 2016 17:14
just checked my “charges” tab on stripe and the charges are going through
just the RC part is rejecting because of the Promise
Spencer Norman
@spencern
Oct 13 2016 17:15
This message was deleted
Jeremy Shimko
@jshimko
Oct 13 2016 17:16
adding a callback stops it from returning a promise
undefined is expected in that case
Spencer Norman
@spencern
Oct 13 2016 17:17
removing the callback seems to have fixed it
Spencer Norman
@spencern
Oct 13 2016 17:20
:+1: I’ll file a PR
Jeremy Shimko
@jshimko
Oct 13 2016 17:20
Great. Thank you.
Ivanthadev
@ivanthemeh
Oct 13 2016 17:38
@spencern so you got it working with the test card info?
Spencer Norman
@spencern
Oct 13 2016 17:38
yes
Ivanthadev
@ivanthemeh
Oct 13 2016 17:39
@spencern mind helping me fix it? Im not sure how to take out that function..I follow direction well tho.
Spencer Norman
@spencern
Oct 13 2016 17:40

basic fix is changing this line:
https://github.com/reactioncommerce/reaction/blob/master/imports/plugins/included/stripe/server/methods/stripeapi.js#L75-L77

to const chargePromise = stripe.charges.create(chargeObj);

There will be a PR later that makes sure all the tests etc pass, but that worked for me to get a test charge through
Ivanthadev
@ivanthemeh
Oct 13 2016 17:42
@spencern how do I get to that file in my app directory?
Jeremy Shimko
@jshimko
Oct 13 2016 17:42
it’s already there
/imports/plugins/included/stripe/server/methods/stripeapi.js
Ivanthadev
@ivanthemeh
Oct 13 2016 17:43
oh lol I was looking in the .reaction
Jeremy Shimko
@jshimko
Oct 13 2016 17:43
nope. the .reaction dir is mostly for config and build scripts
It’s entirely ignored by Meteor
Ivanthadev
@ivanthemeh
Oct 13 2016 17:46
@jshimko Im having another issue with the https not working, Im getting the green icon but a 502 error, the 443 port is open on my server and the cert is working. Im hosting it on a amazon ec2 instance..any ideas?
the app is likely not responding to whatever proxy you set up SSL with
Ivanthadev
@ivanthemeh
Oct 13 2016 17:49
i used letsencrypt
Jeremy Shimko
@jshimko
Oct 13 2016 17:50
lets encrypt isn’t a reverse proxy. It’s the certificate authority. Nginx is an example of a reverse proxy.
Ivanthadev
@ivanthemeh
Oct 13 2016 17:51
so its with the mupx ssl config then?
Jeremy Shimko
@jshimko
Oct 13 2016 17:52
Maybe. I have no idea. I don’t use mupx. You can try filing an issue over there.
Or ask in the Meteor forums. A lot of people use it over there.
Ivanthadev
@ivanthemeh
Oct 13 2016 19:50
@jshimko so I added that line of code and took the other out of the stripeApi file and its letting me make a payment but its not showing up in stripe? I just found that my payments are coming in as uncaptured. Whats that?
Spencer Norman
@spencern
Oct 13 2016 19:50
check your Paymentstab in stripe
you have to capture separtely by default in RC currently
Ivanthadev
@ivanthemeh
Oct 13 2016 19:51
nm im a dummy
oh ok
is there a way for us to change that? Maybe I can try to add it
Spencer Norman
@spencern
Oct 13 2016 19:52
yeah I’ve got a PR sitting that just needs to get updated
i’ll try to get back to it this week