cancel
Showing results for 
Search instead for 
Did you mean: 

Direct Post Method not working with a query string in url

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

POM792
Member
1 ACCEPTED SOLUTION

Accepted Solutions

It at the AuthorizeNetDPM.php directPostDemo method. It assume it is a return from transaction result.

 

View solution in original post

8 REPLIES 8

Question:Which url? the post url? the relay response url?

What exactly the query string are you try to pass?

RaynorC1emen7
Expert

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

You mean the url location of the webpage where you have the post to authorize.net form?

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.

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

It at the AuthorizeNetDPM.php directPostDemo method. It assume it is a return from transaction result.

 

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

Not sure, not a php developer myself, but I don't see why you can't go in and change it for your site.