Creating a workspace
We will start by creating a Ruby on Rails application
$ rails new tuto
$ cd tuto
$ bundle install
Enter f...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, what's the point of defining instance variable in BillingController
if you can use
directly in views using Rails?
P.S. It's strange to see this part of code in turorials:
Instead of this one:
[gestionstock]$rails server
=> Booting WEBrick
=> Rails 4.1.16 application starting in development on 0.0.0.0:3000
=> Run
rails server -h
for more startup options=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/wbouvier/Sites/Rails/gestionstock/config/environments/development.rb:33:in
block in <top (required)>': undefined method
credentials' for #Gestionstock::Application:0x007fb2... (NoMethodError)@ksushiva - thank you so much for this article. Was very valuable in a project I was working on.
PS. There is a small typo (as per below) and an extra "end" for the subscribe method:
Bonjour,
Je dois intégrer Stripe à un site déjà existant. En suivant les étapes, après le 1er lancement du rails s (After that in terminal we run 'rails s' and after clicking on our button we should have something like this: )
j'ai me message d'erreur en pièce jointe.
Pourriez-vous me donner un coup de main ?
Merci.
Wilfried.
Hello, votre version de rails est 4.1.1. Les "encrypted credentials" de rails ne sont disponibles qu'avec rails 5.2+. Vous pouvez utiliser des variables d'environnement à la place pour enregistrer vos informations d'identification stripe.
Hi, Your rails version is 4.1.1. The rails encrypted credentials are only available with rails 5.2+. You can use environment variables instead to save your stripe credentials.
Hi,
cela fonctionne.
Merci beaucoup, je continue les étapes.
Bon week-end.
Wilfried
Great tutorial. One problem - this line in "Linking a card to a user" didn't work for me:
<%= form_tag create_payment_method_path, id: "billing-create-payment-method" do %>
It ended up creating a form with
action=/id...
. :( This worked:<%= form_tag create_payment_method_path, :id => "billing-create-payment-method" do %>
i want to get subscription please help.. here is my code
module BillingHelper
def check_if_user_already_subscribe(plan_id)
customer = Stripe::Customer.new current_user.stripe_id
subscriptions = Stripe::Subscription.list(customer: customer.id)
plan_ids = get_from_subcriptions
if plan_ids.include?(plan_id)
true
else
false
end
end
end
Bonsoir Oksana Ivanchenko,
Merci baucoup pour ton tutoriel. Merci encore, je suis africain pasionné par le développement web. j'ai appris ruby et rails par moi même et j'ai seulement les bases de rails. pourrai tu m'epprendre les techniques avancés de rails ? SVP, apprenez moi quelques technique avancés sur rails afin que je puisse acquérir plus de connaissance et me perfectionner.
Merci encore Oksana Ivanchenko,
Francel
Excellent article Oksana. I will actually have to do this exact thing very soon.
Any thoughts on if/how to store transactions in a local Rails model? Or do you totally depend on those objects/records living in Stripe?
Thanks so much for this tutorial, really great @ksushiva ! Could you know of a step to step implementation to have this implemented for the current SCA improvements. Apologies for my english
Hi Oksana! What happens if the person cancels the payment / card for the upcoming month? How do you handle that?
Thanks for your article! :) Good work.