Strange payment cancellation message from Stripe

  • Posts: 719
  • Thank you received: 3
7 years 7 months ago #266808

Hi,
it was from yesterday that from my Hikashop site i receveid a notification email about an order that has its payment cancelled on Stripe.
From yesterday I've received 3 emails always the same email for the same order.
It is an old order completed succesfully.
On my Hikashop backend, now, the order is cancelled by the notifications that my site receives.
I've just contacted Stripe and they tell me that on error log they have an error:

Parsed Request POST Body



{
  "amount": "2620",
  "currency": "EUR",
  "description": "Ordine numero : 1785"
}


Response body



{
  "error": {
    "type": "invalid_request_error",
    "message": "Must provide source or customer."
  }
}
They said me to contact Hikashop because from their end it is OK.
Could you help me please?
Thanks a lot
My best regards


my site with Hikashop
www.lacasettabio.it
Last edit: 7 years 7 months ago by lacasetta.

Please Log in or Create an account to join the conversation.

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
7 years 7 months ago #266843

Hello,

I'm not sure to know how you get this error, but maybe one of your customer keep his pay order email, and click on the "pay now" link ?... For an already payed order ? As result stripe can't generate (again) a token for a payed order, and so HikaShop can't post a response WITH this token.
It's just a guess from what we know...

To avoid this you can edit your stripe.php, around line 128, you have this :

...
$this->loadPaymentParams($dbOrder);
		if(empty($this->payment_params))
		{
			echo 'The system can\'t load the payment params';
			return false;
		}
	        $this->loadOrderData($dbOrder);

		$return_url...

Replace it for this :
...
$this->loadPaymentParams($dbOrder);
		if(empty($this->payment_params))
		{
			echo 'The system can\'t load the payment params';
			return false;
		}
		if (!isset($_POST['stripeToken'])) {
			
			echo 'Token is missing, possible to finish this order';
			return false;
		}
		
		$this->loadOrderData($dbOrder);

		$return_url...

That will avoid this kind of error in the futur, and keep your Confirmed (or Shipped) order status.
Hope this will fit your needs.

Regards

Last edit: 7 years 7 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
7 years 7 months ago #266897

Hi,
thanks for your help.
After that, when I add a product on my cart i have This error:
0

syntax error, unexpected 'defined' (T_STRING)

So, I can't apply your patch.
Could you help me more, please?
Thanks a lot
My best regards
Antonio


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 7 months ago #266922

Hi,

This modification cannot create that error.
So either you didn't do it correctly, or the error comes from something else.
Also, you shoudl turn on the debug mode and error reporting in order to get the full error message because with the reduced version like you provided, we can't even say if it's one or the other.

Please Log in or Create an account to join the conversation.

  • Posts: 719
  • Thank you received: 3
7 years 7 months ago #266979

I'm sorry, your right, excuse me!
It was a cache issue.
After I've deleted the site cache the patch works.
Thanks a lot
My best regards
Antonio


my site with Hikashop
www.lacasettabio.it

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum