octopress (ruby on rails) stripe integration - ruby-on-rails

I would like to integrate stripe payment system to my octopress blog. The problem is that octopress is used to build static web sites, and integration stripe requires to add new Controllers (dynamic) to handle user payments.
how can I add such a controller without breaking the octopress file structure.
regards,

I'm not familiar with octopress. But I'm assuming it's similar to Wordpress, and whenever I want to use rails functionality on a wordpress application, I create a subdomain that points to my rails app using a service like dnsimple.
So if someone visits railsapp.mywebsiteurl.com they will receive a response from my rails application. However, if someone visits www.mywebsiteurl.com they will get a response from octopress.

Related

Is it possible to add Shopify app to already existing Ruby on Rails web app?

I want to integrate my web app with Shopify which means I have to create my own Shopify app. I noticed that Shopify requires self hosting so it would benefit me to add the Shopify app as part of my already existing web app because I can host it together.
Does this seem possible or do I have to make a desperate application?
It should totally be possible to add a shopify app to your existing ruby on rails project.
If you look at https://github.com/Shopify/shopify_app all you have to do is add in shopify_app to your gem file and then generate the proper routes. You can use their built-in generators or manually make the routes yourself.
Basically you would just need to make additional routes for your existing application to handle the requests to and from Shopify.

Authentication with an Existing External API

I am building a Ruby on Rails (Rails - v4.2.3 & Ruby 2.2.2) App which consumes an existing REST API.
The aforementioned API is written in PHP.
I need help regarding how to manage the authentication?
On searching through various forums I came across these two gems
https://github.com/lynndylanhurley/devise_token_auth
https://github.com/gonzalo-bulnes/simple_token_authentication
The problem I am facing with both is that they require my app to have a users model configured (using Devise).
However My app is primarily a front end for the Existing REST API, so if I do configure my own User model, I will end up with two Data Stores (One for the APP I make and the other for the existing API).
I wish to consume the external API and not have any native models for my APP.
I believe I can use ActiveResource for this (I need more reputation points to post a link to the gem, sorry I cannot do that right now, I am new to StackOverflow):
However I am not sure how to go about managing the security of the application. More specifically what measures can I take to prevent the authentication information from being viewed in plaintext while it is being transmitted to my API server for authentication?
Thank You.
Use HTTPS on your API. If your external API is using HTTPS then user info wouldn't be sent in plaintext from your rails app.
Don't forget to use HTTPS for your rails app too, as that is more important.

Rails - Wordpress SSO - Single-Sign On

I'm trying to achieve an integration between a Rails app (the core of my website, at domain.com and www.domain.com) and a Wordpress Network (multisite, at *.domain.com).
For that I need to build a Single Sign On process.
I have found a plugin : Rails Integration Api, but i didn't find the article or readme describing the rails part. The process is based on the recuperation of the cookie, created in rails.
So my questions will be :
Do you know any pointers to achieve a Rails - Wordpress SSO integration ?
Do you know some good resources about implementing Wordpress SSO, for any backend ?
Thanks in advance.
That plugin looks like it's looking to the cookie set by your Rails app. If you look at the cookies that are set after you login to that app, do any of them jump out at you as being the auth session cookie?
Also, here's the article referenced in the plugin about configuring the Rails side: http://web.archive.org/web/20090116063054/http://greenfabric.com/page/integration_api_home_page
It looks like it's been defunct for a while (only available thru archive.org) but maybe that will help you put the puzzle together.
Here's a blog post outlining setting up Wordpress as an Oauth provider and authenticating a rails application against it. http://www.objectpartners.com/2014/02/18/single-sign-on-with-rails-wordpress-and-oauth2/

how do I share authentication on a rails/rack app with a node.js instance?

I have been trying to figure out how to integrate a node.js app into a rails app and having them share sessions. I've so far only been able to dig up sharing sessions between sinatra and ruby on rails via rack middleware. Is it possible to to do this?
I thought of a workaround involving the ror implementing a rest service that "poops" out a guid that node.js can use to create its own session. This solution however requires having model validations ad such stored in two seperate apps.
just wondering if there was a way to integrate them.
and while using a js based webframework like geddy or express is cool, I have alot of existing rails code and 3rd party libraries such as active merchant that I would have to reinvent.
how about using something like memcached to share a validation mechanism, for example set a session in rails and for every message to the nodeJs server a token is given, nodeJs checks on memcached if the token exists and grants or denies based on that. You would of course add the record on memcached from the rails app
Isn't that the same as sharing authentication between two different domains like openid, facebook connect, twitter sign-in.
from rails site do an openid like redirect to node.js with the authentication information encrypted inside the url and vica versa?
I am wondering if it is not possible to use Custom OAuth Provider Strategy from connect-auth and vica versa because connect-auth is "Authentication middleware for connect". I haven't figured the complete details out, but this might be an option?

Ruby on Rails CRUD and User authentication and authorization module

hope you all doing well.
my question is on ruby technology, we are developing an web based application using rails framework and ruby. I need to know how the routing works (routes.rb), can some one send me a link of sample CRUD application which I can use in my project.
I need also User authentication and authorization framework using ruby which is readily available.
very urgent,
many many thanks :)
Basically, you are asking how Ruby on Rails works and how to getting started.
I encourage you to start from the official documentation, including the Wiki site and Guides.
You can find information about Rails routing here. More answers about Rails Authentication and Authorization here and here.
For a quick way of creating a Rails CRUD application with user authentication and authorization, please see the Bullet on Rails project. Bullet on Rails is a project I created a while ago to help me quick start creating CRUD apps with authorization included and AJAX crud.
Since you seem to be new to Rails, I also recommend that you read the documentation suggested by weppos.

Resources