Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
PayPal not receiving my discount
Posted: 23 May 2011 01:27 PM   [ Ignore ]
Has a Nice Profile
Avatar
RankRank
Total Posts:  109
Joined  2010-01-19

Is there a reason why PayPal wouldn’t get my discount? I enter the code ‘FREE’ on my test site which kicks in the free shipping, all displays OK - when I submit to PayPal, no discount shows.

I’ve checked the gateway code and it appears with my noob eyes as if this should all be working without me needing to do anything….

[ Edited: 17 June 2011 11:25 AM by Rob Sanchez ]
 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

Profile
 
 
Posted: 24 May 2011 08:11 AM   [ Ignore ]   [ # 1 ]
Has a Nice Profile
Avatar
RankRank
Total Posts:  109
Joined  2010-01-19

If I print the post_array that’s being compiled within cartthrob.paypal_standard.php, I get this:

Array ( [cmd] => _cart [address_override] => 0 [upload] => 1 [business] => address@paypal.com [weight_unit] => lbs [currency_code] => GBP [tax_cart] => 0.00 [discount_amount_cart] => 5.02 [address1] => add1 [address2] => [city] => Evesham [country] => GB [email] => andy@example.com [first_name] => Andy [last_name] => Harris [lc] => en [night_phone_a] => 138 [night_phone_b] => 642 [night_phone_c] => 1373 [state] => Worcestershire [zip] => WR11 [rm] => 2 [shipping_1] => 4.99 [invoice] => 1407_20484317644ddb91a5814499.75111058 

So it’s getting the discount_amount_cart value OK, but doesn’t do anything with it….

 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

Profile
 
 
Posted: 25 May 2011 01:07 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

Is the total wrong at PayPal? Or is the problem that no discount is shown at PayPal?

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 25 May 2011 01:09 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

I wonder if we need to add discount_amount_1

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 25 May 2011 01:12 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

Looking at the API docs…  it looks like we should be able to send either.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 25 May 2011 01:38 PM   [ Ignore ]   [ # 5 ]
Has a Nice Profile
Avatar
RankRank
Total Posts:  109
Joined  2010-01-19

It all looks like it should work. I can give you full site access if it’s any easier to check it directly, I duplicated it as a dev version.

It seems to be passing in all the right values, but just ignoring the discount.

 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

Profile
 
 
Posted: 25 May 2011 02:19 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

I’ll look.. but just want to confirm: is the total wrong? or is it that PayPal’s not explicitly stating that there’s a discount?

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 25 May 2011 02:55 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

https://www.x.com/thread/47330;jsessionid=AAC896433BD2F40DB3781BAC44AD2461.node0?decorator=print&displayFullThread=true

Yeesh. My guess: the subtotal of items is greater than the discount?

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 25 May 2011 04:17 PM   [ Ignore ]   [ # 8 ]
Has a Nice Profile
Avatar
RankRank
Total Posts:  109
Joined  2010-01-19

That could well be it. To clarify a little, here’s exactly what goes down.

1 - I add a test product with value of 10p to the basket. Basket total is now £5.06 (as there’s a 3p discount from an existing offer, plus £4.99 delivery)
2 - I enter voucher code ‘FREE’ which removes the £4.99 and leaves me with a total of 7p.
3 - I go to checkout, and when I arrive at PayPal I see the Cart Total at 10p, plus postage of £4.99 = £5.09 to pay.

What’s being passed into PayPal is exactly as per what I posted earlier.

I’ve since tested with a more expensive product and it appears to work OK. On this site I don’t think we’ll ever sell products this cheaply on the site, so I don’t think it’ll be a problem - I guess I’ll up the price of my test item.

I’ll be shifting this site to PayPal Express too in the not too distant future!!

 Signature 

Andy Harris | Pepper Digital | Malvern, UK | Twitter

Profile
 
 
Posted: 25 May 2011 04:26 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

After seeing this, I changed the PayPal gateway to have a failsafe when something like this occurs anyway. Rather than sending the tax, shipping, and item amount, the entire cart cost is sent as the total, and shpping and tax aren’t sent. That’s only a fallback though, so except in a case where the discount is greater than the item… those line items will be sent along.

Man… sometimes with PayPal… I just wish I could punch it.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile