PayPal Checkout 2.0 - Monetize React, Angular, & Vue Quickly

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 181

  • @snwdn
    @snwdn 3 года назад +29

    2:08 Angular
    5:43 React
    7:31 Vue

  • @ggg-kr7my
    @ggg-kr7my 5 лет назад +96

    How can you always predict wich tutorial i need? 10 / 10

    • @FilledStacks
      @FilledStacks 5 лет назад +3

      haha, I think it's a super power because he's doing it for me too :)

    • @alperguven4829
      @alperguven4829 5 лет назад +1

      This happens to me with Traversy Media :D

    • @schimefpv
      @schimefpv 5 лет назад +1

      Haha same here! Cheers!

    • @aurelianspodarec2629
      @aurelianspodarec2629 3 года назад

      You choose what most people want, and do it.

  • @lifasibiya4810
    @lifasibiya4810 5 лет назад +14

    It's always a pleasure to hear from you Jeff. I come from a village in South Africa, you inspire me all the time.

    • @codeaperture
      @codeaperture 3 года назад

      I'm Kenyan and I love SA 🔥

  • @alinrosuaprins
    @alinrosuaprins 5 лет назад +16

    I love how you also included REACT in your courses.

  • @nvictorme
    @nvictorme 5 лет назад +69

    That’s why I’m a Pro member... You’re keeping me employed :v

    • @Fireship
      @Fireship  5 лет назад +12

      That's my goal... help people build products and/or get jobs!

    • @codeaperture
      @codeaperture 3 года назад

      😂😂😂💯

  • @gregfletcher2360
    @gregfletcher2360 5 лет назад +4

    Awesome! Btw this is the only channel I don't turn speed to 1.5x +

  • @DEV_XO
    @DEV_XO 5 лет назад +3

    Mate, I love your channel, like everyone who watch your videos. Sadly I'm a React dev, and besides I still enjoy all your content, watching some react examples, makes this even better for most of us.
    Hope you keep adding some react / vue examples from time to time, it was just amazing. Thanks you! :insert here emoji heart:

  • @dependersethi1345
    @dependersethi1345 5 лет назад +10

    5/5 As always✨
    Please create a series for handling payments in Flutter(in-app purchases) one time payment and subscription payments.
    Thank you so much! :)

    • @Fireship
      @Fireship  5 лет назад +5

      In app purchases will happen soon... Already working on that one for Flutter :)

    • @dependersethi1345
      @dependersethi1345 5 лет назад

      @@Fireship Thank you so much! ♥️ Please consider the payment subscription model as well 🙏

  • @ben34256
    @ben34256 5 лет назад +17

    For React couldn't you just place the script in public/index.html?

    • @roulzhq
      @roulzhq 5 лет назад +1

      Same thing for vue I think. The public folder was there, I would say it's the exact same as in Angular.

  • @tiptail
    @tiptail 3 года назад

    Thank you so much for this! I was able to add a PayPal button to my Quasar (Vue) project. I adapted your example so that my application will not only take payments via PayPal, but also send an email to myself and the person filling out the form. It's a small application that lets people join a club. :) Just wanted to say thanks!

  • @FilledStacks
    @FilledStacks 5 лет назад +3

    Jeff with the slam dunk video! This is literally Exactly what I needed to implement the next set of features in my Vue app 😊

  • @dealloc
    @dealloc 5 лет назад +1

    Just clear things up; You don't need to use imperative method to include script tags for React. You can simply include it like any other script in the HTML template, that also can be changed using create-react-app - Just make sure it is loaded _before_ React, so that you have access to the API globally through 'window'.
    Even better, if you don't want to use the imperative API from Paypal, you can wrap it with in a Context and use the 'useContext' (or a custom hook) to expose a nicer API to use within your components.

  • @trevorsmith8950
    @trevorsmith8950 4 года назад

    He doesn't say this explicitly, but make sure you import ViewChild and ElementRef into your Angular component (check out import statement at 3:00). Probably self-evident for some, but took me a bit to realize I had to import them. Thanks for the tutorial, was very helpful for me.

  • @zyadyasser196
    @zyadyasser196 5 лет назад +1

    Perfect, loved the easy demonstration.

  • @levizjaperdije8499
    @levizjaperdije8499 3 года назад +1

    does this need a backend configuration? or something else?

  • @chacondorodo96
    @chacondorodo96 4 года назад +1

    I'm passing some props to paypalButton but every time this property changes, a new button is created inside the div instead of changing the already existing button property, can you help me?

    • @iBmx1994
      @iBmx1994 4 года назад

      I am having the same issue. Did you manage to resolve this ?

  • @mattgarelli1371
    @mattgarelli1371 3 года назад +2

    Quick question: Couldn't someone just edit the client side code in browser inspection tools to send a different value? I.e. send your backend the correct price, inject a separate price in PayPal.

    • @PointlessPOS
      @PointlessPOS Год назад +1

      You could, but this is managed on your backend API to reject these kinds of behaviors.

  • @imlautaro123
    @imlautaro123 4 года назад +2

    Angular: 2:08
    React: 5:45
    Vue: 7:30

  • @barbieroalex
    @barbieroalex 5 лет назад +3

    The api is super OP!, but the big problem with the api is the time needed to load it the api is horrible slow.

    • @moonythm
      @moonythm 5 лет назад +1

      U can use a service worker to cache it

  • @will_abule
    @will_abule 5 лет назад +30

    I didn't know why angular lost its popularity it was so much easier I swear.

    • @Fireship
      @Fireship  5 лет назад +13

      It's still very popular, just not on hype train. I agree, was the most intuitive framework for this video.

    • @will_abule
      @will_abule 5 лет назад +1

      @@Fireship anyway I still die with it, best for enterprise web app to my opinion.

    • @dealloc
      @dealloc 5 лет назад +4

      I believe it has to do with the amount of major changes that weren't backward compatible that caused the decline of adoption. While it is still used, I suspect most large projects haven't bothered to upgrade, because they don't have the resources to do so.
      React has been quite good at keeping the API stable and backwards compatible and provided tools to effectively and easily upgrade breaking changes, if any. Vue goes with the same philosophy, and now Angular is following suit with their newer versions.
      What is important to note is that Angular is a full-fledged framework with a lot of functionality built-in, whereas Vue and React are merely view libraries. Personally I like React because I don't need a framework to build my app (small and large)-I have found a nice sweet spot with the tools are provided by the community but also write myself.

    • @will_abule
      @will_abule 5 лет назад +2

      @@dealloc Vue is a framework but pretty lightweight

    • @madcroc111
      @madcroc111 5 лет назад

      Mostly because Angular has lots and lots of boilerplate. I wonder why you think it's so much easier when usually it's regarded as the most complicated one. When you look at surveys there's a big part of Angular devs who want to get rid of it. React and Vue don't

  • @hugocardoso1488
    @hugocardoso1488 5 лет назад +2

    But making payments in the frontend, isn't a vulnerability? Someone could change the amount and you can't prevent it securely, it should be done in the backend rigth?

    • @Fireship
      @Fireship  5 лет назад +1

      If you have something that is fulfilled instantly, it is a good idea to validate on the backend. In theory, anything done of the frontend can be reverse engineered.

  • @skipmonday6467
    @skipmonday6467 5 лет назад +2

    Let the money flow

  • @matheusinkreator
    @matheusinkreator 4 года назад

    Oh man! Thanks for this video... helped me so much.

  • @hodotsofficial
    @hodotsofficial 3 года назад

    window.paypal.Buttons is not a function in React part

  • @nahojazz
    @nahojazz 4 года назад

    Wow what a great tutorial nice and quick, React hooks. High quality work my friend.

  • @Zharkan16
    @Zharkan16 3 года назад

    How does the user know how the product will be shipped? does the logistics look through the paypal account and see their addresses so they can ship out?

  • @BrayanLoayza
    @BrayanLoayza 4 года назад

    Thanks bro, works like a charm.

  • @aissamouajib
    @aissamouajib 5 лет назад +2

    Awesome Video, we need things like this with flutter also please!
    Thank you.

    • @Fireship
      @Fireship  5 лет назад +1

      Expect an Flutter in app purchases video in the near future :)

  • @idtyu
    @idtyu 5 лет назад

    The stripe competitor from PayPal is not PayPal api, but Braintree. That one can take credit cards without going thru PayPal account, and the fees associated with it

  • @ikezedev
    @ikezedev 5 лет назад

    That was so easy...Jeff is at it again 😍

  • @massiveleg
    @massiveleg 4 года назад

    this only works with one product tho. How to connect the paypal button with cart full of items and different item quantities?

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 5 лет назад +1

    Thank u for this awesome video

  • @3DPTR
    @3DPTR 4 года назад

    Excellent Tutorial! thanks !!

  • @physicsimpossible73
    @physicsimpossible73 4 года назад +1

    How did you actually find out how to do this? PayPal documentation (and user interface) suck! Stripe is so much easier

  • @michaelobasi2687
    @michaelobasi2687 3 года назад

    8:02 "Vue will React auto-Angularly" - Fireship

  • @theskysthelimit.
    @theskysthelimit. 4 года назад

    thank you! great teaching!

  • @massiveleg
    @massiveleg 4 года назад +1

    When I wrote the React project I don't see the Paypal button when I deployed

  • @nicolatoledo
    @nicolatoledo 4 года назад +1

    i have the button in a lazy module the first time work but the second time no and return this error
    Error: Window closed
    does anyone have the same issue?

  • @dayzmelttogether
    @dayzmelttogether 3 года назад

    Cannot read property 'map' of undefined i did the vue tut i have a sandbox account ..what gives

  • @blado9059
    @blado9059 4 года назад

    I have a question. In my proyect I have differents modules so when I try to run the code in a different module it doesnt work but if I put the code in appModule works good. So how can I fix it?

  • @theblackharted
    @theblackharted 4 года назад

    Jeff is there an easy way to keep the PayPal overlay up from when the customer hits approve until capture is confirmed? In other words, until 'paidFor' is true? The buttons briefly show again after approve, before it flips to the confirmation text. I'd rather show the user that payment is processing.

  • @roccodenicolo3921
    @roccodenicolo3921 4 года назад

    On which card/bankAccount the 'buyer' will send the money ? Is there any option to set that ?

  • @gabrielmcreynolds7947
    @gabrielmcreynolds7947 4 года назад

    Fantastic tutorial! Just wondering how I can dynamically load the edit the where you set your client-id, because I need to dynamically set the merchant-id parameter, and I can't do that in index.html for Angular. Thanks!

  • @ElStego
    @ElStego 3 года назад

    Video Chapters would help everyone that only cares about one of those 3 frameworks :)

  • @yogenp
    @yogenp 5 лет назад

    I implemented this in a PWA exactly a week ago. !

    • @sirmooby
      @sirmooby 5 лет назад

      Hi. can i use this for subscription payments

  • @DexkillTutorials
    @DexkillTutorials 5 лет назад

    Awesome for In-Browser applications, not so good for electron, I did not found any method to open the Paypal popup to correctly finish the payment process and there seems to be not much information about this.. am I missing something?

  • @ultraimagehub
    @ultraimagehub 4 года назад

    Please! always with react! your solution is my first-to-go!

  • @josueorozcoaltamirano7101
    @josueorozcoaltamirano7101 2 года назад

    Not so easy on Vue 3 composition api, the documentation it's a real mess... I did it at the end but it wasn't that clear.

  • @games3976
    @games3976 4 года назад

    @Fireship 6:58 it didn't work in your React example not because of weird dependencies but because how Hooks work. Your state method setLoaded is a hook itself that produces a new state of loaded, which runs after the useEffect hook has finished. What you could've written instead would be following: script.addEventListener("load, handleLoaded); while having const handleLoaded = () => { window.paypal.Buttons(..).. }

  • @abeetbored
    @abeetbored 5 лет назад

    any way to do it in a class based component? getting a " Cannot read property 'Buttons' of undefined " :( . Suspect that it has something to do with setState triggering a re-render.

  • @EmilianoC76
    @EmilianoC76 4 года назад

    Good tutorial but I would jump straight to the repo, the code there's better organized and polished.

  • @ramonportales8368
    @ramonportales8368 4 года назад

    thats good, but if I click the option of "credit or debit card" there's a lot of field to fill, I dont need it how can I configure all those fields?

  • @CodeWithNasir
    @CodeWithNasir 3 года назад

    used couch, decent condition!

  • @caolanfanning7261
    @caolanfanning7261 3 года назад

    does anyone know if this doesnt work in europe? my sandbox works but my live doesnt

  • @Jack74r
    @Jack74r 5 лет назад

    I using Nuxt i have error with this example
    500 (Internal Server Error)
    Error: Order could not be captured

  • @loanpincher2631
    @loanpincher2631 4 года назад

    It seems that in my case, the paypal is being read before the script has finished loading, so, it throws me a "paypa is undefined". Please, can someone help me on this?

  • @markmbugua2108
    @markmbugua2108 3 года назад

    Hi I changed the Client ID and now the paypal buttons are not loading on my page. What might be the problem?

  • @YinonOved
    @YinonOved 5 лет назад

    while integrating bluesnap payment on a site I wondered why they are not using package modules and u clear it out for me, non the less I loaded the script dynamically upon navigation to the relevant feature module that uses the bluesnap service. is there a caveat why I should not do that? why would we want to load the script at the index.html level?

  • @gilberttorchon1280
    @gilberttorchon1280 4 года назад

    my paypal button was working just fine this morning but it stopped showing. What am I doing wrong?

  • @YousefSh
    @YousefSh 3 года назад

    Paypal Checkout + React = 💥.
    Can't get it working.
    Just shows loading page in paypal popup.

  • @rpaivabr
    @rpaivabr 5 лет назад

    If I'm using ssr with universal, how can I get the paypal var on document? :/

  • @benton202
    @benton202 4 года назад

    all of a sudden this doesn't work. i get a 422 error after days of completing this... WHYY?

  • @RajenParekh13
    @RajenParekh13 4 года назад

    I don't really have much clue about this, but is this secure, what security measures will I have to take to implement this in a website?

  • @mahrukhayub2233
    @mahrukhayub2233 3 года назад

    What should I do to make the paypal transaction live rather than sandbox?

  • @chiubaca
    @chiubaca 3 года назад

    do you need to pay to create a Paypal business account?

  • @mogipls
    @mogipls 3 года назад

    This works perfectly well! However, what if I wanted a dynamic price, like it depends on the number of things they want to buy?
    Problem is that when I tried implementing this, the paypal button kept re-rendering, and it kept duplicating the paypal button :(

  • @LC-qg6of
    @LC-qg6of 3 года назад +1

    Is anyone else getting "unhandled_error: zoid destroyed all components"?

  • @MikeNugget
    @MikeNugget 5 лет назад

    What about payment platforms for mobile development i.e. for Ionic, Flutter e.t.c.?

  • @guilhermebais
    @guilhermebais 5 лет назад

    nice!, and about inapp purchase of applestore and playstore? i think we cannot add paypal checkout on apps, because of their policy

  • @Diamonddrake
    @Diamonddrake 5 лет назад

    Using a hook to load the script means you might download the script multiple times in your application, your hook really should check if the script has been loaded already

    • @kabiskac
      @kabiskac 3 года назад

      That useEffect needs [] as a dependency, and there should be another hook with the dependency of "loaded"

  • @GK_Aptitude_Reasoning_Test
    @GK_Aptitude_Reasoning_Test 5 лет назад

    How to dynamically set client I'd from a configuration file?

  • @williamjamesrapp7356
    @williamjamesrapp7356 4 года назад

    **QUESTION** How do I get a result from a PAYMENT process ( like STRIPE or PAYPAL ) to Trigger an Event or Function in MY website ?
    I am building a Business Website where in steps ( 1 ) a Customer ( anyone this is not a Subscription nor membership site ) comes to my web site Fills out a Form for DATA SUBMISSION into the Database. ( 2 ) Once the DATA Form is filled out they press NEXT button ( 3 ) they are taken to a 3rd party PAYMENT page where they fill out a payment form and then press SUBMIT ( 4 ) once the SUBMIT button is pressed payment is process ( 5 ) ONLY AFTER PAYMENT IS APPROVED THEN I want the Data to be submitted into the data base.
    QUESTION Is STEP # 5 completed with JS or some other language ? *HOW do I complete the process where AFTER PAYMENT IS ACCEPTED from a 3rd party payment processor ( like STRIP or PAYPAL ) THEN the data from the Already filled out data form is submitted into the data base ??* IS A WEBHOOK required to make this possible ? (if so how would one code that ) Is GET, Fetch, or some third party server required ??

  • @jonathankaufman120
    @jonathankaufman120 4 года назад

    How do you get order details once the payment is executed?

  • @rheasamson3528
    @rheasamson3528 5 лет назад

    Ohh!! That's great

  • @fffhshf345
    @fffhshf345 5 лет назад

    you don't have to use mounted: function()... u can just use mounted(){}

  • @MohamedAli-rb2sn
    @MohamedAli-rb2sn 5 лет назад

    Thanks :)

  • @user-cv3er1qj8y
    @user-cv3er1qj8y 3 года назад

    thank you~~~

  • @daggy1234
    @daggy1234 3 года назад

    hey it would be really cool if you made a paid tutorial for both stripe and paypal

  • @keerthipriyachunduri7648
    @keerthipriyachunduri7648 4 года назад

    Which version of angular is this?

  • @MrMagic1163
    @MrMagic1163 5 лет назад

    So, how would this guarantee that I do not mess with the price on the client side?
    Even on the PayPal docs, it never goes to the backend for e verification of any kind, just goes from client to paypal and back to the client.
    developer.paypal.com/docs/archive/checkout/integrate/

  • @godmakoto1041
    @godmakoto1041 5 лет назад

    Ok so i dont see much information whats the difference between firebase and other platforms,?

    • @aserillll
      @aserillll 3 года назад

      What do you mean you don’t see much information? Google has thousand of articles comparing fire base to other services

  • @anticom1337
    @anticom1337 5 лет назад +1

    8:02 "And vue will react automatically" ...i wish this was true :P

  • @danielsimionescu298
    @danielsimionescu298 5 лет назад

    How do your videos come exactly when I need them? Anyways, thanks 😆

  • @syeddaniyal1273
    @syeddaniyal1273 4 года назад

    5:45 is react, 7:30 is vue

  • @acche-rc
    @acche-rc 5 лет назад

    Still prefer Stripe. Paypal used to (not sure about now) randomly deny accepting credit card and make registering a Paypal account mandatory

    • @Fireship
      @Fireship  5 лет назад

      Stripe is still better overall IMO, but I actually use both side-by-side now.

  • @tkdevlop
    @tkdevlop 5 лет назад

    Is there is a reason why we can't put script in public/index.html in head for react?

    • @Fireship
      @Fireship  5 лет назад

      The public folder can be deleted and overridden, so you generally don't want src code there.

    • @dealloc
      @dealloc 5 лет назад

      @@Fireship That is not true. If you delete the public folder, in React's case, it won't be able to compile your project. The public folder is made for public assets, that shouldn't be part of the transpilation step (except for the index.html being used as a template).

    • @Fireship
      @Fireship  5 лет назад

      @@dealloc You're right, I just found that in the create-react-app docs. I stand corrected. Just merged a pull request in the code that cleans up the react example.

  • @ivanabregu1
    @ivanabregu1 4 года назад

    The couch! lol

  • @sylviecypher4692
    @sylviecypher4692 3 года назад

    buttons not rendering

  • @gilberttorchon1280
    @gilberttorchon1280 4 года назад

    Can yo do recurring payment with that method?

  • @joshuacharley1431
    @joshuacharley1431 4 года назад

    Awesome

  • @arsenemn
    @arsenemn 3 года назад

    Csn you do another video for react native

  • @theskysthelimit.
    @theskysthelimit. 4 года назад

    please make video for more than two products.

  • @AviatorXD
    @AviatorXD 5 лет назад +1

    RUclips wont fix the resolution

  • @carlosdanieldasilvaoliveir152
    @carlosdanieldasilvaoliveir152 4 года назад

    what about react native ?

  • @sydneymolobela4953
    @sydneymolobela4953 5 лет назад

    Hi, thank you for this tutorial. How do I make an actual paypal payment in angular?

    • @yogenp
      @yogenp 5 лет назад

      Change the Sandbox Client ID to Live Client ID. Viola! Your payment gateway is live.

    • @Fireship
      @Fireship  5 лет назад +1

      @@yogenp That is literally all it takes 👍

  • @won1626
    @won1626 5 лет назад

    Grate 👏

  • @JFkingW
    @JFkingW 5 лет назад

    So whats better? stripe or paypal?

    • @Fireship
      @Fireship  5 лет назад

      It depends. Stripe is still better overall IMO, but PayPal is preferred by many and supported in more countries. They are really close in feature parity and pricing.

    • @dealloc
      @dealloc 5 лет назад

      I find that Stripe is fantastic if you don't want to tie yourself and users into a mandatory process. Stripe has a nice Payment API too (and React components as well, for example).
      I have used Stripe for all projects that I have worked for, so I am a bit biased. But also because I don't particularly like the account-centric side of PayPal. I just like to have a simple, user-friendly payment flow.

  • @SethuSenthil
    @SethuSenthil 5 лет назад

    Are there any fees?

  • @aslouche
    @aslouche 5 лет назад

    bro you are the best

  • @RagoDN2
    @RagoDN2 5 лет назад +1

    For React, shouldn't you just inherit React.Component? From what I understand, it's easier to use classes for components with state, and then reserve functions for components without state.

    • @antegulin9050
      @antegulin9050 5 лет назад

      Not anymore, since React v16.7 you don't neeed to use classes, ever. Now you can use hooks to handle effects & state in functional components.

    • @RagoDN2
      @RagoDN2 5 лет назад

      @@antegulin9050 That's fine, but are the drawbacks of using classes that substantial? I don't think I'd prefer a purely functional approach, but more power to you if that's your thing.

    • @madebylewis
      @madebylewis 5 лет назад +1

      Functional components feel so clean plus the composability and reusability when you factor in hooks, such a pleasure to write 🤩

    • @antegulin9050
      @antegulin9050 5 лет назад

      ​@@RagoDN2 There is no difference between a class and a functional component anymore, Both can be stateful and handle effects. However, functional approach (/w hooks) is a better approach simply because its reusable and produces less code (more readable code). Concept of classes does not yield any advantages for React components and is inferior to the functional approach.

    • @dealloc
      @dealloc 5 лет назад +2

      There's multiple reasons why React is recommending function components (with hooks) over class components.
      Firstly, hooks allows for reusability by composition without the need to use higher-order components. This is tremendously valuable for sharing logic between components and makes the component tree a lot simpler (especially in DevTools).
      Secondly, it's a lot easier to write side effects without having to deal with multiple lifecycles.This makes your code simpler in terms of flow, and on top of that it can be reused across components with much less effort (as explained above).
      Finally, classes are more complex than functions when it comes to error handling, as well as providing tools to help your lint and auto fix problems in your code that may cause unnecessary re-renders.