Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order get´s placed when clicking browsers back button from PayPal login #19

Open
slowhand11 opened this issue Nov 23, 2020 · 1 comment

Comments

@slowhand11
Copy link

'version' => '4.0.2',
TYPO3 9.5.22

@MasterGeddon
Copy link

I fixed this issue kinda, its something wich needs to be adjusted in the code.

cart_paypal redirects by a succes only on cart\order show , thats why only the order is placed.
so you need to redirect to the update function from order\payment.

`
if ($this->cart) {
$orderItem = $this->cart->getOrderItem();

            $this->invokeFinishers($orderItem, 'success');
            //$this->redirect('show', 'Cart\Order', 'Cart', ['orderItem' => $orderItem]);
            $this->redirect('update', 'Order\Payment', 'Cart',['hashmissing' => "$hash"]);

}
`

also the order sendmails method has en error in the parameters where he wrote @paran so this needs adjustment.
/** * Send Mails * @param \Extcode\Cart\Domain\Model\Order\Item $orderItem * type here had paran instead of param * @param string $type * @param string $class * @param string $function */ protected function sendMails(\Extcode\Cart\Domain\Model\Order\Item $orderItem, $type, $class, $function) {

with this the fix is not yet finished because the hash wont get transfered to the update function because the request is lost at that point.
so you need to give it as argument from your success function . which means the update method needs an optional parameter
which needs to be read.

`
/**
* * @param string $hashmissing
*/
public function updateAction($hashmissing = null)
{
if ($this->request->hasArgument('hash') && !empty($this->request->getArgument('hash'))||$hashmissing !=null) {
if($hashmissing !=null){
$hash = $hashmissing;
}else{
$hash = $this->request->getArgument('hash');
}
...
}

`

atleast thats how i managed to fix this problem. But this needs to be update in cart_paypal and his cart extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants