开发者

Testing Silent Post with Authorize.net

开发者 https://www.devze.com 2023-01-10 20:10 出处:网络
I currently have an application making use of Authorize.net\'s ARB API.I have ever开发者_如何学Goything working how I believe it should, but I would really like to receive a silent post back from the

I currently have an application making use of Authorize.net's ARB API. I have ever开发者_如何学Goything working how I believe it should, but I would really like to receive a silent post back from the authorize.net test server (test.authorize.net) which is where my account is created.

I have test mode turned off, and the transaction does not have debug on. With this, I have already written a page where I can simulate the post, but I have yet to see one.

Do these take place when a subscription is created, or when the card is charged? I have read multiple items saying that in various test modes, silent posts are not sent.

Is there a way to force a transaction to perform a silent post when using ARB on test.authorize.net?

Thanks, Eric


You can't test Silent Post through Authnet without running live transactions. However it is very simple to test your Silent Post script yourself. All Silent Post is doing is POSTing transaction data which is exactly the same as an AIM API response (with one exception: you are also getting subscription ID with ARB transactions). So to test it all you need to do is recreate a simulated POST. Doing this is as easy as making a mick form with same data and setting the action to your Silent Post URL.

Here is a sample form I use:

<form action="http://www.yourdomain.com/silent-post.php" method="post">
<input type="hidden" name="x_response_code" value="1"/>
<input type="hidden" name="x_response_subcode" value="1"/>
<input type="hidden" name="x_response_reason_code" value="1"/>
<input type="hidden" name="x_response_reason_text" value="This transaction has been approved."/>
<input type="hidden" name="x_auth_code" value=""/>
<input type="hidden" name="x_avs_code" value="P"/>
<input type="hidden" name="x_trans_id" value="1821199455"/>
<input type="hidden" name="x_invoice_num" value=""/>
<input type="hidden" name="x_description" value=""/>
<input type="hidden" name="x_amount" value="9.95"/>
<input type="hidden" name="x_method" value="CC"/>
<input type="hidden" name="x_type" value="auth_capture"/>
<input type="hidden" name="x_cust_id" value="1"/>
<input type="hidden" name="x_first_name" value="John"/>
<input type="hidden" name="x_last_name" value="Smith"/>
<input type="hidden" name="x_company" value=""/>
<input type="hidden" name="x_address" value=""/>
<input type="hidden" name="x_city" value=""/>
<input type="hidden" name="x_state" value=""/>
<input type="hidden" name="x_zip" value=""/>
<input type="hidden" name="x_country" value=""/>
<input type="hidden" name="x_phone" value=""/>
<input type="hidden" name="x_fax" value=""/>
<input type="hidden" name="x_email" value=""/>
<input type="hidden" name="x_ship_to_first_name" value=""/>
<input type="hidden" name="x_ship_to_last_name" value=""/>
<input type="hidden" name="x_ship_to_company" value=""/>
<input type="hidden" name="x_ship_to_address" value=""/>
<input type="hidden" name="x_ship_to_city" value=""/>
<input type="hidden" name="x_ship_to_state" value=""/>
<input type="hidden" name="x_ship_to_zip" value=""/>
<input type="hidden" name="x_ship_to_country" value=""/>
<input type="hidden" name="x_tax" value="0.0000"/>
<input type="hidden" name="x_duty" value="0.0000"/>
<input type="hidden" name="x_freight" value="0.0000"/>
<input type="hidden" name="x_tax_exempt" value="FALSE"/>
<input type="hidden" name="x_po_num" value=""/>
<input type="hidden" name="x_MD5_Hash" value="A375D35004547A91EE3B7AFA40B1E727"/>
<input type="hidden" name="x_cavv_response" value=""/>
<input type="hidden" name="x_test_request" value="false"/>
<input type="hidden" name="x_subscription_id" value="365314"/>
<input type="hidden" name="x_subscription_paynum" value="1"/>
<input type="submit"/>


In addition to John Conde's answer which is excellent I would like to add that you should attempt posting this information from a url that is different from your main site. In certain situations you don't want to accept posts from external websites and it is a security feature to have that disabled.

So if your going to test just go to a jsfiddle site and do your posting from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消