Fireship · @fireship
Stripe Checkout Payments with Angular and Firebase - Part 1
Uploaded July 10, 2017 · Length 4:47
Summary
este episodio integra pagos de stripe en un proyecto de angular 4 con Firebase en el backend
- stripe checkout
- angular payments
- firebase backend
- stripe integration
- angular 4
- stripe payments
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
in this episode we're going to integrate
- 0:02
stripe payments into an angular 4
- 0:04
project with Firebase on the back end
- 0:07
this is the first installment of a
- 0:09
multi-part series on handling payments
- 0:11
in angular in this first part you'll
- 0:13
learn how to trigger the stripe checkout
- 0:14
modal to collect the customer's credit
- 0:16
card and then receive the payment token
- 0:18
back from
- 0:19
stripe before we get into the code let's
- 0:22
take a look at how the whole stripe
- 0:23
payment process works the user will
- 0:26
enter their credit card details through
- 0:27
the angular app with stripe checkout
- 0:30
then stripe will respond with the
- 0:32
payment token which we then want to save
- 0:34
in the Firebase database this will
- 0:36
automatically trigger a cloud function
- 0:38
which sends the token back to stripe
- 0:40
stripe will charge the card and then
- 0:42
respond with the charge details Firebase
- 0:45
and angular have a real-time connection
- 0:47
so the user will always stay up to date
- 0:49
on the status of their payment
- 0:50
throughout this
- 0:51
process let's start by getting the
- 0:53
initial setup out of the way first
- 0:55
you'll need a stripe API key which you
- 0:57
can get from stripe.com then go to the
- 1:00
checkout documentation and we'll be
- 1:02
modifying the custom integration to work
- 1:04
with
- 1:05
angular in your app environment file add
- 1:08
the stripe API key and make sure it's
- 1:11
the test key from there we need to add
- 1:14
the stripe checkout library to the
- 1:16
index.html file and the final step is to
- 1:20
make typescript aware of the stripe
- 1:22
checkout class which you do in the
- 1:25
typing. D.S
- 1:28
file the next step is is to create a
- 1:30
feature module to handle all of our
- 1:32
payment components and services when
- 1:34
you're done with this lesson your
- 1:36
payment module should look something
- 1:37
like
- 1:39
this from there we can generate the
- 1:41
service specifying the payment module
- 1:44
then import angular fire database and
- 1:46
angular fire off and first we'll get the
- 1:49
user ID by subscribing to the angular
- 1:52
fire off
- 1:54
State the only other thing our service
- 1:56
needs to do at this point is save the
- 1:58
stripe token to the Firebase


