Closed GoogleCodeExporter closed 9 years ago
thank you for reporting this bug.... I will fix and let you know.
Original comment by nfranc...@gmail.com
on 29 Mar 2012 at 6:43
Please check commit 2402
Original comment by nfranc...@gmail.com
on 6 Apr 2012 at 9:12
I'm afraid that commit 2402 doesn't work. I updated just OerderForm.php,
attempted to make a test purchase, and got the attached error.
Original comment by hjr29s...@gmail.com
on 9 Apr 2012 at 9:52
Attachments:
Okay, it fails at line 81 of EcommercePayment.php:
if($result->isProcessing()) {
>>>> return $result->getValue();
}
The Payment_Processing object that PayPalExpressCheckoutPayment returns leaves
$value at its default, which is null. The PayPalPayment class that comes with
the Payment module sets $value to be a form. It looks like it's using JQuery to
get the client to auto-submit the form, and move to the next step. The
WorldPayPayment class does something similar. Rather weird code. I think that a
simple redirect is more reliable (will work even when Javascript is switched
off).
It looks like the payment_paypal module needs a small update. I'm not sure what
$value in the returned Payment_Processing object should be set too, but it
looks like a simple string will do.
Original comment by hjr29s...@gmail.com
on 9 Apr 2012 at 10:19
Okay, next problem. Having updated PayPalExpressCheckoutPayment to set
Payment_Processing's $value to " ", it now fails at the next error. See the
attached error message.
Line 150 of OrderForm.php needs to be changed from:
ShoppingCart::singleton()->tryToFinaliseOrder();
to
$order->tryToFinaliseOrder();
After these two changes, it works as it should.
Original comment by hjr29s...@gmail.com
on 9 Apr 2012 at 11:11
Attachments:
COMMENT:
"The Payment_Processing object that PayPalExpressCheckoutPayment returns leaves
$value at its default, which is null. The PayPalPayment class that comes with
the Payment module sets $value to be a form. It looks like it's using JQuery to
get the client to auto-submit the form, and move to the next step. The
WorldPayPayment class does something similar. Rather weird code. I think that a
simple redirect is more reliable (will work even when Javascript is switched
off)."
REPLY:
The form works in such a way that it can be submitted if JS is turned off and
it auto-submits if JS is turned on. This is a good, because it creates a
simple POST that looks like a post from the user. it is a little strange at
first, but it works.
COMMENT:
"It looks like the payment_paypal module needs a small update. I'm not sure
what $value in the returned Payment_Processing object should be set too, but it
looks like a simple string will do."
REPLY:
The isProcessing Method should return TRUE - returning " " is dangerous! Yes,
it is a true value, but it looks like false!!!
FIXED
THANK YOU for looking into all this.
Original comment by nfranc...@gmail.com
on 10 Apr 2012 at 1:54
QUOTE:
The isProcessing Method should return TRUE - returning " " is dangerous! Yes,
it is a true value, but it looks like false!!!
REPLY:
I was NOT talking about the isProcessing() method, but the value returned by
getValue() (i.e., the value of the $value field). Look again at the code that I
quoted (line 81 of EcommercePayment.php):
if($result->isProcessing()) {
>>>> return $result->getValue();
}
Note the ">>>>" pointing to getValue().
The getValue() method returns the value passed to the constructor. I suggested
a dummy string simply because other payment classes return strings, and all
that was required was not returning null. While hackish, this solution works (I
tested it).
I hope that you fixed the value returned by getValue(), and not the
isProcessing() method (which wasn't broken in the first place). If not, replace
line 95 of PayPalExpressCheckoutPayment.php:
return new Payment_Processing();
with:
return new Payment_Processing(true);
Original comment by hjr29s...@gmail.com
on 10 Apr 2012 at 3:19
Original issue reported on code.google.com by
hjr29s...@gmail.com
on 29 Mar 2012 at 4:37Attachments: