Reply
Highlighted
Member
Posts: 4
Registered: ‎10-05-2011
Accepted Solution

DPM is kicking back an error

Hello!

 

I've set up a checkout procedure with the DPM api here:

 

http://iwanttodrawacatforyou.com/?page_id=5162

 

When I fill out the form, I'm given this error:

 

3,2,13,The merchant login ID or password is invalid or the account is inactive.,,P,0,,,9.95,,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,2FBBB91A562F7D01AB2949EA7747F89A,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

I chatted with support, and they're telling me this is because I'm set up in Sandbox mode, and I need to change it to live mode. But I don't think they're right. I have my actual api login ID in the code, and my actual transaction key in the code. I'm not in test mode.

 

They suggested I bring the issue here. They said, "Your API login ID and Transaction key have nothing to do with being in sandbox mode. It is a setting you need to change in your code. That is why developer experience is required to make this change."

 

I'd love some learning! Can anyone here point me in the right direction?

 

Thanks so much for your time.


Steve


Accepted Solutions
Highlighted
Solution
Accepted by topic author blewtllc1
‎08-21-2015 01:58 AM
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: DPM is kicking back an error

Which API are you using? PHP? If you look in the lib folder in your SDK, you'll see a file called AuthorizeNetDPM.php. If you search for the word sandbox, you'll run across this:

 

    public static function getCreditCardForm($amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $test_mode = true, $prefill = true)
    {
        $time = time();
        $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);
        $sim = new AuthorizeNetSIM_Form(
            array(
            'x_amount'        => $amount,
            'x_fp_sequence'   => $fp_sequence,
            'x_fp_hash'       => $fp,
            'x_fp_timestamp'  => $time,
            'x_relay_response'=> "TRUE",
            'x_relay_url'     => $relay_response_url,
            'x_login'         => $api_login_id,
            )
        );
        $hidden_fields = $sim->getHiddenFieldString();
        $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);

That means that if you're using this function in your code, you can define test mode by setting the sixth argument to false. The Quick Start example doesn't show these last two arguments, it'll give you test mode true by default if you just copy and paste it as-is.

 

If creating a form manually, of course, it's just a matter of setting the form action to https://secure.authorize.net/gateway/transact.dll rather than https://test.authorize.net/gateway/transact.dll

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author blewtllc1
‎08-21-2015 01:58 AM
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: DPM is kicking back an error

Which API are you using? PHP? If you look in the lib folder in your SDK, you'll see a file called AuthorizeNetDPM.php. If you search for the word sandbox, you'll run across this:

 

    public static function getCreditCardForm($amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $test_mode = true, $prefill = true)
    {
        $time = time();
        $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);
        $sim = new AuthorizeNetSIM_Form(
            array(
            'x_amount'        => $amount,
            'x_fp_sequence'   => $fp_sequence,
            'x_fp_hash'       => $fp,
            'x_fp_timestamp'  => $time,
            'x_relay_response'=> "TRUE",
            'x_relay_url'     => $relay_response_url,
            'x_login'         => $api_login_id,
            )
        );
        $hidden_fields = $sim->getHiddenFieldString();
        $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);

That means that if you're using this function in your code, you can define test mode by setting the sixth argument to false. The Quick Start example doesn't show these last two arguments, it'll give you test mode true by default if you just copy and paste it as-is.

 

If creating a form manually, of course, it's just a matter of setting the form action to https://secure.authorize.net/gateway/transact.dll rather than https://test.authorize.net/gateway/transact.dll

Highlighted
Member
Posts: 4
Registered: ‎10-05-2011

Re: DPM is kicking back an error

Thank you VERY much for your response. It gave me several ah-ha moments, and now everything is working just fine.

 

It's also good to know that I can choose to create my own form instead of calling that function, so long as I include all of the proper fields and post to the right place.

 

Thanks for the eye-opening solution!!!

 

Steve

Highlighted
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: DPM is kicking back an error

Glad to help!