Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change order numbers WEB BASED OSCOMMERCE


Guest

Recommended Posts

This question is for Web based OSCOMMERCE there is no phpadmin or uploading ftp files or anything like that neither is there any editing of .php files. My hosting provider installed OS Commerce for my site and OSCOMMERCE runs on the servers NOT on my computer.

 

I am running my store in sandbox and testing the configurations. And when I am getting to the end of an order in paypal sandbox it says:

 

"This invoice has already been paid. For more information, please contact the merchant."

 

I have deleted all my orders in my web based OSCOMMERCE under Customers => Orders and then I deleted all my cookies but I keep getting the same error. I read somewhere that I have to change the order numbers because Paypal won't complete an order with the same order numbers.

 

So how do I alter order numbers in Web based Oscommerce?

 

Thank you for your assistance.

Link to comment
Share on other sites

Casey,

 

Enable the COD payment method and place a COD order. This will increase the order number so you can continue to test the site with PayPal as needed.

 

 

 

 

Chris

Link to comment
Share on other sites

Okay I will spend more time testing it and let you know the results. I did do a quick test but I also didn't delete cookies (although I did delete orders) and had the same error. I am very grateful for your help. I will let you know more after further testing.

 

Casey

Link to comment
Share on other sites

explanation : Paypal allows one payment per order id.

 

So incase you have already tested with say order id 2 then you can not use the same order id to test.

 

So either increase order id by an arbitrary number( contrib exist) or place few orders using COD.

 

Or change sandbox account.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

explanation : Paypal allows one payment per order id.

 

So incase you have already tested with say order id 2 then you can not use the same order id to test.

 

So either increase order id by an arbitrary number( contrib exist) or place few orders using COD.

 

Or change sandbox account.

 

Satish

 

 

 

Thanks for repeating all of my posts Satish, I am sure if they didn't understand me that they would read your reply and then understand. mellow.png

Link to comment
Share on other sites

The Paypal IPN I installed had this text file included in the download.

 

Not sure if it applies to your install or not:

 

"This invoice has already been paid" PayPal error message

Background:

The PayPal IPN sends a parameter "invoice" to PayPal. This parameter is equal to the order ID (1,2,3,4 etc). However, PayPal requires the invoice parameter to be unique so if you have already sent an order ID with the same number, then it will be refused. Sending the same order ID can e.g. happen if you have two osCom shops linked to one PayPal account - the PayPal account cannot distinguish between different shops / domains / databases, it just looks at the number and says "hey, that's already been paid!"

There are two possible solutions:

 

******************************************

1. Create a unique invoice ID for each shop

this solution keeps the invoice ID check functionality but allows you to create unique IDs

Description:

If you have multiple shops linked to your PayPal account, then you get around this problem by adding a unique letter to your invoice parameter. As the invoice parameter can be any string (max length 127), it doesn't matter that it's not numeric. If you run several shops all with one PayPal account, then choose a different letter for each shop.

Note: this solution is for coders who have a reasonable knowledge of PHP. To alter your invoice parameter:

In /includes/modules/payment/paypal_ipn.php find this code:

$parameters['invoice'] = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

and change to this:

$parameters['invoice'] = 'K' . substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

choose any letter but keep it to ONE letter only!

In /ext/modules/payment/paypal/ipn.php just after

curl_close($ch);

}

 

add

$invoice_id = substr($_POST['invoice'],1);

and then replace all occurrences of

$_POST['invoice']

with

$invoice_id

(use a search / replace function if available)

 

The above code will add the letter to the order ID when sending to PayPal and then strip it back out again with the substr command. It's vital that you replace all occurences of the variable in ipn.php as otherwise your database update won't happen or be wrong.

I've tested it on my online shop and it's all working in Sandbox - I think it's a cleaner solution than just changing the order IDs to something higher as previously suggested. And it's also sustainable over time (think 10 years down the road when you have thousands of orders), plus even with just one letter you can run up to 26 different shops on one PayPal account.

******************************************

2. Disable the inoice ID checking

with this solution PayPal will not check for duplicate order IDs - a potential problem if customers e.g. hit a button twice. I'd recommend to try the first solution first, and only if that fails, try this second one:

In your PayPal account, go to "Profile" - > "Payment Receiving Preferences". In there you will have the option:

Block accidental payments:

You may prevent accidental payments by blocking duplicate invoice IDs

Yes, block multiple payments per invoice ID

No, allow multiple payments per invoice ID

Select "No".

PayPal will now allow all orders to be paid, even if the order ID has already been paid previously. A potential problem is if customers pay an invoice twice by mistake (e.g. refreshing browser, hitting button twice etc.).

 

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Chris,

 

Okay I ordered 19 items COD and then tested Paypal and still getting:

 

"This invoice has already been paid. For more information, please contact the merchant.

 

 

 

Return to [email protected]

 

At this time, we are unable to process your request. Please return to [email protected] and try another option.

 

So I am wondering if this is related to something else instead of order numbers.

I don't know if this is related or not but when I go into "Orders" everything says "pending" on it.

Is there some further processing that I am not doing correctly?

Link to comment
Share on other sites

Okay within sandbox I opened another account and tested it and had the same results.

 

Any more ideas?

 

(for any newcomers keep in mind this is web based oscommerce not a download).

Link to comment
Share on other sites

If you collect what was the request sent to paypal ( This should not be complex) you will get order id that's posted to Paypal.

Once you have that check if any of your previous order used this order id.

Or is the same order id sent again and again.

 

This observation will help you.

Its pretty simple and just switching to other script is not going to be of help.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...