last day (28 days later) » 

3:13 PM
0
A: Paypal not proceeding to recieve the payment

Cameron HurdThere's a possibility that the var_dump() statements you have are violating the "no content output before header" rule and therefore, the user's payment flow stops with your code, before the header('Location: ' . $redirectUrl); can redirect to PayPal to finish the job. Try removing those var_dum...

 
Hi @cameron-hurd You mean I should var_dump($val) of the above code and replace it with error_log(printf($val, true))
 
That's right - error_log doesn't output anything, and passing true as a second argument to printf returns, rather than outputs the value. If content before output is the problem, this will let you sidestep that while still examining the variable's values.
 
I did the replace and now it prints just the word "Array" instead of the previous message (which is in the figure) :(
 
I see you've got a var_dump_str function on this class somewhere... is that being called? Could it be outputting the Array text? The name of the game is to find the source of the output in order to test the thesis that header() is failing to redirect the user.
 
I am calling in the front-end page as $current .= self::var_dump_str($log) . "\n"; And it is defined as follows static function var_dump_str() { $argc = func_num_args(); $argv = func_get_args(); if ($argc > 0) { ob_start(); call_user_func_array('var_dump', $argv); $result = ob_get_contents(); ob_end_clean(); return $result; } return ''; }
 
3:13 PM
Try commenting it out for now - for the same reason above. We want to avoid output in order to see if that's preventing the client from being redirected by the header() call.
Hi - happy to take a look at your BB repo (bitbucket.org/siddharthrao/paypal/src). My BitBucket username: cam5
 
Thanks a lot
Let me add you there
I did
I know it is a very small mistake, that too taking it from the previous developer who did it half.
Not able to find, what is missing in the code
@CameronHurd You mean comment the call to that function?
 
Yes - just comment it out, we want to avoid outputting anything.
Temporarily, anyway. :) You might want to refactor it into a logging function later!
 
Ok
Let me try
It still prints just array
 
3:36 PM
I'll try to fire it up over lunch and see what debugging I can help with. But I'm sure that the printing is the problem.
 
Thanks a lot. No matter where you are I will make sure that I wil deliver beers to you if this starts working
hahah
 
4:32 PM
Hey, I've cloned the plugin into a WP instance, and created a page called Payment with {edri_payment_form} as it's content. I've also temporarily re-included the frontend.js file that's commented out for whatever reason, (bitbucket.org/siddharthrao/paypal/src/…) and altered the paymentPageUrl var to my local wp instance's URL
However, I'm not sure where this plugin handles the POSTed payment info that you talked about in your question! Could you maybe help point to that?
Also - the jal_install function that creates custom db tables when the plugin is activated... it doesn't seem to fire. Don't know if you've intervened manually on your end about that.
 
@CameronHurd That is when I try to make the payment
I mean when I try to make the payment the messages which I posted in the question is displayed
 
When I try to make the payment, by filling out the form on the /payment page I created, with the {edri_payment_form} shortcode...
It just redirects to the same page again
 
Strange
 
No var_dumps anywhere. So I wonder if there is something special about /payment?
 
I am heading back home now. In a bus. Let me check the jal_install as well
 
4:44 PM
Yeah - I'm trying to follow this up the stack. What calls prepare_payment?
 
$transactionID = $paypalPayment->prepare_payment($payment);
this one in the edri_payment/EdriPayment.php
 
5:00 PM
But that's also in static function prepare_payment($payment), is it not? what calls that?
 
5:12 PM
Just realized that I hadn't added <?php do_action("-edri-payment_hook"); ?> to the active theme.
Though, to be sure, I don't see any actions hooked on to -edri-payment_hook in the plugin code. Wondering if there's more in your theme that I'm not privy to
I'm wondering... are you calling something like

$e = EdriPayment::get_instance();
$e::prepare_payment($_POST);

in your theme files?
Okay - I'm movin' now. If I comment out line 157, where it's calling self::var_dump_str... I end up being redirected to edri.org/donation-oops
This is progress!
Okay - I think this solves the initial problem... the code references var_dump_str on a different class. So invoking it from self doesn't work... Try subbing in this on line 157:
$current .= EdriPayment::var_dump_str($log) . "\n";
For me, anyway, I get a message that my lookup has timed out. Probably because I don't have PayPal configured properly.
 
6:17 PM
Still didn't get it
:(
 
Do you have something like $e = EdriPayment::get_instance(); $e::prepare_payment($_POST); on your donation page, though? I want to be sure I'm troubleshooting the same way that you are. ;)
 
Let me check again
 
I just haven't been able to confirm exactly how the form is posting to the prepare_payment method.
 
I don't think I am calling that at least in my code
 
When I added it to my pages, I was able to start debugging the form in earnest.
Can you drop this line var_dump(debug_backtrace());die; into the top of the prepare_payment method in EdriPayment.php:333, and paste the output here?
 
6:28 PM
There is slight problem. I am not being able to connect to the server, as I am not in this NGO's network
Didn;t know this
So I guess, I cannot make the changes tonight
I would really appreciate if we can try to continue this tomorrow if possible.
Thank you so very much for all your efforts
 
Ah, that's tough luck, isn't it?
 
I know
:(
 
Well, I'd really like to win that bounty, so ping me tomorrow when you're back at work, and I'll try to help again.
 
Hahah
Definitely yes
I will ping you tomorrow Cameron
 
I mean, apart from the satisfaction of helping a fellow dev. ;)
 
6:31 PM
Thnks again
 
Have a nice evening ____?
I'm sure your name isn't kingmakerking
 
Thanks.. Wish you the same.
 
But have a nice evening, kingmakerking. :)
 
My name is Sid
 
Alright Sid - catch you later!
 
6:33 PM
Bubye
 

  last day (28 days later) »