Тёмный

Stripe for Beginners with PHP | Online Payment Collection with Pre-Built Checkout Session 

CS with NJ
Подписаться 3,2 тыс.
Просмотров 13 тыс.
50% 1

In this series we are going to learn to integrate a payment gateway into our web application. We are using Stripe as a payment gateway.
We are starting off this series with integrating a pre-built checkout session page with our application using PHP.
#StripeForBeginners #Stripe #StripePhpIntegration #checkoutSession #checkoutSessionWithPhp #PHP #checkout
0:00 - Introduction
0:58 - Stripe Dashboard
3:58 - Stripe Workflow
7:22 - Front-end
13:55 - Backend
Code could be found at github.com/nurj20/Prebuilt-St...
Stripe: stripe.com/

Опубликовано:

 

13 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 96   
@davidduron3590
@davidduron3590 2 года назад
For one year I've avoided learning this because every tutorial is so complicated. I really enjoyed the way that you teach and am now watching all of your videos. thank you very much.
@CSwithNJ
@CSwithNJ 2 года назад
Thank you much; these words mean alot to me 🙏 ❤
@leeeric6292
@leeeric6292 4 месяца назад
@@CSwithNJ No, as u mentioned in your video at 22:00, it is defined from two to nine items, and I have already tried one item, don't work, and it works for two items...
@CSwithNJ
@CSwithNJ 4 месяца назад
@leeeric6292 oh I get it now; you are watching first video in this playlist where I was teaching just Stripe elements and the cart items are manually and statically added. if you want to see it in a more realistic scenario then watch video no. 3 in the same playlist. In that video I have implemented whole shopping cart from frontend (where user is adding items to the cart dynamically) to backend logic including stripe gateway integration.
@leeeric6292
@leeeric6292 4 месяца назад
@@CSwithNJ Thanks and I might go through it also then...
@srgberni
@srgberni Год назад
Thanks heaps! You made every step so easy to understand :) Subscribed for more content like this from now on!
@tetthys3620
@tetthys3620 Год назад
Thanks Thanks!! What a clear tutorial!
@sharoonbhatti4386
@sharoonbhatti4386 2 года назад
Well done! Perfectly explained! Best tutorial on stripe with PHP!
@CSwithNJ
@CSwithNJ 2 года назад
Thanks alot 😊
@sharoonbhatti4386
@sharoonbhatti4386 2 года назад
@@CSwithNJ I have been getting this error while integrating to my site: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
@CSwithNJ
@CSwithNJ 2 года назад
Take a picture of ur console tab and send me to thedigitalnj@gmail.com. let me have a look at it.
@rudolftillian5422
@rudolftillian5422 2 года назад
Hi, this is one of the best tutorials that explain Stripe on PHP. It gives me a perfect overview of all the components. Well done!
@CSwithNJ
@CSwithNJ 2 года назад
Thank you so much; you made my day ❤
@groodbrood8950
@groodbrood8950 2 года назад
soooo trueeeeee best ever
@terrymurray2076
@terrymurray2076 2 года назад
Nice video NJ. I would like to see how you would handle the addition of taxes to the final checkout amount.
@alexandrdrobyshevsky7220
@alexandrdrobyshevsky7220 2 года назад
Thank you very much!
@CSwithNJ
@CSwithNJ 2 года назад
You are most welcome ☺
@OnyeStephen
@OnyeStephen 5 месяцев назад
Thank you for this wonderful video, it is the best on RU-vid. Can you make a video for stripe payment with a custom form rather than using Stripe page render, I will so love it
@groodbrood8950
@groodbrood8950 2 года назад
I love your videos sssssssssssssssssssssssssssssso much i finaly understood it thank you. and thank god.
@CSwithNJ
@CSwithNJ 2 года назад
Thank you ssssssssssssssssso much. Keep watching, keep learning and keep supporting ❤
@MsamerieJohnson
@MsamerieJohnson Год назад
Thank you
@CSwithNJ
@CSwithNJ Год назад
Glad u found it helpful
@ErusKelayShimaru
@ErusKelayShimaru 2 года назад
Iam Brazilian and my English is very very bad. But I understand your explanation. You explain very easy. I like and I now Iam happy. Congratulations!
@CSwithNJ
@CSwithNJ 2 года назад
Thank you so much. I do really pay attention and try to explain in a way which gets across especially to those who are not native speakers like myself. I am glad it's paying off. Please keep supporting and promoting my channel 🙏 ❤
@danyalkhan5930
@danyalkhan5930 2 года назад
Informative
@CSwithNJ
@CSwithNJ 2 года назад
Thanks alot 😊
@karthikmaniyappan1079
@karthikmaniyappan1079 2 года назад
your legend
@CSwithNJ
@CSwithNJ 2 года назад
Thanks 😊
@carit.psicologo
@carit.psicologo Год назад
Hi, I followed every step, but when I click the button nothing happens, how can I fix it? The code is exactly the same
@CSwithNJ
@CSwithNJ Год назад
Do following 1. if no error in the console, check network tab for the errors 2. check error messages at the server side 3. if none of the above, check stipe dashboard; it also lists failure to serve a request; from there hopefully you will get a hint
@leeeric6292
@leeeric6292 5 месяцев назад
I use Laragon, and I had just downloaded composer, however, when I run the command "composer require stripe/stripe-php" in vscode terminal, it response that "composer" is not recognized...?
@alexali9967
@alexali9967 10 месяцев назад
Very nicely explained and very fluent in English. There is another method whereby the customer doesn't leave our website, can you provide any help please.
@CSwithNJ
@CSwithNJ 9 месяцев назад
Thanks; plz elaborate on this another method.
@leeeric6292
@leeeric6292 4 месяца назад
Thanks for your tutorial. I tried and it works. However, I also have tried one item only (just use one array), it didn't direct me to go to the checkout page even I had click on the button, could you tell me how modified the program in this case ? Thanks.
@CSwithNJ
@CSwithNJ 4 месяца назад
have another look at the code; the logic should work for single item as well.
@LuxKal1122
@LuxKal1122 Год назад
insane
@fnanande7245
@fnanande7245 2 года назад
the composer is very difficult to contact the folder can you please help me how can i find it but thanks for the information
@CSwithNJ
@CSwithNJ 2 года назад
Thanks for liking the tutorial but I am not sure what are you trying to say!!! Plz elaborate.
@sajjadsaleem3713
@sajjadsaleem3713 Год назад
how to redirect the user to the Stripe hosted checkout page by using header location instead of click on button.
@CSwithNJ
@CSwithNJ Год назад
plz elaborate 'header location'.
@avinashkonanki2021
@avinashkonanki2021 2 года назад
How to add multiple payment methods like NetBanking, Google Pay, Apple Pay and Indian UPIS like Paytm etc
@CSwithNJ
@CSwithNJ 2 года назад
I will make a video about Google pay and apple pay but in general you need to mention in the array associated with payment_method-types all the payment types that you want to charge the customer with. You can get the list of such acceptable types from stripe website. For India specific cards, I will have a look and let you know.
@justusblaise7189
@justusblaise7189 2 года назад
such a great Tutorials, thank you very much. I am having some errors which i don't know how to resolve. Just to be sure I had to download your source code to ensure I get it working just like yours but when ever i click the check-Out button i get this error from the console: DataCloneError: The object could not be cloned. get-s.js:9 Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data Error: Promised response from onMessage listener went out of scope please help me out.
@CSwithNJ
@CSwithNJ 2 года назад
Thanks for liking the tutorial. As far as the error is concerned it is not possible to guide most of the time without looking at the code. The best approach in my opinion is to always follow along the tutorial and implement everything yourself from scratch rather then downloading someone else's code.
@kyokauganda7414
@kyokauganda7414 2 года назад
I did the same and had the same ERROR The problem i found was on the list of payment_method_types (ie .checkout,php) she included "alipay" which does not support "gbp" currency which she also was used (SOLUTION) change the currency value from "gbp" to "usd" on the checkout,php page Also make sure to add a BUSINESS name in your stripe account Dashboard if you haven't yet worked for me
@justusblaise7189
@justusblaise7189 2 года назад
@@kyokauganda7414 Thanks alot that solved my issues
@justusblaise7189
@justusblaise7189 2 года назад
@@CSwithNJ Thank you so much for your reply, I actually followed your video when it didn't work as it should I had to download your source code to be sure I wasn't doing something wrong
@kyokauganda7414
@kyokauganda7414 2 года назад
@@justusblaise7189 glad it did
@sqfdjgslkfdjgs
@sqfdjgslkfdjgs Год назад
Great video, I followed all your steps, but nothing happens when I click on Checkout button. Is there a way I can send you the code to check. i watched the video more then 3 times but cannot seems to find the problem.
@CSwithNJ
@CSwithNJ Год назад
Do send me your code at thedigitalnj@gmail.com. I'll have a look at it.
@sqfdjgslkfdjgs
@sqfdjgslkfdjgs Год назад
@@CSwithNJ plz check inbox, I have already sent you the mail
@olivierboulanger1118
@olivierboulanger1118 2 года назад
Hello I've got a problem on this line $stripe = new Stripe\StripeClient("..."); It says that it's undefined type Have an idea ? Thx a lot Happy New Year Celebrations
@CSwithNJ
@CSwithNJ 2 года назад
You have to replace the dots with your stripe key. Create an account with stripe and get the key from developers' section
@CSwithNJ
@CSwithNJ 2 года назад
Have u downloaded the stipe package?
@CSwithNJ
@CSwithNJ 2 года назад
If you have downloaded the code from github then u need to run "composer install" command. You also need to composer installed on your system first. If you are very new then plz watch the video and follow that video. That would be more helpful
@paindos
@paindos 2 года назад
Hi Mam, I want to learn how to make a inbox message system between user and admin? I have found many videos on chat application, but I didn't find Anything that can helpful for making a inbox system between user and admin. Would you please share your opinion. I am really expecting mam.
@CSwithNJ
@CSwithNJ 2 года назад
By inbox between user and admin; do u mean the query that customer sends through contact us type forms and then the user gets response in its email?
@ErnestJeanJr
@ErnestJeanJr 8 месяцев назад
wont the api key be visible inside script.js?
@CSwithNJ
@CSwithNJ 7 месяцев назад
That's the idea behind public and private keys - if you want anyone to send u msg you make your public key public. Anyone who wants to send you msg will use your publicly available key to encrypt the msg. only the intended recipient decrypt the msg using his private key which only he knows. That is the general idea behind. Nobody can access your account by only knowing your public key. A msg could be sent to you but beyond that nothing could be done.
@namibiacodegeek
@namibiacodegeek 2 года назад
Im in Africa where stripe account is not yet deployed please can you open for me stripe account and tell me, your charges please.
@maremeseye3981
@maremeseye3981 2 года назад
Hi, thanks for your tutorial. Can i have source code please ?
@CSwithNJ
@CSwithNJ 2 года назад
In the description
@abdelrahmanmahmoud6028
@abdelrahmanmahmoud6028 2 года назад
hi could you please help me with this error composer : The term 'composer' is not recognized as the name of a cmdlet, function, script file, or operable program.
@CSwithNJ
@CSwithNJ 2 года назад
You need to install composer which is a package manager for php. You can download it from getcomposer.org
@abdelrahmanmahmoud6028
@abdelrahmanmahmoud6028 2 года назад
@@CSwithNJ i already have it installed, checked the path and it keeps giving me the same error
@CSwithNJ
@CSwithNJ 2 года назад
Have you set php's path in the system variable as well?
@abdelrahmanmahmoud6028
@abdelrahmanmahmoud6028 2 года назад
@@CSwithNJ yes i did
@CSwithNJ
@CSwithNJ 2 года назад
One usually gets this error if either php's path or composer's path is incorrect set or not set at all. Recheck your paths then close all commands window then open new command window and give it another try.
@GATIF786
@GATIF786 2 года назад
Dear, How I make price_data and quantity 22:52 dynamic ?
@CSwithNJ
@CSwithNJ 2 года назад
You have two options there; either get it from server database or create a product on Stripe and get the value dynamically as per product id. I will make the video about that shortly in this series about that as well.
@GATIF786
@GATIF786 2 года назад
@@CSwithNJ ​ Thanks. There is one more question, I want to remove the Email option from the stripe checkout page. How do I do that ?
@CSwithNJ
@CSwithNJ 2 года назад
With pre-built checkout page you can't. For that you have to use customization. You can watch my second video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ttrlLzc4aEY.html for that.
@UCSsubhikshaB
@UCSsubhikshaB Год назад
Can you please say your php and xamp version? Mam
@CSwithNJ
@CSwithNJ Год назад
I don't use XAMP; PHP version is 8.0.8 and server that I use comes shipped with PHP itself. Mysql version is 8 as well.
@aliirtaza6936
@aliirtaza6936 2 года назад
from where, i can download these stipe files???
@CSwithNJ
@CSwithNJ 2 года назад
Well, you can't. that's the whole idea behind Stripe or other payment gateways. Because you are collecting critical financial details from customers its not a good idea that any website/application does this directly. You can only link the customer to the stripe and stripe will do that on your behalf. Stripe or PCI compliant which in layman's term simply means that Stripe carries this certificate that allows them to collect user's card details.
@STSN3116
@STSN3116 2 года назад
from 7:31 to 8:59 we can only see one file index.html at 9:00 all of a sudden we see 6 more files added how did that Magic happen in VS code ?
@CSwithNJ
@CSwithNJ 2 года назад
Just follow my instructions. Those file are added when when install stripe library using composer. Later in the tutorial I have also shown how to include install that package. And composer automatically appends these files. Rest of the html files are empty at the moment. You see when I record videos I run into errors and I have skipped that part because I believe it confuses te new learning but at this particular instance I forget to remove those files. But trust me just follow what I am saying; ignore that is in the project window. You won't have any problem At around 14:20 i have realized this and remove those files as well.
@STSN3116
@STSN3116 2 года назад
@@CSwithNJ Thanks for the reply, I know we need to install the PHP Stripe package via composer but just wanted others to understand and don't get confused. I will look into your other windows and see if any such missteps. Thanks
@CSwithNJ
@CSwithNJ 2 года назад
Let's hope it goes well 🙏
@STSN3116
@STSN3116 2 года назад
@@CSwithNJ definitely we can be productive :)
@nextgenjaypalsinh9539
@nextgenjaypalsinh9539 Год назад
i am using this method but getting blank in response help me asap
@CSwithNJ
@CSwithNJ Год назад
You haven't given me much to help you. Plz elaborate a bit more
@nextgenjaypalsinh9539
@nextgenjaypalsinh9539 Год назад
const stripe = Stripe(PUBLIC_KAY); const btn = document.querySelector('#btn'); btn.addEventListener('click',()=>{ fetch("{{ route('create-payment-three')}}",{ method: "POST", headers:{ 'Content-Type' : 'application/json', }, body: JSON.stringify({}) }).then(res=> res.json()) .then(payload=>{ stripe.redirectToCheckout({sessionId: payload.id}) }) }) using this code how can i got response of success or failed payment, i want to update my db based on this
@CSwithNJ
@CSwithNJ Год назад
Can u upload your whole code to github? I'll take a look at the it there.
@nextgenjaypalsinh9539
@nextgenjaypalsinh9539 Год назад
@@CSwithNJ issue solved thanks for video. you have any idea about save cards using session also google pay and apple pay options??
@Nazis_stories
@Nazis_stories 7 месяцев назад
​@@nextgenjaypalsinh9539How was your issue solved????
@NJ-uy9br
@NJ-uy9br 2 года назад
Why dont u attach source code?
@CSwithNJ
@CSwithNJ 2 года назад
I tend to believe that I have explained with reasonable clarity and anyone who has watched the video can do it on their on if follow the instructions in the tutorial correctly. However, I will try to share the code from now on.
@abulalalalalaabulala4521
@abulalalalalaabulala4521 2 года назад
Bro, help me, he say: stripe is not define
@CSwithNJ
@CSwithNJ 2 года назад
Bro upload ur code on github, without looking at the code there isn't I can do.
@abulalalalalaabulala4521
@abulalalalalaabulala4521 2 года назад
@@CSwithNJ Thank you for your reply, I have solved it by myself, your video is great, come on
@urdreamspace
@urdreamspace Год назад
@@abulalalalalaabulala4521 hey how did you solve it
@alexl.349
@alexl.349 10 месяцев назад
It's very hard to undestand your accent. I would suggest to talk slower and use more written material and music. I hope it's not insulting. The tutorial is a really good job!
@CSwithNJ
@CSwithNJ 10 месяцев назад
🤣🤣 no I am not offended but apart from my accent (which I can't help) I find this humourous. You see, I am looking for ways to increase my talking pace; people don't have time to go through videos longer than 10 minutes and my videos are way too long. What do you mean by written material and music though? Do u want me to make silent videos with music?
Далее
Step by step implement stripe payment gateway in PHP
27:43
Passing data with Payment Links
8:09
Просмотров 12 тыс.
Stripe for Visual Studio Code
14:18
Просмотров 9 тыс.
Accept a payment with the Payment Element using PHP
22:02