Ruby on Rails #5 Stripe API - Pay Now Button with Stripe Checkout API

  Рет қаралды 17,062

SupeRails

SupeRails

Күн бұрын

Github Repo:
github.com/corsego/shoplify
Heroku Demo:
shoplify.herokuapp.com/
Stripe Dashboard:
dashboard.stripe.com/
Stripe Checkout:
stripe.com/docs/payments/chec...
initialize app
github.com/corsego/shoplify/c...
scaffold products
github.com/corsego/shoplify/c...
product validations
github.com/corsego/shoplify/c...
install gem stripe
github.com/corsego/shoplify/c...
stripe checkout session
github.com/corsego/shoplify/c...
add_sales_count_to_products
github.com/corsego/shoplify/c...
add stripe webhooks
github.com/corsego/shoplify/c...
0:00 Introduction
1:56 Create new Rails app, push to github
4:14 Create Products table, validations, basic navigation
9:43 Gem Stripe, make API calls to Stripe
12:45 Rails Credentials - hide API keys
16:47 Stripe Checkout button
30:41 Recap on integrating Stripe Checkout button
32:07 Add sales_count to Products
34:52 Push application to Heroku
36:41 Webhook to update sales_count when Stripe successfully processes payment
44:35 Final DEMO

Пікірлер: 57
@yeinercarvajalquina7727
@yeinercarvajalquina7727 5 ай бұрын
Thank you Yaro, I always find your videos as awesome!
@androidpearl798
@androidpearl798 2 жыл бұрын
Excellent, Super easy, will implement it now :) Thank you.
@AhmedNadar
@AhmedNadar 3 жыл бұрын
Like your shoplify store 😀👍🏼
@user-mi9ut2ke8f
@user-mi9ut2ke8f 9 ай бұрын
Really awesome video. Thank you so much!
@ridafatima9073
@ridafatima9073 Жыл бұрын
THANKS ALOT! It saved me life 😃😃😃
@Sarev_
@Sarev_ 3 жыл бұрын
Really helpful, thanks a lot!
@francois-yu7bq
@francois-yu7bq Жыл бұрын
I tried the method with the Pay gem but I much prefer yours which is native Stripe and so much lighter. Many thanks !! Good job!
@SupeRails
@SupeRails Жыл бұрын
that's the exact reason I do it this way, without any extra dependencies :) be sure to check my latest commit with some improvements: github.com/corsego/shoplify/commit/7ec7a902db3bdb2194f7a5dfed5597c27d7a4993
@vivuuc4209
@vivuuc4209 2 жыл бұрын
So great video!
@johnedelmapa
@johnedelmapa 3 жыл бұрын
This is great! Thank you!!
@pablom375
@pablom375 2 жыл бұрын
thanks for you content! Saludos desde Chile.
@SupeRails
@SupeRails 2 жыл бұрын
Hola Pablo! Gracias! A veces me dicen que hay que hacer videos en espanol tambien. Talvez un dia! :D
@pablom375
@pablom375 2 жыл бұрын
@@SupeRails ahí estaremos apoyando 🙌
@santuprajapati2203
@santuprajapati2203 Жыл бұрын
Too good explanation of stripe checkout keep posted these kind of third party integration.
@haniqassim
@haniqassim 2 жыл бұрын
Great video !!!
@SupeRails
@SupeRails 2 жыл бұрын
Thanks Hani! Feel free to share it ;)
@MuhammadUmair001
@MuhammadUmair001 2 жыл бұрын
Thanks alot Sir
@francodiaz8439
@francodiaz8439 2 жыл бұрын
Hi, I'm also using AWS in my credentials, and I add below the AWS the stripe credentials but then it doesn't work is possible to use both?, thanks a lot
@purohitnikunj2069
@purohitnikunj2069 2 жыл бұрын
Nice Tutorial!!....But I am having one issue, When I am sending normal post request for 'BuyNow' button to my server and then "redirect_to @session.url" it is redirecting me to payment page but when I write remote:true in 'BuyNow' button and send Ajax request then it is rendering 'create.js.erb' template but not redirecting me to payment page....Can you help me with this??? First I am thinking that it may be cors error then I configured cors policy in my app but still it isn't working so Please help me with this
@fugeeohu9357
@fugeeohu9357 Жыл бұрын
Is Checkout actually under the classification API ?
@kwametcu4761
@kwametcu4761 2 жыл бұрын
This is great. I have been following along trying to replicate this in a project I'm working on but for some reason, the buy now button has to be clicked at least 3 times before it redirects to the Stripe payment interface. I've used both link_to and button_to but still the same result. Could you possibly have some insight into why it's behaving that way, please?
@SupeRails
@SupeRails 2 жыл бұрын
It does usually take me couple of seconds to redirect to Stripe Checkout. If it takes a few CLICKS, check your browser console and rails console for errors.
@therealpunitdh
@therealpunitdh 3 жыл бұрын
Hi, could you please help? The respond_to do |format| does not work in my Rails application. It throws an ActionController::UnknownFormat error.
@therealpunitdh
@therealpunitdh 3 жыл бұрын
@@SupeRails I just added Mime::Type.register "text/javascript", :js to the mime_types.rb file and restarted the server. Still the same error.
@SupeRails
@SupeRails 3 жыл бұрын
oh, I thoguht it was the wicked_pdf video. disregard the mime_type. respond_to do |format| format.js end should work in a rails app without any problems. maybe you mistyped? here are all the related code changes - maybe you missed or misspelled smth github.com/corsego/shoplify/commit/0011a727b1272fb96ae0d8b5618b67975fdf11a8
@blackswansurfing4405
@blackswansurfing4405 3 жыл бұрын
@@SupeRails Same problem here "ActionController::UnknownFormat in CheckoutController#create" i copied/paste your line code and added a new js mime_type
@blackswansurfing4405
@blackswansurfing4405 3 жыл бұрын
It was my fault, forget to add "remote: true" on the button_to
@SupeRails
@SupeRails 3 жыл бұрын
@@blackswansurfing4405 attention to details ;)
@muhammadmudasir367
@muhammadmudasir367 2 жыл бұрын
in ahoy gem country and city data not showing in console ,please make a detail video ahoy gem
@SupeRails
@SupeRails 2 жыл бұрын
:0
@andrewkancev6035
@andrewkancev6035 2 жыл бұрын
It's very great. But when i press "Buy now!" it not redirect me to Checkout page for pay, it's render root path. In console i get: Completed 406 Not Acceptable ActionController::UnknownFormat I don't understand why. I 10 times check all code from start to 28 minutes of video
@SupeRails
@SupeRails 2 жыл бұрын
do you have this problem on a rails 6 app, or rails 7?
@andrewkancev6035
@andrewkancev6035 2 жыл бұрын
@@SupeRails Rails 7.0.3
@w1d3r75
@w1d3r75 2 жыл бұрын
How much do you pay per month for that cloud9 ide?
@SupeRails
@SupeRails 2 жыл бұрын
I do 80% of my work on cloud9 and have 7-8 environments. It's around $10/month.
@w1d3r75
@w1d3r75 2 жыл бұрын
@@SupeRails nice. It's not as expensive as I thought. Nice content btw. I'm always cheering for new Rails stuff
@satendragond6872
@satendragond6872 3 жыл бұрын
How can i create orders and show all oeders in table
@SupeRails
@SupeRails 3 жыл бұрын
You can get some inspiration from this app build based on the course: github.com/yugeshpalvai21/watchstore
@satendragond6872
@satendragond6872 3 жыл бұрын
@@SupeRails Thanks you help me lot
@fugeeohu9357
@fugeeohu9357 Жыл бұрын
You linked us to your shopify repository, that's not the same code as this video I'm forced to type it out from screen
@muhammadmudasir367
@muhammadmudasir367 2 жыл бұрын
when you feel free please make a video on ahoy
@SupeRails
@SupeRails 2 жыл бұрын
I've heard you the first time ;)
@saurabhsaini453
@saurabhsaini453 2 жыл бұрын
sir, please make videos tutorial on paypal in rails.
@SupeRails
@SupeRails 2 жыл бұрын
Hi! I'd love to, but I haven't found a good way to integrate Paypal without external dependencies like Braintree yet :(
@muhammadmudasir367
@muhammadmudasir367 2 жыл бұрын
please make a video ahoy gem
@SupeRails
@SupeRails 2 жыл бұрын
Hi Muhammad! Good idea! I'll put Ahoy on my TODO list
@muhammadmudasir367
@muhammadmudasir367 2 жыл бұрын
Hi sir
@SupeRails
@SupeRails 2 жыл бұрын
Yo! What's up?
@valcaro87
@valcaro87 Жыл бұрын
i followed this tutorial and works fine, however if we have 3 different products having the same amount, for 'sales_count', Product.find_by(price: session.amount_total), is there any other reference attribute that returns a unique identifier? looking at the "payment_intent.succeeded" but there is no way for me to get the product_id (prod). any tips? thanks
@valcaro87
@valcaro87 Жыл бұрын
i managed to worked on this, let me know if you have better approach, thanks. case event.type when 'checkout.session.completed' session = event.data.object line_items = Stripe::Checkout::Session.list_line_items(session.id) product = Product.find_by(stripe_product_id: line_items.data&.first&.price&.product) product.increment!(:sales_count) if product.present? end
Stripe Checkout in Rails with the Pay gem
17:49
GoRails
Рет қаралды 12 М.
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 20 МЛН
When Steve And His Dog Don'T Give Away To Each Other 😂️
00:21
BigSchool
Рет қаралды 16 МЛН
She ruined my dominos! 😭 Cool train tool helps me #gadget
00:40
Go Gizmo!
Рет қаралды 18 МЛН
Эффект Карбонаро и бесконечное пиво
01:00
История одного вокалиста
Рет қаралды 6 МЛН
Shopping Cart Order Sessions In Rails 7 With Turbo
26:21
Stripe Subscriptions with Rails 7
1:02:06
SupeRails
Рет қаралды 3 М.
Setting Up Stripe in Rails Application
14:52
APPSIMPACT Academy
Рет қаралды 2,5 М.
Intro To I18n Localizations With Ruby On Rails 7
13:14
Deanin
Рет қаралды 2,5 М.
Ruby on Rails #30 Social log in with Github (omniauth 2.0)
10:58
Accept a payment with Stripe, Rails, and PaymentIntents
51:51
CJ Avilla
Рет қаралды 3,8 М.
What is Stripe and How Does it Work? [Stripe Explained]
12:41
Merchant Maverick
Рет қаралды 173 М.
How to Process Webhooks in Rails
41:40
GoRails
Рет қаралды 4,1 М.
I built 10 web apps... with 10 different languages
14:23
Fireship
Рет қаралды 1,5 МЛН
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 20 МЛН