Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 5
Registered: ‎12-10-2018

Accept Hosted Form: Truncated Last Zero

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.

Posts: 2,765
Topics: 57
Kudos: 270
Blog Posts: 67
Registered: ‎12-05-2011

Re: Accept Hosted Form: Truncated Last Zero

Hello @sfo_gtu

 

Is this behavior new, or has it been observed for a while?

 

Richard

Member
Posts: 5
Registered: ‎12-10-2018

Re: Accept Hosted Form: Truncated Last Zero

Hi Richard,

We noticied the issue when we started using the Python SDK back August.

Thanks,
Kim
Moderator
Posts: 102
Registered: ‎06-26-2018

Re: Accept Hosted Form: Truncated Last Zero

Hi sfo_gtu

 

We are aware of the issue within our Python SDK and are working to update them to correct this. In the meantime, the following is a workaround you may use: 

 

The implementation is not when we pass it to the Python SDK.

 

The Python SDK will send the proper value to the servers and the amount that the merchant sends is properly getting stored in the servers as 50.00 (for example).

 

It is when the response has reached the merchant’s application that the issue starts happening.

 

When the SDK tries to show the response (50.00), it removes the zero and shows only one zero after the decimal point (50.0).

 

The suggested fix is to be implemented when the SDK is trying to print the response, i.e., from SDK to the merchant’s application.

 

Please do not worry about the amount on the server side. That is assuredly stored properly.

 

It is just a matter of printing the proper response to the merchant in the proper manner.

 

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, they may need to add a new import to the file:

            from decimal import *

 

Thank you,

Elaine

 

Member
Posts: 5
Registered: ‎12-10-2018

Re: Accept Hosted Form: Truncated Last Zero

Hi Elaine:

 

 

Thanks for the response. But I have been working with you guys to get this fix, and the workaroud below is not something we can do on our end, but the SDK which other agents have been mentioned too. 

 

The last agent suggested that I reach out the community to see if someone else might be able to help.