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.
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........................
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.
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...?
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 .
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()
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).
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.
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.
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
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.
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?
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.
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?
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
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.
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........................
Just wanted to say thanks for this little series Brad you helped me out alot and you broke it down nicely
Wow that was fast! How were you able to pump out a 26 minute video in 5 minutes?
Obviously Brad has an alcubierre engine that compresses space time...
phenomenal video Brad
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.
This code does not work for database insertion
yeah im having the same problem. I checked my database params and they are correct.
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...?
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 .
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()
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).
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.
Same, did you find a solution since then?
any solution?
can i use paypal instead of stripe
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?
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.
Awesome video very fast and short time bigknowledge 💕
.how can we learn that ..??
New ideas:
Jest testing
Redux
Axios http
why not just use the stripe api to query their database?
the customers and transaction tables are already there
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
Same here did you end up solving??
Great video. I don't use PDO, I use SQLi. PDO seems like an awful lot of extra work.
it's more secure, than sqli, but it's true, more work
SQLi is good if you use prepared statements
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.
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?
I have the same problem. Did you ever find a solution?
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.
bro how do you add all inclusive privileges?
I was getting this same error. In my case I had an error with the password being submitted to the database.
Love it.
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?
Stupid question, but how do I disable the 424242 card when I deploy my app?
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)
@@daynisolman7550 Thank you!
thanks bro...
update script on github for php7.4
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
Please do you find what is this error ??
@@edwardswidler7952 I used local host instead of the local host ip in the config file.
thank you bro
1
most useless tutorial ever doesnt explain anything just puts code down and never goes into detail about how it acutally works