I copied the demo for the direct post method into a page on my site and it worked fine. When I have a query string in the url however, the form that's usual give is replaced by "Sorry, an error occurred: " and doesn't actually give the error. This only happens when there is text after the "?" in the url, so is there a setting to allow for a query?
-thanks
Solved! Go to Solution.
08-13-2012 03:16 PM
It at the AuthorizeNetDPM.php directPostDemo method. It assume it is a return from transaction result.
08-13-2012 06:03 PM
Question:Which url? the post url? the relay response url?
What exactly the query string are you try to pass?
08-13-2012 04:05 PM
All I mean is the url/location of the page "www.example.com". It didn't seem like what I was trying to pass mattered, because it stopped working once there was any text after the "?", but all I'm passing in variables to find a page template then fill it with the desired information from a database. The strings don't have anything abnormal in them either, just like page=checkout.
-thanks
08-13-2012 05:02 PM
You mean the url location of the webpage where you have the post to authorize.net form?
08-13-2012 05:21 PM - edited 08-13-2012 05:27 PM
Can you check the page source on the browser to see if anything got change on the form post to authorize.net when you add the "?whatever=whatever" to your page.
08-13-2012 05:47 PM - edited 08-13-2012 05:49 PM
Yes, I believe so, here is the link http://www.cardphilebeta.com/index.php?page=checkout
and the section where I use the demo code + the src when the page is loaded (it just returns the error text):
...............
<span class="bread_crumbs"><a href="index.php?page=home">Home</a> >> Checkout</span>
<div class="product_description">
<p>Personalize your cards with custom text</p>
</div>
</div>
<div class="product">
<?php
//************************************************
//Direct Post Method of Authorize sdk
//************************************************
/**/
require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK
$url = "http://www.cardphilebeta.com/index.php?page=checkout";
$api_login_id = 'CDP702';
$transaction_key = 'xxxxxxxxxxxxxxxx;
$md5_setting = 'CDP702'; // Your MD5 Setting
$amount = "5.99";
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);
?>
</div>
</div><!--end checkout-->
.................
Src of page
................
<span class="bread_crumbs"><a href="index.php?page=home">Home</a> >> Checkout</span>
<div class="product_description">
<p>Personalize your cards with custom text</p>
</div>
</div>
<div class="product">
Sorry, an error occurred:
</div>
</div><!--end checkout-->
.................
-thanks
08-13-2012 05:52 PM - edited 08-13-2012 05:53 PM
It at the AuthorizeNetDPM.php directPostDemo method. It assume it is a return from transaction result.
08-13-2012 06:03 PM
Okay, so would there be a way of getting around this without breaking the entire process (ignoring the query when the form has not yet been submited or something)?
-thanks
08-14-2012 08:54 AM
Not sure, not a php developer myself, but I don't see why you can't go in and change it for your site.
08-14-2012 12:16 PM