Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

fresco,

 

Free shipping does work - there is no charge for downloadable media.

 

Greg,

 

you missunderstood,

 

I know about downloadable. what i was referring to is the product that weighs 20LB and costs $20 to ship which I gave customer for free and was unticipating to get paid for shipping - this shipping charge was passed to PayPal but was not added unless i would enter other than 0 for the subtotal.

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Greg,

 

you missunderstood,

 

I know about downloadable. what i was referring to is the product that weighs 20LB and costs $20 to ship which I gave customer for free and was unticipating to get paid for shipping - this shipping charge was passed to PayPal but was not added unless i would enter other than 0 for the subtotal.

 

So your saying the product cost $0.00 and shipping cost $20.00? I don't think PayPal would process this unless the product cost something, say $1.00.

 

The total amount passed to PayPal is ($order->['total'] - $order->['shipping_cost']), this is standard.

 

Without seeing the process/transaction being reffered to here, I would of thought it easier to just login to PayPal and do a SendMoney request.

 

Although an alternative could be to force the shipping_cost to become the total amount passed to PayPal IF $order->sub_total is zero.

 

 

Fireman, theres no easy way to upgrade from 2.4, 2.8 would be worth the upgrade, although I would consider it as more like starting from scratch.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

So your saying the product cost $0.00 and shipping cost $20.00? I don't think PayPal would process this unless the product cost something, say $1.00.

 

The total amount passed to PayPal is ($order->['total'] - $order->['shipping_cost']), this is standard.

 

Without seeing the process/transaction being reffered to here, I would of thought it easier to just login to PayPal and do a SendMoney request.

 

Although an alternative could be to force the shipping_cost to become the total amount passed to PayPal IF $order->sub_total is zero.

.

 

Greg, is this not another example of a problem that might be solved by using the aggregate mode?

 

David

Link to comment
Share on other sites

Fireman, theres no easy way to upgrade from 2.4, 2.8 would be worth the upgrade, although I would consider it as more like starting from scratch.

 

Ok, great! I'll tackle that & see if it fixes my problem with the gift certificates...

Link to comment
Share on other sites

Any one can help me.. Read thru the thread for hrs, until headaches. My poor english.. I just want to solve one of the following problem:

Follow this-->

 

 

Confirm order--Expected

 

 

1.gif

 

 

 

Go to Sandbox.paypal--.Good

 

 

2.gif

 

 

Paid-->

 

 

3.gif

 

 

Transaction done @ sandbox

 

 

5.gif

 

6.gif

 

BUT

 

 

7.gif

 

 

and

 

 

8.gif

 

Thanks in advance..多谢

Edited by yongxin
Link to comment
Share on other sites

Hi yongxin,

 

It's a bit hard for me to go quickly through the whole process again, theres plenty of info in this thread

 

However, first try the IPN Test Panel, and maked sure that the IPN and orders are being processed properly, since in test mode nothing will prevent the order from being updated.

 

If everything is ok you should then be able to test in live mode, either via PayPal's Sandbox or www.paypal.com, if things stop working here then it is because your Primary Email Address and or Business ID is not configured properly, see the FAQs for more info.

 

Regards,

Greg.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

If you try the IPN Test Panel and just get a blank white screen then in paypal/application_top.inc.php uncomment the error_reporting offf.

 

Also have a look at catalog/ipn.php at the top there is some commented code for a debugWriteFile function uncomment it and place a chmod 777 ipn.txt in the catalog root.

hi, Greg.

Do you mean change

 

// set the level of error reporting
// ? ?error_reporting(E_ALL & ~E_NOTICE);
? ?error_reporting(0);

 

to this:

 

// set the level of error reporting
? ?error_reporting(E_ALL & ~E_NOTICE);
?error_reporting(0);

 

but i still got blank tsting page

 

also nothing in table paypal..

Edited by yongxin
Link to comment
Share on other sites

I just installed v2.9 & I'm getting these errors on orders that where previously placed on the old version.

 

1054 - Unknown column 'p.paypal_id' in 'on clause'

 

select p.payment_status from paypal p left join orders o on p.paypal_id = o.payment_id where o.orders_id ='22'

 

I'm not sure what I need to change to get these errors to go away. Anyone have a suggestion?

 

Thanks

Link to comment
Share on other sites

1054 - Unknown column 'firstname' in 'field list'

 

insert into orders_session_info (sendto, billto, firstname, lastname, payment, payment_title, payment_amount, payment_currency, payment_currency_val, language, language_id, currency, currency_value, content_type, txn_signature, orders_id) values ('4', '4', 'Joel Test', 'Gallant', 'paypal', 'PayPal', '11.57', 'CAD', '1.00000000', 'english', '1', 'CAD', '1.00000000', 'mixed', 'b614582afcc2afb9d98bcfa816de1faa', '30')

 

[TEP STOP]

 

 

Ok, I'm also getting this error.

 

I've searched my db to try to figure it out, but I'm stumped....

Link to comment
Share on other sites

yongxin,

// set the level of error reporting
   error_reporting(E_ALL & ~E_NOTICE);
//    error_reporting(0);

 

Fireman, which sql script did you run, if migrating from 2.4 etc, then you should just run paypal.sql.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

So your saying the product cost $0.00 and shipping cost $20.00? I don't think PayPal would process this unless the product cost something, say $1.00.

 

The total amount passed to PayPal is ($order->['total'] - $order->['shipping_cost']), this is standard.

 

Without seeing the process/transaction being reffered to here, I would of thought it easier to just login to PayPal and do a SendMoney request.

 

Although an alternative could be to force the shipping_cost to become the total amount passed to PayPal IF $order->sub_total is zero.

Fireman, theres no easy way to upgrade from 2.4, 2.8 would be worth the upgrade, although I would consider it as more like starting from scratch.

 

is there a possibility do do something like (i am not a coder!!!):

 

if $order->['total'] = 0 - $order->['total'] + 0.10

$order->['total'] - $order->['shipping_cost']),

 

 

 

Nimitz_1061

 

i am using aggregate mode

Link to comment
Share on other sites

I still don't understand whats happening, and you didn't confirm or comment on my last post, e.g what I'm assuming the problem maybe.

 

0.10, whats the significance of this?

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

I still don't understand whats happening, and you didn't confirm or comment on my last post, e.g what I'm assuming the problem maybe.

 

is the above addressed to me?

 

0.10, whats the significance of this?

 

0.10 will add 10 cents (service fee) to a 0 cost order therefor PayPal will pocess the shipping for that order correctly.

 

PS. this will is for not to have problem with someone accumulating enough discounts to get a product free. - my products are heavy and I do not want to ship them free...

 

Scenario:

 

Product 1 cost $150

Coupon -$150

 

Shipping $34

 

oder_total - 0

order_shipping - 34.00

 

result - problem processing

 

Goal:

 

Product 1 cost $150

Coupon -$150

 

Shipping $34

 

oder_total - 0 + 0.10 = 0.10

order_shipping - 34.00

 

result - processing success!

Link to comment
Share on other sites

Although an alternative could be to force the shipping_cost to become the total amount passed to PayPal IF $order->sub_total is zero.

I suggested earlier the above, would that not suffice?

Doing the above requires alot less changing than having to accomodate a $0.10 processing fee which should really be burdened by the Merchant and not the customer.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

sorry about repeating - edit post timed out on me

 

 

I suggested earlier the above, would that not suffice?

 

 

I totally missed that one...

 

how can I do that (forse shipping to be total if total is 0)?

 

Doing the above requires alot less changing than having to accomodate a $0.10 processing fee which should really be burdened by the Merchant and not the customer.

 

i do not quite agree with that, but it is just me - they get discount already. it could be $0.01 for what i care i am not sure that paypal will respect $0.01

 

also this should be less confusing to a customer than seing on paypal that shipping became 0 all of a sudden and they pay for product... i suppose i can put a disclamer or something... also if sipping becomes order total then paypal will charge 3% off it...

Link to comment
Share on other sites

Fireman, which sql script did you run, if migrating from 2.4 etc, then you should just run paypal.sql.

 

 

Yes i did, but I also didnt' remove the old paypal stuff that was there from the 2.4 install. Could this have cause the errors? If so, how do I remove them?

 

Thanks as always!

Link to comment
Share on other sites

sorry about repeating - edit post timed out on me

I totally missed that one...

 

how can I do that (forse shipping to be total if total is 0)?

i do not quite agree with that, but it is just me - they get discount already. it could be $0.01 for what i care i am not sure that paypal will respect $0.01

 

also this should be less confusing to a customer than seing on paypal that shipping became 0 all of a sudden and they pay for product... i suppose i can put a disclamer or something... also if sipping becomes order total then paypal will charge 3% off it...

 

Well thinking further now, and like you say having the actual shipping cost is preferable; however the code is there for you do with as you see fit - I don't think any permanent change will occur in the distro code for this, well at least not untill PayPal themselves start to support discounts.

 

There are three or four places where the amount may need to be adjusted, these occur in paypal.php and paypal/catalog/checkout_process.php, if I can recall entirely that is.

 

Yes i did, but I also didnt' remove the old paypal stuff that was there from the 2.4 install. Could this have cause the errors?  If so, how do I remove them?

 

Thanks as always!

 

Can't answer properply for this one, depends on what you did when migrating to the latest version, your old PayPal table should of been removed and replaced with the new one (or suitable alternations made); plus all of the edits would need to be changed and or confirmed etc.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

All I did for the sql file was copy & past it into the myphp and it did give me an error saying that there was a duplicate item, but that's it.

 

What would you suggest? Delete the paypal stuff that's in my db & re-run the sql file again?

Link to comment
Share on other sites

All I did for the sql file was copy & past it into the myphp and it did give me an error saying that there was a duplicate item, but that's it. 

 

What would you suggest?  Delete the paypal stuff that's in my db & re-run the sql file again?

 

In the sql file replace

ALTER TABLE orders ADD payment_id INT( 11 ) DEFAULT '0' NOT NULL;

ALTER TABLE orders_products_attributes ADD products_options_id INT( 11 ) DEFAULT '0' NOT NULL;

ALTER TABLE orders_products_attributes ADD products_options_values_id INT( 11 ) DEFAULT '0' NOT NULL;

 

with

ALTER TABLE orders CHANGE paypal_ipn_id payment_id INT( 11 ) DEFAULT '0' NOT NULL;

 

and then run the sql file.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Ok, I just looked at the sql file 3 times & I don't see that at all in there....

 

just to make sure, we are talking about 2.9 right? Maybe the sql file is missing something?

Link to comment
Share on other sites

Ok, obviously, the fourth time was the charm - I found those tables... Now when I change them to what you wanted me to change them to, I now get this message in the bd...

 

Error

SQL-query :  

ALTER TABLE orders CHANGE paypal_ipn_id payment_id INT( 11 ) DEFAULT '0' NOT NULL 

MySQL said: 


Duplicate column name 'payment_id'

 

Not sure what I should be changing or whatever to make it work....

Link to comment
Share on other sites

Ok, obviously, the fourth time was the charm - I found those tables... Now when I change them to what you wanted me to change them to, I now get this message in the bd...

 

Error

SQL-query :  

ALTER TABLE orders CHANGE paypal_ipn_id payment_id INT( 11 ) DEFAULT '0' NOT NULL 

MySQL said: 
Duplicate column name 'payment_id'

 

Not sure what I should be changing or whatever to make it work....

 

Ok so drop the ALTER lines at the top of the script and then run it, e.g you want it to the drop/create table stuff only, you could copy and paste into the phpMyAdmin SQL field etcc..

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Woohoo!

 

that problem is now fixed! Thanks a lot for the quick replies. I do have another quick question for you. How would I go about deleting the old "Pending Paypal Notification"? I'm assuming that I need to go into the db & delete it there due to the history?

Link to comment
Share on other sites

Well thinking further now, and like you say having the actual shipping cost is preferable; however the code is there for you do with as you see fit -

 

that is a bit of the problem for me - i can tweak the code but not write it.

 

if you, please can tell me what the change sould be?

 

i do not assume that this is the right code/directions

 

find

 

$order->['total'] - $order->['shipping_cost']),

 

replace with

 

if $order->['total'] = 0 - $order->['total'] + 0.10
$order->['total'] - $order->['shipping_cost']),

 

or is it?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...