Post by ir210 » Mon Feb 16, 2009 4:00 pm

Hi, there, this is my first post but I start it with a problem ;D

I'm using version 1.1.7 and when I performed the purchasing using paypal for the first time, it succeeded. But it was not the case for the next one. The second transaction failed with message "This invoice has already been paid. For more information, please contact the merchant." after I pressed the pay button (The message appeared in paypal's site). This happened also for the third one, forth one and so on even if I change my purchased products.

This problem occurs as if opencart sends the same id (or something) to paypal every time it initiate the transaction.

I would be very grateful if someone can help me with this problem.

Sorry for my bad english.  :D

Newbie

Posts

Joined
Sun Feb 15, 2009 4:17 am

Post by Daniel » Mon Feb 16, 2009 6:43 pm

Are you clicking back or somthing once the payment is complete?

A new order should be generated everytime you goto the checkout page.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ir210 » Tue Feb 17, 2009 9:31 am

Thank you for your reply.

I am afraid no. I followed every instruction paypal gave me.

BTW, I love the way OpenCart v1.x code being organized. Nice code you got there ;). It saved me a lot of time to add "trial software download" support to OpenCart's core. Salute to all developers.
Last edited by ir210 on Tue Feb 17, 2009 9:36 am, edited 1 time in total.

Newbie

Posts

Joined
Sun Feb 15, 2009 4:17 am

Post by Daniel » Tue Feb 17, 2009 9:57 am

which versio are you using?

and what do you mean tail software? are you selling this software?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ir210 » Tue Feb 17, 2009 10:51 am

No. I'm intending to use this software to sell softwares which in my case provides a way to download the trials. I'm sorry if my words suggests such misunderstanding :'(

My bad, in my first post I stated that I'm using version 1.1.7, in fact I'm still using version 1.1.5. I was assuming that I was downloaded the latest version since I just downloaded it four days ago. But when I look again to the version number of my copy, as you suggested, it is version 1.1.5.

Will the new version fix my problem?
Last edited by ir210 on Tue Feb 17, 2009 10:54 am, edited 1 time in total.

Newbie

Posts

Joined
Sun Feb 15, 2009 4:17 am

Post by ir210 » Tue Feb 17, 2009 2:52 pm

I tried using version 1.1.7 with fresh database and different browser, the same message appeared even for the first time. The paypal keeps recognizing every orders I made as the same order  ???. Any solution?

Two things they (my orders) have in common are my paypal sandbox account and my laptop's internet configuration :P.

Thanks in advance.
Last edited by ir210 on Tue Feb 17, 2009 4:00 pm, edited 1 time in total.

Newbie

Posts

Joined
Sun Feb 15, 2009 4:17 am

Post by vince » Tue Feb 17, 2009 5:13 pm

It's because the paypal code sends:



as the invoice#.  There is no dynamic portion so it will always fail.

Here is a patch:

Code: Select all

--- paypal.php.orig     2009-02-17 04:12:10.186992431 -0500
+++ paypal.php  2009-02-17 04:12:10.186992431 -0500
@@ -27,7 +27,7 @@
                $this->data['country'] = $order_info['payment_country'];
                $this->data['notify_url'] = $this->url->https('payment/paypal/callback&order_id=' . $this->session->data['order_id']);
                $this->data['email'] = $order_info['email'];
-               $this->data['invoice'] = date($this->language->get('date_format_short')) . ' - ' . $order_info['firstname'] . ' ' . $order_info['lastname'];
+               $this->data['invoice'] = date($this->language->get('date_format_short')) . ' - ' . $order_info['order_id'] . ' - ' . $order_info['firstname'] . ' ' . $order_info['lastname'];                $this->data['lc'] = $this->language->getCode();
                $this->data['return'] = $this->url->https('checkout/success');
                $this->data['cancel_return'] = $this->url->https('checkout/payment');
@@ -80,4 +80,4 @@
                }
        }
 }
-?>
\ No newline at end of file
+?>

Newbie

Posts

Joined
Tue Feb 17, 2009 5:07 pm

Post by ir210 » Tue Feb 17, 2009 5:54 pm

Thank you, vince, it works  :o. Thank you very much.

What a shame I didn't go to the code first  8).

Hope my problem can be useful for the rest of us  ;D

Newbie

Posts

Joined
Sun Feb 15, 2009 4:17 am

Post by Daniel » Tue Feb 17, 2009 7:21 pm

i've put a fix in the next release

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 18 guests