Jump to content
Larry Ullman's Book Forums

All Activity

This stream auto-updates     

  1. Today
  2. Hi Larry, I can see the test charges now - they don't show in the dashboard until you capture them. Thanks as always for your insights. Cheers, Necuima
  3. Thanks! Just one more questions regarding this script...header.html includes line: require('../mysqli_connect.php'); I presume this line will point to the mysqli_connect.php file, that is, per your safety recommendations, located outside web directory. if header.html file is located on my PC in C:/xampp/htdocs/includes folder, and htdocs is my web directory, mysqli_connect.php file should be located in xampp folder (two levels up from includes folder)? Do I need to change script line from ../mysqli_connect.php to ../../mysqli_connect.php? Appreciate your help very much!
  4. Okay, that makes sense. If you're running an HTML script directly, then PHP code in that script won't be executed. You should instead be running the PHP script that includes the header file.
  5. Yesterday
  6. To clarify, the chard ID is not the same as the token. The token is the representation of the payment method, which is used to create a charge. As for not seeing the charges in the Dashboard, you are looking at test data, which should show the results. I'd look at the logs in the Dashboard to see if requests are being made and also confirm you're using the right API keys.
  7. What do you mean by "when you run the script"? What script are you running? Or, better yet, what URL are you using when you see that result?
  8. Hmmm... your visible tab title there makes me wonder if there's not actually an HTML problem that's at the root here. I'd look for that first. If that's not it, if I recall correctly this chapter probably does an HTML index version first. I'd confirm whether or not that's rendering properly.
  9. Mmmm, I have the charge captured now but to be truthful I don't properly understand this. I retrieved the id from the response body: $charge__id = $charge->id; $charge = \Stripe\Charge::retrieve($charge__id); $charge->capture(); and the id is clearly not the token. So I hope that I am doing it correctly! A further query, I cannot see 'response_reason_text' in the log so maybe it is only there if the charge gets rejected? Again, any advice will be most appreciated. Thanks, Necuima
  10. Thanks to the advice received, I am making progress. I can send a charge for payment and receive confirmation that it is marked as 'paid'. But I have a puzzlement re page 518 re 'capturing charges'. Firstly, it seems that the charge_id is the token - is my understanding on this point correct? I used that anyway in the 'retrieve' statement and it did not object. (I am adapting Larry's code here for my own purposes, in fact a single charge). The '$charge->paid returns true which I test in my code and I can also see it in the Stripe test log. It does this whether I invoke the 'retrieve' and 'capture' statements or not. But the dashboard does not show any $s even though I have now sent dozens of charges all of which have returned true for paid. Any advice will be most appreciated and thank you in anticipation. Necuima
  11. Yes, I now have SSL enabled on my localhost XAMPP environment - thank you for the advice.
  12. Hi, I am trying to figure out problem with header.html (Script 17.1). When i run the script, instead of links like Home, Forum Home, New Thread....i see ' . $words['home'] . ' '. $words['forum_home'] .' ..etc. My first impression was i typed something wrong. I replaced my file with file code download from the forum site but the problem is still present. I appreciate any help! Thanks!
  13. Last week
  14. Hi, I'm working my way through the book, enjoying it very much! Thank you! Quick question - I cannot see the top of the page for exercise 3.5, and all attempts to add padding via CSS are not working for me. I've attached a screen shot so the issue can be seen. Any advice would be appreciated. Thanks! Sincerely, Russ Conte index.php header.html
  15. You can also create your own SSL certificate and sign it off for the browser to accept, a simple search on google will give you a tutorial to complete this task. Regards
  16. Hello, I am having problem in creating prepared statements for the below code example. The $s_id has auto incremental value. Will someone point me with an example on how to do this according to the code below? $s_id = $db->insert_id; $update = $db->query("UPDATE mb SET s_id = {$s_id} WHERE id = {$cs}"); Thank you.
  17. I expect the problem is you CANNOT test from localhost without SSL. If you use Let's Encrypt, you can get a free, legit certificate to use for testing purposes.
  18. Ah, okay. Kudos for figuring it out and thanks for letting us know!
  19. It's OK - I tried \Stripe\Charge:: etc and that did not give the error. But now I have another error which seems to be associated with an SSL certificate. As mentioned I am trying to test this on localhost which, in my case, does not have an SSL certificate. I understood from a previous query on Stripe that I could test this from localhost without my XAMPP/Apache having an SSL certificate. Have I mis-understood this? The beginning of the error is: "An error occurred in script 'C:\xampp\htdocs\DMChat\modules\process_payment.php' on line 213: Stripe\Error\ApiConnection Object ( [message:protected] => Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com. (Network error [errno 77]: error setting certificate verify ..............." This was from the catch block: catch (Exception $e) { // Try block failed somewhere else. trigger_error(print_r($e, 1)); } Again, your advice will be most appreciated, Necuima P.S., you can probably figure out that I am using your model/view/controller approach from the advanced book :-)
  20. Hi Larry, I am trying to use Stripe from my localhost and have established a test account with Stripe Australia. I am getting error "Class 'Stripe\Stripe_Charge' not found in .....on line 182 - I am on page 508 in the book. I have Stack-Overflowed and tried their solutions but none work. I am not able to use composer as I'm using PHP 5.5.3 on Windows 7 so I did the manual download and as far as I can tell all that is OK. Again, any advice will be most appreciated. Cheers, Necuima
  21. Earlier
  22. It's OK, I've found the issue. As my design does not follow yours exactly I need to add the additional data to the $_POST/form via hidden elements. Sorry to have bothered you. Necuima
  23. Hi Larry, I am trying to use STRIPE for the first time. I have set up a test account and that seems to be OK. I am adapting your form in billing.html but in a PHP script. The validation of my data via the ajax call to Stripe is OK as I am able to submit the form but when I check what data are received by my adaptation of your billing.php I can see the posted token but no form data. My form is attached. Can you see what I am doing wrong please? Thanks, Necuima
  24. In the chapter 2 review, the first question is: What is the significance of a form’s attribute? Of its attribute? If I'm understanding the question correctly, the "Of its attribute?" clause has at least two corrections. One is that it is repetitive and not needed, the second is that "its" should be possessive, "it's" if the clause is supposed to be there. I believe the correct question should be, "What is the significance of a form’s attribute?"
  25. I'll list typos as I find them, if I don't see them on the forums. I believe the words "the and" should be deleted from the last line below. This is in the text around Script 2.1 and I'm using the e-book edition of the Fifth Edition: 3. Begin the HTML form: <fieldset><legend>Enter your information in the form below:</legend> I’m using the and HTML tags because they group the form elements nicely (they add a box around the form with a title at the top). This isn’t pertinent to the form itself, though.
  26. I forget if I have examples of this in the book--I suspect I do--but here's an explanation of options for you that should work: https://stackoverflow.com/questions/11693234/php-mysql-gets-value-of-out-parameter-from-a-stored-procedure
  1. Load more activity
×
×
  • Create New...