Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

payment error when using tax_rate in purchase button templat

 
Post new topic   Reply to topic    Infralution Support Forum Index -> IPN.NET Support
View previous topic :: View next topic  
Author Message
hanshimmler



Joined: 14 Apr 2013
Posts: 5

PostPosted: Mon Jun 23, 2014 3:11 pm    Post subject: payment error when using tax_rate in purchase button templat Reply with quote

HI,

I get '<Error>Incorrect payment. Expected $2525,79, got $30,00</Error>'
errors when I use the following paypal button markup:

form style="DISPLAY: inline" target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"


input type="hidden" name="business" value="xxx"


input type="hidden" name="add" value="1"
input type="hidden" name="cmd" value="_cart"




input type="hidden" name="item_name" value="Sample Licensed Product"
input type="hidden" name="tax_rate" value="19"
input type="hidden" name="item_number" value="SLP"


input type="hidden" name="amount" value="25.21"
input type="hidden" name="currency_code" value="EUR"


input type="image" name="submit" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif"
alt="Add to Cart"
img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif"



My default Currency in the PayPal Settings section of the 'Configure IPN.NET server' dialog is EUR. This is also the primary currency in PayPal.

My product (based on the infralution sample) uses 25,21 as Cost per Unit and use 'EUR' as currency

Payment is PayPal is working fine. But the response from the IPN server looks like this:

<xml>
<Payment>
<Transaction>
<mc_gross>30.00</mc_gross>
<protection_eligibility>Eligible</protection_eligibility>
<address_status>unconfirmed</address_status>
<item_number1>SLP</item_number1>
<payer_id>7XGDYWL66HGUW</payer_id>
<tax>4.79</tax>
<address_street>ESpachstr. 1</address_street>
<payment_date>07:39:13 Jun 23, 2014 PDT</payment_date>
<payment_status>Completed</payment_status>
<charset>UTF-8</charset>
<mc_tax1>4.79</mc_tax1>
<address_zip>79111</address_zip>
<mc_shipping>0.00</mc_shipping>
<mc_handling>0.00</mc_handling>
<first_name>Hans</first_name>
<mc_fee>0.92</mc_fee>
<address_country_code>DE</address_country_code>
<address_name>xxxx</address_name>
<notify_version>3.8</notify_version>
<custom>
<payer_status>verified</payer_status>
<business>xxxx</business>
<address_country>Germany</address_country>
<num_cart_items>1</num_cart_items>
<mc_handling1>0.00</mc_handling1>
<address_city>Freiburg</address_city>
<verify_sign>AmzJbcdnDckf4QGqBLszEUmqizEnArUAQnZKLS3bE2Mia0AovTnytV88</verify_sign>
<payer_email>xxx</payer_email>
<mc_shipping1>0.00</mc_shipping1>
<tax1>4.79</tax1>
<txn_id>9KY24897ML2146037</txn_id>
<payment_type>instant</payment_type>
<last_name>xxx</last_name>
<address_state>Empty</address_state>
<item_name1>Sample Licensed Product</item_name1>
<receiver_email>xxxx</receiver_email>
<payment_fee>
<quantity1>1</quantity1>
<receiver_id>C64FNY5ZL6BLL</receiver_id>
<txn_type>cart</txn_type>
<mc_gross_1>25.21</mc_gross_1>
<mc_currency>EUR</mc_currency>
<residence_country>DE</residence_country>
<test_ipn>1</test_ipn>
<transaction_subject>
<payment_gross>
<ipn_track_id>750dfc20d58ed</ipn_track_id>
</Transaction>
<Error>Incorrect payment. Expected $2525,79, got $30,00</Error>
</Payment>


TWO problems here:
First: Why does the error state that an ammount in $ is expected (should be EUR)

Second: Why does the IPN server expects 2525,79 $ ?

I assume the problem is due to the tax calculation, since without the tax (i.e. leaving tax_rate out in the purchase page) everything works.

Question: How can I tell the ipn server to expect payments in EUR and not in $ ?

How can I get the calculation of the VAT to work (this calculation is required since by law (in germany) on every payment the VAT must be clearly visible)

We just purchased the product, and I really hope to get help, since otherwise our whole usage of the infralution ipn server in our system is in danger.

Best
Hans-Juergen Himmler
AKos GmbH
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jun 23, 2014 11:03 pm    Post subject: Reply with quote

First. The error message is generic and doesn't reflect the actual units of payment.

Second. This looks like an issue with commas and decimal points being confused (at least in part). It looks like 25,21 which you have entered in License Tracker is being interpreted as 2521 and then when the tax of 4.79 is added you get 2525.79 expected as the payment.

I will take a look and see if I can identify why this is happening. In the meantime you could change your windows locale to one where "." are used as the decimal separator (eg en-US) and then run License Tracker and set the product price to "25.21" and configure your remote server (I assume you are using a remote server?). I think this will workaround the issue.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jun 25, 2014 12:18 am    Post subject: Reply with quote

I've done some further testing with different locales (using commas for the decimal separator) and have not been able to replicate this issue. Are you sure that when you entered the price in License Tracker you used the correct decimal separator for the current locale? For instance if your locale was using "." as the decimal separator and you entered 25,21 as the price then you would get the behaviour you have seen because this would be interpreted as 2521.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
hanshimmler



Joined: 14 Apr 2013
Posts: 5

PostPosted: Wed Jun 25, 2014 9:18 am    Post subject: Reply with quote

HI,

the problem seems to be license tracker.
I use version 5.8.1
Regardless of what language settings I use when I start license tracker the IpnCostPerUnit property for a new product enetred in license tracker (and afterwards use 'configure ipn server) the product end up in the access db using ',' (comma) as decimal seperator. In the license tracker UI (when I use english settings at startup) the cost per item shows correctly the '.' and not ','. In the ipn.mdb db the ',' is used for a new product.
I can workaround the problem by MANUALLY editing the IpnCostPerUnit column (using english when opening the access db) and copying the db to the server. Of course this only works because I have a license for MS Access. Using License tracker all new products end up using german decimal seperators. The strange thing is that I have some entries that DO use '.' (as far as I remember those are originated from the first time I installed (and eval version) of IPN.Net. But all NEW products I enter in license tracker end up using ',' as decimal separator.

As stated I have a workaround, but I would expect that if the license tracker UI shows a '.' separator the ipn.mdb db shows '.' as IpnCostPerUnit as well. If this does not work, it should be fixed.

Regards
Hans-Juergen
AKos GmbH
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jun 25, 2014 9:46 am    Post subject: Reply with quote

The values stored in the access database are decimal values (not strings) and so don't include the decimal separator. The decimal separator for the locale just affects how the value is displayed by Access and License Tracker and also how text entered by the user are converted to decimal values.

I tested with the latest version of License Tracker (Version 5.11.1) and set the locale of the computer running License Tracker to French (which uses "," for the decimal separator). When I enter 25,21 for the price of a product and configure IPN.NET I can then open the License.mdb and Ipn.mdb databases in Access (without changing the locale) I see that the value is correctly shown as 25,21. Change the locale back to English (with decimal separator ".") and then reopening Access shows the value now as "25.21" as expected. This also works as expected when the IPN.NET server is running on a different system with a different locale.

It is possible that the problem you are seeing has been fixed since you are using quite an old version and I cannot replicate the issue in the current release. I would suggest upgrading to the current versions of both ILS and IPN.NET. This is a free upgrade - you can download them from www.infralution.com/downloads.html. After uploading the new IPN.NET server binaries make sure that you run the Install.aspx page to upgrade the database.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> IPN.NET Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group