These are chat archives for reactioncommerce/reaction

20th
Sep 2017
zrisher
@zrisher
Sep 20 2017 00:10
@dhonig Probably for this particular case, but as I understand it RC expects apps to sometimes change parts of its core functionality and save those changes in git commits. If an app had a few such changes spread between updates from RC's master, it seems to me that each additional merge would be more and more complex.
Daniel Honig
@dhonig
Sep 20 2017 00:46
I'd have to say that for most customizations
you can build them as plugins @zrisher and
I think that changing the core is technical debt and needs to be closely scrutinized
zrisher
@zrisher
Sep 20 2017 01:14
@dhonig Thanks, that makes sense to me but was contrary to what I'd been told about the platform. Looking through the docs, there's nothing that backs up my original understanding
Do you know of any documentation that specifies this git process for working with reaction - "keep your changes on master, pull from rc/reaction master, don't change core"?
I was a little surprised to see no documentation on that part of the process
Daniel Honig
@dhonig
Sep 20 2017 01:45
Hmm...I think there are multiple references to keeping your customizations in a plugin in the documentation
I would go as far as to just make the plugin a git submodule of my project
Daniel Honig
@dhonig
Sep 20 2017 02:24
So have done some more homework on how to process Subscriptions via stripe, mainly by studying some other implementations and have drafted the flowchart here:
Patrick Tavares
@patrick-tavares
Sep 20 2017 03:01
@zrisher, the only time you should need to modify core code is if you are contributing a PR to the core itself (as with any open source project... something that is highly encouraged). The modular nature of RC allows you to pretty much build all your customizations in your own plugin. Your plugin can override core code without requiring you to modify core code
and in the case of contributing changes to core, you still would not make all your changes in the master branch. You would fork the main repo to your own github account, clone that master down locally, create your own feature branch, and work from that feature branch
Daniel Honig
@dhonig
Sep 20 2017 03:08
@patrick-tavares exactly thanks for the additional explanation
Brent Hoover
@zenweasel
Sep 20 2017 03:15
I feel like the documentation pretty clearly states you should always create a plugin for any customization although we acknowledge that in some cases changes to core are necesssary.
The Customization Guide is in fact a tutorial that shows you how to create a plugin.
In here I talk about the advantages/disadvantages of creating a plugin vs. modifying core. Maybe I need to make that language stronger.
Lorenzo Campanis
@lcampanis
Sep 20 2017 09:35
@zrisher Not exactly, for starters you will have to merge very often so that you don't deviate too much, but if you make sure you don't hack RC core code, the custom and public folders are total empty and contents are ignored from RC, so you will not have many issues, if any. Hacking core would surely deviate your code from the original RC and to keep track and solve conflicts easily you'd need to merge frequently so you don't lose track. At the very least, you should follow a gitflow model http://nvie.com/posts/a-successful-git-branching-model/ and merge in development and master only finalised features or hotfixes.
Chuks Opia
@9jaswag
Sep 20 2017 11:38
hi everyone...new here and trying to get a hang of how Reaction works but some of the documentation pages are kinda broken....they don't display anything...
example: https://docs.reactioncommerce.com/developer/tutorial/customization.md
machiko
@machikoyasuda
Sep 20 2017 13:43
We're just about to kick off our Community Call. Tune in here: https://zoom.us/j/443127891
@9jaswag hi there - that's a broken link! try this one: https://docs.reactioncommerce.com/reaction-docs/master/tutorial
machiko
@machikoyasuda
Sep 20 2017 13:50
@dhonig Awesome! Trying to access http://ipfs.io/ipfs/QmcuzthzKJM2KWZU9qHbEsJBZh6eMQCcUSDCFEKuv1rA3p and it's just a spinner for me. What's the secret to getting it loaded??
Josh Cox
@joshuacox
Sep 20 2017 13:55
@dhonig I get the same thing when trying to access that link
Brent Hoover
@zenweasel
Sep 20 2017 13:56
Join_a_Meeting_-_Zoom.png
Josh Cox
@joshuacox
Sep 20 2017 13:57
@zenweasel I got the same thing, but this link works for me
Brent Hoover
@zenweasel
Sep 20 2017 13:57
Yep
Loan Laux
@loanlaux
Sep 20 2017 13:58
Screen Shot 2017-09-20 at 09.58.15.png
Brent Hoover
@zenweasel
Sep 20 2017 13:58
@machikoyasuda the link you posted above is not working. Just FYI
Loan Laux
@loanlaux
Sep 20 2017 13:58
Yup, was about to say this
Brent Hoover
@zenweasel
Sep 20 2017 13:59
Like @joshuacox said. This link works: http://getrxn.io/reaction-community-call
Loan Laux
@loanlaux
Sep 20 2017 13:59
So weird, it redirects me to my ISPs search engine
Ashish
@ashishgokhale
Sep 20 2017 14:00
@zenweasel
Can I access methods in my rest call, I have created a plugin, which is exposing my current reaction data. I want add/edit /remove products via REST apis,.
Is there any way, I can call existing methods like "product/createProduct", "product/createVariant". Every time I am trying this , I am getting error "Access Denied", I can read the code structure so understood that it is checking for user. Is there any way so I can bypass the checking or can I set session and rest of the checking things from outside(from my call), so it allow me to use default methods.
Loan Laux
@loanlaux
Sep 20 2017 14:00
Must be a DNS error or something
Josh Cox
@joshuacox
Sep 20 2017 14:01
gives a metarefresh to ogp.me?
Loan Laux
@loanlaux
Sep 20 2017 14:02
Okay the same URL works with my Swiss VPN. Time Warner Cable is trying to censor Reaction Commerce! 😬
Brent Hoover
@zenweasel
Sep 20 2017 14:02
we’re only available on the dark web now
machiko
@machikoyasuda
Sep 20 2017 14:02
This message was deleted
Josh Cox
@joshuacox
Sep 20 2017 14:03
that's where all the e-commerce is anyhow
Brent Hoover
@zenweasel
Sep 20 2017 14:03
And we only accept bitcoin
Josh Cox
@joshuacox
Sep 20 2017 14:03
lol
Loan Laux
@loanlaux
Sep 20 2017 14:03
Dying in laughter right now
machiko
@machikoyasuda
Sep 20 2017 14:03
Hi!! We're broadcasting now http://getrxn.io/reaction-community-call
prosf
@prosf
Sep 20 2017 14:08
@machikoyasuda BroadCasting link doesn't seem to work ( getrxn.io’s server DNS address could not be found. )
Josh Cox
@joshuacox
Sep 20 2017 14:08
prosf
@prosf
Sep 20 2017 14:09
Thanks Josh!
Ashish
@ashishgokhale
Sep 20 2017 14:16

Guys need help:

Getting error:ReferenceError: ReactionCore is not defined
I have added reactionCommerce:core package, want extend schema defination

Brent Hoover
@zenweasel
Sep 20 2017 14:22
I’m not sure what you mean when you say you added the reactioncommerce core package. If you are adding a package from Atmosphere, those are deprecated
Josh Cox
@joshuacox
Sep 20 2017 14:45
@dhonig I think the only thing I'd like to add to your description is that there needs to be a method/hook or something that verifies the user is still subscribed before 'sending the magazine'/'they access the secret area'/etc
Daniel Honig
@dhonig
Sep 20 2017 14:48
Yeah I am thinking we have this "process" method
invoke a ton of call backs
"template methods" if you will
so custom logic can easily be inserted
Brent Hoover
@zenweasel
Sep 20 2017 14:50
yeah, that totally sounds like Event hooks
Ashish
@ashishgokhale
Sep 20 2017 15:21
@zenweasel so How can I extend schema defination, I want to make some changes in schema defination
Daniel Honig
@dhonig
Sep 20 2017 15:21
@ashishgokhale you have your code in a plugin right?
Ashish
@ashishgokhale
Sep 20 2017 15:21
yes

In schema defination I am writing something:

ReactionCore.Schemas.CorreiosProduct = new SimpleSchema([
ReactionCore.Schemas.Products, {
"upc": {
type: String,
defaultValue: 'upc'
}
}
]);

But getting Reactioncore is not defined, I tried importing the package, but it is deprecated? Am I doing anything wrong?
Daniel Honig
@dhonig
Sep 20 2017 16:07
Other than it being an extremely long method :worried: , the issue I have is that I do not detect where it is storing the ID of the customer. To Stripe this is the only way to resolve a unique customer :
Stripe.apiKey = "sk_test_X9JzDdKYb0vu9QowwO7IPX8n";

Customer.retrieve("cus_BQThznZ4t88aSs");
So e-mail addresses in Stripe are allowed to be duplicated a specific customer is represented by an id only
Spencer Norman
@spencern
Sep 20 2017 17:57

Hi @dhonig
Right now I’m not sure we’re storing the customer id anywhere other than the raw transaction that is returned and stored on the order. It would probably be worth storing this customer object on the user in payment cases where we would want to retreive that customer id for future payments.

image

Spencer Norman
@spencern
Sep 20 2017 18:04
As for the length of the method, a lot of the length is documentation, comments, and checks for exceptions, but there are some places we could create private helper functions to make the main method a little shorter. I tried to balance making it easy to understand exactly what is happening within this method with making it succinct, but I’m open to suggestions that would make it more clear and easier to reason about.
Daniel Honig
@dhonig
Sep 20 2017 19:24
@spencern I think its fine, its just that I think some functions could be extracted into smaller atomic functions
and thus I could re-use some of them
In terms of the customerId being stored on the transaction we need to identify where the subscription creation happens
is it in a post order hook?
or is it during the creation of the order
i/e do we override this method in the plugin?
or try to use a hook to trigger the creation of a subscription
And thank you for getting back to me on that
I couldn't see the customer getting stored anywhere other than at order completion(if it was indeed happening there)
Patrick Tavares
@patrick-tavares
Sep 20 2017 21:23
@machikoyasuda, do you have a link for the recording of his morning's call by chance?
We had a great community call earlier today -- discussing the latest coming into Marketplace, router changes, Mongo aggregate methods + @dhonig's Reaction Subscription plugin in development. Catch it all in the archives https://docs.google.com/document/d/1PwenrammgQJpQfFoUUJZ96i_JJYCM_4glAjB1_ZzgwA/edit#
Spencer Norman
@spencern
Sep 20 2017 21:57

@dhonig

re: when the customerId is stored on the transaction

The transaction is a blackbox object that is returned from a payment provider, so it’s not really ever “stored” there, the customer property is part of the transaction object when it’s returned from Stripe.

In the case of marketplace, this happens on this line https://github.com/reactioncommerce/reaction/blob/marketplace/imports/plugins/included/payments-stripe/server/methods/stripe.js#L337

As to what the best way to create a subscription is, I’m not sure, we could add an Event Hook after the charge is created in Stripe

Is it possible it would be better to have an entirely separate method for checking out with subscription payments? I haven’t done much research into how those get triggered, captured, etc. Adding a hook would be trivial, but you seemed to have some reservations about that direction this morning.

In regards to abstracting common helper functions that could be shared, I think thats a good idea
Daniel Honig
@dhonig
Sep 20 2017 23:54
@spencern my comment about events/hooks is just about mixing asynchronous processing with user expectations that are syncronous
I think a hook can work