These are chat archives for reactioncommerce/reaction

13th
Jun 2016
Valery Orloff
@valorloff
Jun 13 2016 05:47
@hrath2015, @zenweasel,
thanx, i found it in .meteor folder and clone it
Valery Orloff
@valorloff
Jun 13 2016 06:23
i created new simple paymentMethod with <button type="submit" class="btn btn-lg btn-success btn-block btn-complete-order">, i have question:
where there is a handler of button pressing event, when a new order insert to the orders collection?
Brent Hoover
@zenweasel
Jun 13 2016 06:25
In the generic payment method (and most other payment methods) the code is in client/templates/cart/checkout/payment/methods/generic/generic.js
it’s actually handing the submission of the form, not handing a button, but same idea
but calling Meteor.call("cart/submitPayment", paymentMethod); is what finalizes the order
Valery Orloff
@valorloff
Jun 13 2016 06:29
I already looked there, there is no hint about add order to the database, transactions handler only
Brent Hoover
@zenweasel
Jun 13 2016 06:31
The order is added to the db in cart/copyCartToOrder
Valery Orloff
@valorloff
Jun 13 2016 06:32
i created simplest html-like payment method with payment details info, and want to submit order to database
in reaction-paymentmethod/client/templates/cart ?
Brent Hoover
@zenweasel
Jun 13 2016 06:34
No, it happens in a hook
that’s why there is no direct reference to it
ReactionCore.MethodHooks.after("cart/submitPayment”)
Valery Orloff
@valorloff
Jun 13 2016 06:38
Aha! thanks)
Brent Hoover
@zenweasel
Jun 13 2016 06:38
:+1:
jujes
@jujes
Jun 13 2016 09:09

Someone know if possible mount as Volumes /var/src into Dockerfile reactioncommerce/reaction?

thanks in advance,

Valery Orloff
@valorloff
Jun 13 2016 14:40
i want Meteor.call("cart/copyCartToOrder", cart._id); in my custom event handler of complete_order button, but cart._id is undefined, where can I get it?
Valery Orloff
@valorloff
Jun 13 2016 14:59
how i can get directly to an cart? amount, cart _id? bypassing the payment transaction?
if the buyer does not choose a suitable payment method? and will decide later?
hrath2015
@hrath2015
Jun 13 2016 15:42
You can always use ReactionCore.Collections.Cart.findOne() to get the current cart object.
Valery Orloff
@valorloff
Jun 13 2016 15:52
there cart is was undefined )
i created a mock object paymentMethod, then Meteor.call("cart/submitPayment", paymentMethod); and cart succesfully inserted to orders collection )
but with error:
Error invoking Method 'cart/submitPayment': Access Denied [403]
meteor://💻app/packages/meteor/debug.js:41
hrath2015
@hrath2015
Jun 13 2016 16:19
not sure what is going on. will look into it further.
Owen Hoskins
@owenhoskins
Jun 13 2016 19:56
Hey all: Got a general schema question, I am trying to update a variants price via a custom Meteor.method; but it is throwing a TypeError: Cannot call method 'namedContext' of null at [object Object].doValidateerror. Everything looks to be in order. Has anyone run into this before? I am I missing something obvious?
Spencer Norman
@spencern
Jun 13 2016 19:57
there was an update a little while back where you need to pass a selector in to the products schema any time you do an update
e.g.
Products.update({_id: “id”}, {$update: {}}, { selector: { type: "simple" } });
or
Products.update({_id: 'id'}, {$update: {}}, { selector: { type: 'variant' } });
don’t copy paste that btw, I think my quotes are screwed up
but that’s the idea
Owen Hoskins
@owenhoskins
Jun 13 2016 19:59
ah ha. Glad I asked. Thanks for the swift reply.
Spencer Norman
@spencern
Jun 13 2016 20:00
yeah, note that the simple / variant depends on the product and if it’s a “top-level” product or a “variant” (has ancestors)
and it’s a pain to remember, I still run into that error at least once a week and have to remember
Owen Hoskins
@owenhoskins
Jun 13 2016 20:01
Know what's the reasoning behind it?
Spencer Norman
@spencern
Jun 13 2016 20:02
it’s how they made the change from products and variants being separate collections to having them merged. At the core I think it’s so that price can have two different schemas
Owen Hoskins
@owenhoskins
Jun 13 2016 20:04
I see -- that's the trick to it. Little less mystery.
Update is going through now. I'll have to make a mental note of that. Thanks again.