Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Hosted Form: Truncated Last Zero #135

Open
kvillalobos opened this issue Jan 10, 2019 · 5 comments
Open

Accept Hosted Form: Truncated Last Zero #135

kvillalobos opened this issue Jan 10, 2019 · 5 comments
Assignees

Comments

@kvillalobos
Copy link

We have noticed that the pricing/amount of the payment form is not showing all of of the cent values. For example, when we set the amount to "25.00" or "25.50", the price on the payment form is shown as "$25.0" or "25.5" respectively. If the payment is "25.01" then the payment is shown correctly.

@kvillalobos
Copy link
Author

screen shot 2019-01-10 at 2 54 08 pm

@kvillalobos
Copy link
Author

hi @gnongsie! this is what Authorized.net had suggested but has not addressed:

For the time being, until we can update the code in the SDK, you can make your own edits to the code. Here are the suggested edits:

The original sample codes suggest something like this:
print('Auth Amount : %s' % transactionDetailsResponse.transaction.authAmount)
print('Settle Amount : %s' % transactionDetailsResponse.transaction.settleAmount)

This needs to be changed to the following. The highlighted text shows what is different:
print('Auth Amount : %s' % Decimal(repr(transactionDetailsResponse.transaction.authAmount)).quantize(Decimal('1.00')))
print('Settle Amount : %s' % Decimal(repr(transactionDetailsResponse.transaction.settleAmount)).quantize(Decimal('1.00')))

Also, if required, you may need to add a new import to the file:
from decimal import *

@gnongsie
Copy link
Contributor

Hi,

I do know this issue. We do have a fix in mind to alleviate the developers from making this suggestion. Please bear with us and we will incorporate this in the next release.

@kvillalobos
Copy link
Author

That would be great! Thank you so much!

@gnongsie
Copy link
Contributor

Hi,

Apologies for keeping you waiting. We've evaluated the possible fixes for this issue and unfortunately, there is not much we can do to fix this through the SDK.

The dependency (PyxB) that generates classes that correspond to data structures defined by XMLSchema, has this documented as a known issue. And we cannot change this behavior until the dependency is changed.

As a working fix, by formatting the output to use %.2f instead of %s when printing amount values, the correct output should be visible. This has been demonstrated in our sample code repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants