1
00:00:02,250 --> 00:00:05,970
Now that we got this introduction to services

2
00:00:05,970 --> 00:00:08,668
and APIs, let's see a concrete example.

3
00:00:08,668 --> 00:00:12,320
And, as I said, we're going to continue with the online shop

4
00:00:12,320 --> 00:00:16,050
we worked on before, and we're going to add payments

5
00:00:16,050 --> 00:00:21,050
with help of Stripe, which is a super popular service,

6
00:00:21,050 --> 00:00:23,492
getting used by a lots of big websites,

7
00:00:23,492 --> 00:00:25,960
which helps us integrate payments

8
00:00:25,960 --> 00:00:29,020
into our websites and products.

9
00:00:29,020 --> 00:00:31,880
Now, Stripe offers lots of products.

10
00:00:31,880 --> 00:00:33,920
If you have a look at their official page,

11
00:00:33,920 --> 00:00:38,110
they offer help with fraud detection, with sales tax,

12
00:00:38,110 --> 00:00:40,840
with card issuing, with invoicing,

13
00:00:40,840 --> 00:00:44,050
but they also allow you to collect payments,

14
00:00:44,050 --> 00:00:46,500
for example, credit card payments.

15
00:00:46,500 --> 00:00:49,800
And you can integrate Stripe into your website

16
00:00:49,800 --> 00:00:51,990
through their official API.

17
00:00:51,990 --> 00:00:55,113
So they're clearly defined set of actions

18
00:00:55,113 --> 00:00:58,603
of API endpoints you can use in your code

19
00:00:58,603 --> 00:01:02,530
as soon as you add Stripe to your project,

20
00:01:02,530 --> 00:01:04,400
and that's exactly what we're going to do

21
00:01:04,400 --> 00:01:05,553
in this core section.

22
00:01:06,413 --> 00:01:10,060
Now I will say that every API and every service

23
00:01:10,060 --> 00:01:12,465
you're going to use is different.

24
00:01:12,465 --> 00:01:16,450
You always have to dive into the official documentation

25
00:01:16,450 --> 00:01:18,990
to learn how to integrate a given service

26
00:01:18,990 --> 00:01:21,690
and API into your project.

27
00:01:21,690 --> 00:01:24,273
For Access, you had to read the documentation

28
00:01:24,273 --> 00:01:27,483
of that package to learn how to use the Access API.

29
00:01:27,483 --> 00:01:31,110
For a Stripe you'll have to dive into their documentation

30
00:01:31,110 --> 00:01:32,900
to add payments successfully.

31
00:01:32,900 --> 00:01:36,265
Services are so different that there is no uniform

32
00:01:36,265 --> 00:01:38,480
way of adding them.

33
00:01:38,480 --> 00:01:40,915
Still, the example I'll show you in this course section

34
00:01:40,915 --> 00:01:43,620
should help you get started.

35
00:01:43,620 --> 00:01:45,043
And speaking of getting started,

36
00:01:45,043 --> 00:01:48,803
on Stripe.com, if you go to this developers area,

37
00:01:48,803 --> 00:01:53,300
you should find that get started link to this prebuilt

38
00:01:53,300 --> 00:01:56,070
checkout page, here.

39
00:01:56,070 --> 00:01:59,410
If you can't find it, I also attach a link to that page,

40
00:01:59,410 --> 00:02:00,950
to this lecture.

41
00:02:00,950 --> 00:02:04,294
Here, you can learn how you can add Stripe checkout,

42
00:02:04,294 --> 00:02:07,740
which is a way of handling payments to your website.

43
00:02:07,740 --> 00:02:10,530
And it's one of the easiest way of handling payments.

44
00:02:10,530 --> 00:02:13,240
That's what we're going to use this approach.

45
00:02:13,240 --> 00:02:14,915
Again, Stripe has many features

46
00:02:14,915 --> 00:02:18,610
and you definitely should check out official documentation

47
00:02:18,610 --> 00:02:22,250
if you are serious about adding it to your own website.

48
00:02:22,250 --> 00:02:24,410
Here, I'm going to focus on a relatively

49
00:02:24,410 --> 00:02:26,185
simple demo instead.

50
00:02:26,185 --> 00:02:29,423
So, Stripe checkout is the product I want to use,

51
00:02:29,423 --> 00:02:32,190
and now we can go to the left here

52
00:02:32,190 --> 00:02:34,740
and see a sample integration.

53
00:02:34,740 --> 00:02:37,323
Now, the Stripe documentation is really amazing.

54
00:02:37,323 --> 00:02:40,600
You can see code examples here on the right,

55
00:02:40,600 --> 00:02:43,260
and you can easily switch between different programming

56
00:02:43,260 --> 00:02:47,500
languages to see how you would integrate Stripe into these

57
00:02:47,500 --> 00:02:49,423
different programming languages.

58
00:02:50,280 --> 00:02:53,660
And in the end, the great thing is that using Stripe

59
00:02:53,660 --> 00:02:58,063
in your note project for handling payments is super easy.

60
00:02:58,063 --> 00:03:02,520
In the end, a three step process, you could say.

61
00:03:02,520 --> 00:03:05,520
You will need to create a Stripe account.

62
00:03:05,520 --> 00:03:07,750
We're going to do this in a second.

63
00:03:07,750 --> 00:03:11,390
Then you need to install the Stripe third party package.

64
00:03:11,390 --> 00:03:14,660
Stripe is more than just a third party package,

65
00:03:14,660 --> 00:03:18,540
but you still need a third party package to communicate with

66
00:03:18,540 --> 00:03:21,960
that Stripe API from inside your code.

67
00:03:21,960 --> 00:03:26,270
Some APIs work without such packages, some APIs give

68
00:03:26,270 --> 00:03:30,456
you URLs to which you can send requests to trigger

69
00:03:30,456 --> 00:03:33,784
certain actions or get certain pieces of data

70
00:03:33,784 --> 00:03:36,420
for a Stripe, here, it's different.

71
00:03:36,420 --> 00:03:38,610
We install a third-party package,

72
00:03:38,610 --> 00:03:40,830
which will then behind the scenes,

73
00:03:40,830 --> 00:03:44,184
talk to that Stripe API by sending requests.

74
00:03:44,184 --> 00:03:47,475
It will still always be about sending requests though,

75
00:03:47,475 --> 00:03:50,690
because our website will need to communicate

76
00:03:50,690 --> 00:03:52,450
with Stripe's servers,

77
00:03:52,450 --> 00:03:55,710
and that only works through requests and responses,

78
00:03:55,710 --> 00:03:57,390
but it will be hidden from us

79
00:03:57,390 --> 00:03:59,850
with help of that third-party package.

80
00:03:59,850 --> 00:04:02,550
So therefore, we will need to install that.

81
00:04:02,550 --> 00:04:05,125
And then we'll have to write some code for sending

82
00:04:05,125 --> 00:04:08,027
the right data to the Stripe servers,

83
00:04:08,027 --> 00:04:10,107
through that Stripe package.

84
00:04:10,107 --> 00:04:14,053
And to then proceed correctly, once we get back a response.

85
00:04:15,940 --> 00:04:19,500
Now, therefore let's go through these steps, step-by-step

86
00:04:19,500 --> 00:04:22,060
and integrate payments into our online shop

87
00:04:22,060 --> 00:04:23,263
in the next lectures.

