paypal multiply my unit price with quantity and i got wrong

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

paypal multiply my unit price with quantity and i got wrong

Post by eshban »

Hi,

I have a simple custom cart and my website has only one product to sale. My cart works on following scenario

1) If user buy '1' product, then price will be $50.00
2) If user buy '2' product, then price will be $80.00
2) If user buy '3' product, then price will be $110.00

It means that if user purchase more than one quantity, then price will be $30 for each product, otherwise product cost will be $50.

The script is working fine on my website, but when i redirected at paypal, then there is some disturbance in price and quantity.


At PAypal

Paypal display 3 things at paypal page

1) Description
2) Unit Price
3) Quantity
4) Amount


Suppose at my website user has selected product in the quantity of '3' . which cost '110.00$' (see above cost table), but paypal page shows total cost = 330.00$.

Actually paypal multiply the "Total Cost" with "Quantity" which results in a wrong value.

So, is there any way to pass 'final amount' to paypal, so that it cannot multiply the unit price with quantity. Currently i am sending 'Quantity' and 'Unit price' from my php script to paypal

Please help in this regard.

tHANKS
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: paypal multiply my unit price with quantity and i got wrong

Post by John Cartwright »

I don't know the answer as I've never used paypal, however, their integration guide is quite extensive. Have you looked at it?
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: paypal multiply my unit price with quantity and i got wrong

Post by Apollo »

Simply pass TotalAmount/Quantity as unit price to PayPal.

Or add a "Large Order Discount" item with the required difference, to gain the TotalAmount you want to charge.
Post Reply