Check refunds on Authorize.net with a test account?

I am developing a website that uses Authorize.net, but I am currently using a test account. To check the return, it requires a unique transaction identifier, but since I use only a test account, it does not return a unique transaction identifier when performing a test transaction (always 2147483647). Is there any other way to do this? I need to check if my code will work with the API.

+3
source share
3 answers

No matter what code you use to analyze the "Transaction ID", which Authorize.net returns to you after a successful transaction, converts this transaction ID to an integer. It should be considered as a string, not an integer. In 2008, Authorize announced that they were switching from an integer to a string transaction identifier, since they had run out of a 32-bit integer.

2147483647 is the largest integer -10 you can make with 32 binary bits (1111 1111 1111 1111 1111 1111 1111 1111). This means that Authorize returns a transaction ID> 2147483647 (e.g. 3,000,000,000), and your programming language truncates bits to the maximum value, 2147483647.

PHP , . , . :

(string)$transaction_id

, , . :

$transaction_id + 1

, , , . , mysql CHAR VARCHAR 10. 16 24, .

:

+1

https://test.authorize.net/gateway/transact.dll, 0 .

, , . x_test_request = TRUE https://secure.authorize.net/gateway/transact.dll , . Live Authorize.Net, Live URL

+1

, :

x_test_request=FALSE

id

0

Source: https://habr.com/ru/post/1714844/


All Articles