Get order transaction ID from authorize.net Authorize AIM

我的未来我决定 提交于 2019-12-04 21:13:50

The response string returned by Authorize.Net is going to look something like this:

1|1|1|This transaction has been approved.|4DHVNH|Y|2230582188|none|Test transaction for ValidateCustomerPaymentProfile.|0.00|CC|auth_only|none|John|Doe||123 Main St.|Bellevue|WA|98004|USA|800-555-1234|800-555-1234|email@example.com|||||||||0.00|0.00|0.00|FALSE|none|E440D094322A0D406E01EDF9CE871A4F||2|||||||||||XXXX1111|Visa||||||||||||||||

This is the results separated by a | which is the delimiting character you set here:

"x_delim_char"      => "|",

You correctly break apart the string using explode():

$response_array = explode($post_values["x_delim_char"],$post_response);    

which gives us that data in an array called $response_array.

In Authorize.Net's response, the transaction ID is 2230582188. In our array that is the seventh element so we can get it using:

$transaction_id = $response_array[6];

Here is a demo showing you this works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!