Shipping fee is missing from PayPal payment

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anos atrás
I'm sorry I was looking at my code and not the code that exists in the 1.80 release. You need to take the x++; and move it to the bottom instead of being on top. It being on top is what made both of them disappear. If you skip a number in Paypal and you send Item#1 and then Item#3 it will ignore Item#3 and everything that comes after it. The x++; at the top makes it skip numbers.

I originally wrote this code but Andrei changed it a bit and I didn't realize what value x had at that particular point. Make this change and I'm sure you'll see a difference. I'm sure you'll see the tax come back and the shipping should be there too.
13 anos atrás
I tried to move the x++; but it made Paypal to answer with error:
-------------
Error Detected

Error MessageThe link you have used to enter the PayPal system contains an incorrectly formatted item amount.

The link you have used to enter the PayPal system contains an incorrectly formatted item amount.
-------------
13 anos atrás
This is good! At least for debugging...

Can you try to do another transaction that gets that error and then grab the address that is in the browser once Paypal gives you the error and post it here... it should have all of the stuff that you tried to pass to Paypal in it. We can see what is going on from that info.

When you get that error on the page the address in your browser should read something like this...

http://www.paypal.com/item_1=item&amount_1=$12.00&quantity_1=..... etc.

Post that here...
13 anos atrás
I am impressed by your enthusiasm! And ashamed that I did not think of doing that myself.

Anyway:
https://www.paypal.com/us/cgi-bin/webscr?cmd=_cart&business=paypal%40boldflag.no&upload=1&item_name_1=NULLUS+kur+mot+hodelus&amount_1=238.40&quantity_1=1&item_name_2=Shipping&amount_2=28,00&quantity_2=1&item_name_3=Sales+Tax&amount_3=66.60&quantity_3=1&custom=a9adf1a3-0041-4fdb-a1d3-306186e42764&no_note=1&currency_code=NOK&invoice=17&rm=2&no_shipping=2&return=http%3a%2f%2fwww.toppkropp.no%2fPaypalPDTHandler.aspx&cancel_return=http%3a%2f%2fwww.toppkropp.no%2fPaypalCancel.aspx&address_override=1&first_name=Ole&last_name=Hovengen&address1=Postboks+885&address2=&city=Drammen&state=&country=NO&zip=3007&email=ole%40boldflag.no
13 anos atrás
As you might be able to see from what you posted, the shipping is showing up as 28,00 (that's a comma in there, not a period) and every other item amount is being sent with a period. This is why you're getting that error.

&item_name_1=NULLUS+kur+mot+hodelus
&amount_1=238.40
&quantity_1=1
&item_name_2=Shipping
&amount_2=28,00
&quantity_2=1
&item_name_3=Sales+Tax
&amount_3=66.60
&quantity_3=1
&custom=a9adf1a3-0041-4fdb-a1d3-306186e42764&no_note=1
&currency_code=NOK

I am not sure as to why it is only the shipping that is showing up this way. It may have to do with the currency you're using... your currency shows up like this: kr 348,00 (NOK) inkl mva and somehow the item prices and the tax gets coverted to a decimal format, but the shipping doesn't.

Give me a few minutes to think about it and try to figure out why this is happening.
13 anos atrás
In Norway and other Nordic countries, we have swaped comma and period, regarding nubers. Period for thousands and comma for decimals: "Four thousend two hundred kroner and ninty ore" = 4.200,90 here.
13 anos atrás
Okay... take this code that I gave you before:

builder.AppendFormat("&item_name_" + x + "={0}", "Shipping");
builder.AppendFormat("&amount_" + x + "={0}", order.OrderShippingExclTax);
builder.AppendFormat("&quantity_" + x + "={0}", 1);
x++;

and change it to:

builder.AppendFormat("&item_name_" + x + "={0}", "Shipping");
builder.AppendFormat("&amount_" + x + "={0}", order.OrderShippingExclTax.ToString("0.00", CultureInfo.InvariantCulture));
builder.AppendFormat("&quantity_" + x + "={0}", 1);
x++;

I guess I found out what that culture stuff is used for! It takes whatever the currency looks like and formats it so it can be passed to paypal. When I wrote the code I was only concerned with USD... good thing Andrei put that stuff in there!

This fix SHOULD get you shipping as an item... which makes me wonder why Paypal leaves shipping off when it is sent as shipping. Because nopCommerce IS sending shipping... you can see it in the string you posted, it just wasn't fomatted correctly because of the different currency.

Give this a try and see if it works. If it does then you may just want to leave it sending shipping charges as an item or  you can switch it back and try to figure out why Paypal ignores the shipping you're sending. There may be some setting in your Paypal account or some other unknown reason.
13 anos atrás
hovengen wrote:
In Norway and other Nordic countries, we have swaped comma and period, regarding nubers. Period for thousands and comma for decimals: "Four thousend two hundred kroner and ninty ore" = 4.200,90 here.


You crazy Norwegians!
13 anos atrás
Barry, this is just great!!!

Mayby later, we find out that something else is crashing, but for now: Sucsess!

-------------------------------
Paypal says:

Description Unit Price Quantity Amount  
NULLUS kur mot hodelus 238.40 1 238.40  
Shipping 28.00 1 28.00  
Sales Tax 66.60 1 66.60  
Item total: 333.00  

Total: 333.00 NOK
-------------------------------
Thank you so much!
And I learned to use VS2010 in14 hours as a bonus!
13 anos atrás
It seems very strange because shipping fee is already passed as culture independent
builder.AppendFormat("&shipping_1={0}", order.OrderShippingExclTax.ToString("0.00", CultureInfo.InvariantCulture));

Does anybody else experiencing this issue?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.