These are chat archives for reactioncommerce/reaction

20th
Dec 2017
Kenneth Beartusk
@beartusk
Dec 20 2017 00:19
@joshuacox well i don't have time to document it, but the Mongo Shell command I used to fix it was this.
db.users.update(
     { _id: "someid#" }, 
     { $set: 
          { 
                "emails.0.address": "something@somedomain.com"
          }
      }
)
zzh1234567
@zzh1234567
Dec 20 2017 12:39
Hi, I am a newbie. I've got a problem when I try to use owner role to ddpConnection.Call("products/createProduct") ,but reaction server return : {"msg":"result","id":"1","error":{"isClientSafe":true,"error":"Access Denied","message":"[Access Denied]","errorType":"Meteor.Error"}}
Brent Hoover
@zenweasel
Dec 20 2017 12:47
You need to be logged in so that you have access
zzh1234567
@zzh1234567
Dec 20 2017 12:48
I did. Send: {"msg":"method","method":"login","params":[{"user":{"username":"66282129@qq.com"},"password":{"digest":"8e33a44048782c47f2702215c0c3c8d78730f480361c426f0ad596e5b3512432","algorithm":"sha-256"}}],"id":"0"} and reaction server return OnMessage: {"msg":"added","collection":"users","id":"Aav9j34Rdd4RYhxjM","fields":{"emails":[],"profile":{},"username":"66282129@qq.com"}}
Brent Hoover
@zenweasel
Dec 20 2017 12:50
And that user is the owner?
zzh1234567
@zzh1234567
Dec 20 2017 12:50
yes
Brent Hoover
@zenweasel
Dec 20 2017 12:51
Hmmmm, then I don't know why they wouldn't work
What are using to call the methods?
1> ddpConnection.Connect(); 2> account.Login(username, password) 3> ddpConnection.Call("products/createProduct");
Brent Hoover
@zenweasel
Dec 20 2017 12:56
Yeah, that looks solid
Can you console. log what user it's getting?
zzh1234567
@zzh1234567
Dec 20 2017 13:13

Sanitized and reported to the client as: Product Title is required [400]Exception while invoking method 'revisions/publish' Error: Product Title is required
at getErrorObject (packages/aldeed_collection2-core.js:480:15)
at [object Object].doValidate (packages/aldeed_collection2-core.js:462:13)
at [object Object].Mongo.Collection.(anonymous function) (packages/aldeed_collection2-core.js:214:25)
at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/dispatch_run-as-user.js:325:19)
at [object Object].revisionsPublish (imports/plugins/core/revisions/server/methods.js:119:32)
at packages/check.js:128:16
at [object Object].EVp.withValue (packages/meteor.js:1134:15)
at Object.exports.Match._failIfArgumentsAreNotAllChecked (packages/check.js:127:41)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1765:18)
at packages/ddp-server/livedata_server.js:719:19
at [object Object].EVp.withValue (packages/meteor.js:1134:15)
at packages/ddp-server/livedata_server.js:717:46
at [object Object].EVp.withValue (packages/meteor.js:1134:15)
at packages/ddp-server/livedataserver.js:715:46
at [object Object].
.extend.protocol_handlers.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43
Sanitized and reported to the client as: Product Title is required [400]

----- Product Title is required???

Product Title is required
Brent Hoover
@zenweasel
Dec 20 2017 13:16
Pardon?
It seems like it’s just failing schema validation, though I don’t know why it’s given you an Access Denied error on the client
zzh1234567
@zzh1234567
Dec 20 2017 13:25
thanks .
Kenneth Beartusk
@beartusk
Dec 20 2017 16:47
Can there only be one plugin in "imports/plugins/custom"?
askaskn
@askaskn
Dec 20 2017 16:56
Is it possible to create a back-end store & site management admin portal using reactioncommerce? Similar way the SNIPCART & MOLTIN has on their API
Are there any pre-build API/ plugins/ modules etc available to create the back-end store management & administration?
Michael Jenny
@prinzdezibel
Dec 20 2017 18:08
@askaskn Hi Ashok. Reactioncommerce is a full-fledged shop software that has an admin backend baked in, where you can deal with inventory items, product information, payment providers, etc.
Chinmay Bag
@spunkypanda
Dec 20 2017 18:16
Hi. I have not really understood the concept of a workflow. What kind of scenarios would require me creating or customising a workflow?
Michael Jenny
@prinzdezibel
Dec 20 2017 18:30
@spunkypanda You can use them to track/persist progress of a sequence of tasks/steps. This is done in Reaction for several things. One example is the order processing workflow. An order gets created, then it gets processed and then either completed or canceled. These are the possible "states" of the workflow. Additionally workflows are helpful when building conditional UI. E.g. the checkout workflow has several steps like "Login" "Billing", "Shipment", "Review", "Payment". In combination with Layout you can use Workflows to render discrete chunks of the UI (like the tiles in the checkout process).
Chinmay Bag
@spunkypanda
Dec 20 2017 18:33
So, creating a modified landing page( containing maybe a carousel) and an about us page doesn't require me to create a workflow ?
Michael Jenny
@prinzdezibel
Dec 20 2017 18:33
No.
You may want to have a look into our example plugin. This is were you can find an example of a modified landing page: https://github.com/reactioncommerce/reaction-example-plugin
Chinmay Bag
@spunkypanda
Dec 20 2017 18:36
I did clone this plugin into my custom plugin folder. It worked well.
Michael Jenny
@prinzdezibel
Dec 20 2017 18:36
@spunkypanda The landing page itself is using a workflow internally, but you shouldn't need to bother with it. It's a very simple workflow with just one state.
Chinmay Bag
@spunkypanda
Dec 20 2017 18:37
Alright, what i was trying to do was make a plugin each for an about-us page and another static page.
Somehow, I feel I've been doing it all wrong. Can these two routes be clubbed into a single plugin, as I have seen in somebody's implementation on github?
Michael Jenny
@prinzdezibel
Dec 20 2017 18:40
yes, just add two routes into the plugin's register.js
also see the about page in example plugin
Chinmay Bag
@spunkypanda
Dec 20 2017 18:43
I'll go through the customisation docs once again. Maybe I'm missing something. Thanks for the help. And great work on RC!
Michael Jenny
@prinzdezibel
Dec 20 2017 19:01
:thumbsup:
Kenneth Beartusk
@beartusk
Dec 20 2017 19:02

@joshuacox I am hitting a strange error when trying to redeploy my Reaction store with a Docker Image of reaction 1.6.0. Do you know what this is?

Uncaught Error: Cannot find module '/lib/api/compose'
at c (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at e (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at exampleSettingsFormContainer.js (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:281)
at l (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at e (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at index.js (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:281)
at l (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at e (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)
at example.js (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:281)
at l (a3fb9b96ca676bea332140fb28a918dd13fc3bf3.js?meteor_js_resource=true:9)

Josh Cox
@joshuacox
Dec 20 2017 20:15
@beartusk that is unknown to me
Kenneth Beartusk
@beartusk
Dec 20 2017 20:16
@joshuacox After looking into it I think this one is on me. I believe it has to do with some extra node_modules I installed.
Josh Cox
@joshuacox
Dec 20 2017 20:17
ya looks to be a part of compose-api? i.e. npm install composer-api <-- should do the trick?
Santiago Botta
@sgobotta
Dec 20 2017 20:42
Hello! Is there a reaction method to update only the email address of an Account?
Loz
@lozGemachet_twitter
Dec 20 2017 21:24
Are the hooks suppose to be in the server folder?
I have this line in my init.js file located in the server folder.
Hooks.Events.add("onOrderPaymentCaptured", capturePaymentDetails);
doesn't seem to do anything.
Brent Hoover
@zenweasel
Dec 20 2017 21:50
@lozGemachet_twitter Have you imported that file?
Loz
@lozGemachet_twitter
Dec 20 2017 21:51
@zenweasel Yes I created a index.js file [in the same server folder] and wrote
import "./init";
is there anything else I need to do?
Brent Hoover
@zenweasel
Dec 20 2017 21:53
Nope, that should do it. So nothing happens when the onOrderPaymentCaptured event fires? It should run whatever function you passed in there
Loz
@lozGemachet_twitter
Dec 20 2017 21:54
I just asked it to write a line to the console (to show that it works) but nothing showing up in the console.
Brent Hoover
@zenweasel
Dec 20 2017 21:54
do you see the event being fired?
Loz
@lozGemachet_twitter
Dec 20 2017 21:54
where can I see the event firing?
Loz
@lozGemachet_twitter
Dec 20 2017 21:56
Can I create like a breakpoint on that file?
Brent Hoover
@zenweasel
Dec 20 2017 21:57
Sure
Loz
@lozGemachet_twitter
Dec 20 2017 21:58
how?
Brent Hoover
@zenweasel
Dec 20 2017 21:59
this article describes how to set that up: https://blog.reactioncommerce.com/better-debugging-in-reaction/
Loz
@lozGemachet_twitter
Dec 20 2017 21:59
Thanks!
Loz
@lozGemachet_twitter
Dec 20 2017 22:22
@zenweasel nope it doesn't break on that line. possible because I'm using the example pay system?
Brent Hoover
@zenweasel
Dec 20 2017 22:29
It still should hit that. Give me a minute to try it
Loz
@lozGemachet_twitter
Dec 20 2017 22:30
it doesn't hit any line in orders.js.
Brent Hoover
@zenweasel
Dec 20 2017 22:30
that doesn’t seem right
Brent Hoover
@zenweasel
Dec 20 2017 22:37
I just tested it and it hit that line
Are you capturing the payment in the dashboard?
Loz
@lozGemachet_twitter
Dec 20 2017 22:57
yes I see the orders in my dashboard
Brent Hoover
@zenweasel
Dec 20 2017 22:58
and you are doing “capture” there?
that’s where the capture step happens
Loz
@lozGemachet_twitter
Dec 20 2017 22:59
Oh! I want to get a hook when customer completes payemnt!
Brent Hoover
@zenweasel
Dec 20 2017 22:59
that’s a different event
Loz
@lozGemachet_twitter
Dec 20 2017 23:00
which one?
Brent Hoover
@zenweasel
Dec 20 2017 23:07
if you mean whenever an order is created it really should be here: https://github.com/reactioncommerce/reaction/blob/83c22358db229af3eb315f960c1c32d4355418b0/server/methods/core/cartToOrder.js#L214
but I don’t see an event hook added there
I expect that we are using Collection hooks for all order-processing but there should be an event hook there as well
Loz
@lozGemachet_twitter
Dec 20 2017 23:10
basically what I want is to grab the payment details (order total, last 4 of card number, approval code, etc) and send it to our api server. where is the best way to implement that?
Brent Hoover
@zenweasel
Dec 20 2017 23:11
there should be an event hook in there and I will put in a PR to add that, but for now you could use a collection hook like
https://github.com/reactioncommerce/reaction/blob/4f236ccd318449310ff9e762a1a978339a63d787/imports/plugins/included/inventory/server/hooks/hooks.js#L133
that will get sent the entire order as doc
Loz
@lozGemachet_twitter
Dec 20 2017 23:13
I'll research that link, thank you!