PHP, MySQL & Stripe API Payment App - Part 2

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

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

  • @SteveSmith-jc7pc
    @SteveSmith-jc7pc 3 года назад

    Great, well-structured video as always Brad.
    One comment about the number of times you typed in words e.g. transaction in place of customer. I find for a few replacements double clicking highlights the word CTRL-C to copy then highlight each of the words to replace and CTRL-V and when there are a lot then as before double-click on the word, then in VS Code CTRL-H opens the find and replace. You can then highlight the text area where the replacements are to be made, click the symbol that looks like a paragraph to the right of the find field and this effectively selects the highlighted area for replacement. Then click the replace all symbol to the right of the replace field. (This would also have saved the oversight of changing the customer table name to transactions, which I find is easily done when copying code and then changing it.
    Hope this helps some people that may be new to VS Code.

  • @shubhamkumarsingh8224
    @shubhamkumarsingh8224 6 лет назад +2

    thank you for this couse sir .......... i am just watching ur javascript on udemy couse and trust this is fantasting ................ once again thanks Mr. Brad........................

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

    Just wanted to say thanks for this little series Brad you helped me out alot and you broke it down nicely

  • @ArtyCraftZ
    @ArtyCraftZ 6 лет назад +3

    Wow that was fast! How were you able to pump out a 26 minute video in 5 minutes?

    • @stephenpeters9125
      @stephenpeters9125 6 лет назад

      Obviously Brad has an alcubierre engine that compresses space time...

  • @Jo-zq1ig
    @Jo-zq1ig 4 года назад

    phenomenal video Brad

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

    I wish you could explain this with procedural PHP, all I need to do is capture Stripe Customer Id (stripe_user_id) in my database and I can't seem to find any info that can help me.

  • @TheEric8866
    @TheEric8866 6 лет назад +3

    This code does not work for database insertion

    • @KeepItFresh02
      @KeepItFresh02 6 лет назад +1

      yeah im having the same problem. I checked my database params and they are correct.

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

    Tnx for this wonderful video sir...👍
    I hope the login system to view transactions by a user using your Transaction ID from the payment page is on the way...?

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

    Great tutorials, exactly what i was looking for. I have a little issue, after filling up the form and click the "submit query" button it loads to an empty page which is the "charge.php" file. No errors displayed I cant tell what is wrong. Please I really need your guidance . Thanks in anticipation .

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

    If you're downloading the source for this, there are currently two errors in charge.php 'newCustomer' and 'newTransaction' are missing spaces between them. They should be 'new Customer' and 'new Transaction' to avoid these errors:
    Fatal error: Uncaught Error: Call to undefined function newCustomer()
    Fatal error: Uncaught Error: Call to undefined function newTransaction()

  • @designbox6166
    @designbox6166 6 лет назад

    Great tutorial! Thank you so much.
    I think it would be great to create "autobind" method within the Database class. That way, you can supply an array of parameters with matching keys and it will bind to the query "automatically". I think it will save you time from binding each parameter individually (something you do @12:50 and @20:00).

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

    Fatal error: Call to a member function query() on null in C:\xampp\htdocs\PayPage\models\Customer.php on line 16 ----------> I have this error any solution please.

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

    can i use paypal instead of stripe

  • @cassandraspencer1476
    @cassandraspencer1476 6 лет назад

    Thank you this is extremely helpful to me. May I ask you one question? Why would you use a PDO rather than using raw SQL?

    • @stephenpeters9125
      @stephenpeters9125 6 лет назад

      I think its because PDO's commands are private (they can't be changed nor is it their job to directly mutate input), and by that nature, theres a protect layer of code that malicious coders can't easily exploit.

  • @perfectstarting5588
    @perfectstarting5588 6 лет назад

    Awesome video very fast and short time bigknowledge 💕

  • @arr-trtxtxqz0.a.ts-y3-dllj32
    @arr-trtxtxqz0.a.ts-y3-dllj32 3 года назад

    .how can we learn that ..??

  • @pikachu5223
    @pikachu5223 6 лет назад +1

    New ideas:
    Jest testing
    Redux
    Axios http

  • @cunningham.s_law
    @cunningham.s_law 6 лет назад

    why not just use the stripe api to query their database?
    the customers and transaction tables are already there

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

    I got this Fatal Error..
    Fatal error: Uncaught Error: Call to a member function query() on null in C:\xampp\htdocs\stripe3\models\Customer.php:11 Stack trace: #0 C:\xampp\htdocs\stripe3\charge.php(41): Customer->addCustomer(Array) #1 {main} thrown in C:\xampp\htdocs\stripe3\models\Customer.php on line 11

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

    Great video. I don't use PDO, I use SQLi. PDO seems like an awful lot of extra work.

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

      it's more secure, than sqli, but it's true, more work

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

      SQLi is good if you use prepared statements

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

    followed this tutorial and got your files, put my test keys in and it only creates a token but will not charge. Not sure why this is happening. Also if I try it with checkout it will work, any help would be great.

  • @davidadomako5004
    @davidadomako5004 6 лет назад +1

    Please I have a n error after clicking submit payment: Fatal error: Call to a member function prepare() on null in C:\xampp\htdocs\paypage\lib\pdo_db.php on line 37. Any help please?

    • @willmoore716
      @willmoore716 6 лет назад

      I have the same problem. Did you ever find a solution?

    • @willmoore716
      @willmoore716 6 лет назад +1

      I figured out what caused the error, so I'll explain in case anyone else has the same problem. The error above is caused by a database connection problem. For me I needed to give my mysql database user all inclusive privileges. I solved the error above by going into my cPanel and adding all inclusive privileges to the database user I created--it does not do it automatically when you create a new user. I'm using Hostgator by the way. Once I did that, it solved the problem, but another one popped up: Fatal error: Uncaught exception 'PDOException' (syntax error). To solve this I went into the Customer.php file and changed the single quotes ( ' ' ) that incased the INSERT INTO query, to double quotes ( " " ). It now looks like this: $this->db->query("INSERT INTO customers (id, first_name, last_name, email) VALUES(:id, :first_name, :last_name, :email)"); I'm aware that double quotes are discouraged unless your using variable names (Ex: $first_name), but the single quotes generated an error for my particular case--not sure why.

    • @nebby_15
      @nebby_15 6 лет назад +1

      bro how do you add all inclusive privileges?

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

      I was getting this same error. In my case I had an error with the password being submitted to the database.

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

    Love it.

  • @indrithaxhidauti3082
    @indrithaxhidauti3082 6 лет назад

    Im trying to use this code with live api but on my charge.php file i get an error:
    Your conection on this site is not seccure.
    I have ssl but i still get this error.
    Any one can help me please?

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

    Stupid question, but how do I disable the 424242 card when I deploy my app?

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

      Changing stripe api keys from test to live will do this automatically. (sk_test and pk_test are replaced with sk_live and pk_live)

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

      @@daynisolman7550 Thank you!

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

    thanks bro...

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

    update script on github for php7.4

  • @catonchronic5354
    @catonchronic5354 6 лет назад

    Getting this:
    Fatal error: Uncaught Error: Call to a member function prepare() on null in C:\xampp\htdocs\paypage\lib\pdo_db.php:37 Stack trace: #0 C:\xampp\htdocs\paypage\models\Customer.php(10): Database->query('INSERT INTO cus...') #1 C:\xampp\htdocs\paypage\charge.php(45): Customer->addCustomer(Array) #2 {main} thrown in C:\xampp\htdocs\paypage\lib\pdo_db.php on line 37

  • @arlindademaj4106
    @arlindademaj4106 6 лет назад

    1

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

    most useless tutorial ever doesnt explain anything just puts code down and never goes into detail about how it acutally works