Hi there

I know this is just a continuation of this issue - http://drupal.org/node/525268 - but I thought I'd make a new report since the issue has been marked fixed.

Using 6.x.1.0-alpha1 and 6.x.1.x-dev I get an API Token Mismatch when trying to submit a transaction (Canadian). This happens with both the Moneris development and production servers.

I notice that the xml string sent in the mpiClasses.php and mpgClasses.php don't match the Canadian values (at least I think that's what's going on there) Canadian keys should be: ps_store_id instead of store_id and hpp_key instead of api_token. I've tried altering those to the Canadian values and the same error crops up. Anyway, that's just a shot in the dark.

Any guidance or other things I should try?

Thanks in advance.

Comments

ezra-g’s picture

Sorry to hear that.

Canadian keys should be: ps_store_id instead of store_id and hpp_key instead of api_token.

a) Can you reference where you see that this should be the case?

b) Have you specified the canadian API in the payment gateway settings?

c) Have you ever had the gateway working with this module?

d) Are you using AVS/CVD?

e) can you post an example $mpgRequest object?

ezra-g’s picture

Status: Active » Postponed (maintainer needs more info)
occupant’s picture

Thanks for responding.

a) I gathered this from the Moneris Directpost Configuration Guide v.3 and the Moneris Directpost Merchant Integration Guide v.1.1.2 (am I looking at an outdated one? will check into that). Am I misunderstanding what's going on here? (entirely possible :)
b) Yes
c) No - I have had the xml issue mentioned in the opening post and now the api token mismatch.
d) No, neither
e) I'm not entirely sure how to do that - I'd be happy to if you wouldn't mind explaining

ezra-g’s picture

On line 455 there is, "$mpgRequest = new mpgRequest($mpgTxn);" -- After that line, add the code at http://pastebin.com/m132f6b78 .

Process a transaction and check the watchdog, and post the results here. Unless something is clearly wrong in that object, my next step would be to suggest that you contact moneris and have them on the phone while you attempt to run a transaction, and provide them with that output to help them identify what's wrong with the way you are trying to process the transaction. In the past, I've found that they are able to point out how to fix the requet object to resolve an error, even though the error message the system sends back is unhelpful.

occupant’s picture

Great, thanks for your help. Here's the results:

MESSAGE	
mpgRequest Object
(
    [txnTypes] => Array
        (
            [purchase] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => pan
                    [4] => expdate
                    [5] => crypt_type
                )

            [refund] => Array
                (
                    [0] => order_id
                    [1] => amount
                    [2] => txn_number
                    [3] => crypt_type
                )

            [idebit_purchase] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => idebit_track2
                )

            [idebit_refund] => Array
                (
                    [0] => order_id
                    [1] => amount
                    [2] => txn_number
                )

            [ind_refund] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => pan
                    [4] => expdate
                    [5] => crypt_type
                )

            [preauth] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => pan
                    [4] => expdate
                    [5] => crypt_type
                )

            [completion] => Array
                (
                    [0] => order_id
                    [1] => comp_amount
                    [2] => txn_number
                    [3] => crypt_type
                )

            [purchasecorrection] => Array
                (
                    [0] => order_id
                    [1] => txn_number
                    [2] => crypt_type
                )

            [opentotals] => Array
                (
                    [0] => ecr_number
                )

            [batchclose] => Array
                (
                    [0] => ecr_number
                )

            [cavv_purchase] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => pan
                    [4] => expdate
                    [5] => cavv
                )

            [cavv_preauth] => Array
                (
                    [0] => order_id
                    [1] => cust_id
                    [2] => amount
                    [3] => pan
                    [4] => expdate
                    [5] => cavv
                )

        )

    [txnArray] => mpgTransaction Object
        (
            [txn] => Array
                (
                    [type] => purchase
                    [order_id] => cs012111490500000055
                    [cust_id] => 1
                    [amount] => 50.00
                    [pan] => 4242424242424242
                    [expdate] => 1002
                    [crypt_type] => 7
                )

            [custInfo] => 
            [avsInfo] => 
            [cvdInfo] => 
            [recur] => 
        )

)
ezra-g’s picture

Have you configured AVS and CVD to be disabled?

occupant’s picture

Yes, both are set to be disabled on the admin/store/settings/payment/edit/gateways page.

occupant’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Doh! I need a slap in the head. The hpp_key and ps_store_id I was mentioning in the op are from the DirectPost config. Ignore that. I had the right info in my setup, but I was running in circles so long I forgot if I was chasing or being chased :)

Anyway, I did manage to get a successful test after a talk with Moneris and little fiddling.

Thanks again for your assistance.

chad@5d.com’s picture

Status: Closed (fixed) » Active

I'm having similar problems and I'm trying to view the output in watchdog.

The code in the pastebin seems to have expired. Would someone be able to paste the code into a reply or attach it as a patch?

I'm pretty new to Drupal and I'm getting lot of errors trying to fumble my way through it :)

Thanks.

thekenshow’s picture

I'm trying to work through the same issue. Not sure what was in the pastebin from #4, but if you insert the following line where directed, you'll get a readable printout of $mpgRequest in the log:

watchdog(‘debug’, '<pre>' . print_r($mpgRequest, TRUE) . '</pre>');
tordrup’s picture

Wondering if anyone was able to solve this one. I got the latest mpgClasses.php from Moneris, and double-checked what I'm posting, and where -- I still get the API mismatch error.

dlx’s picture

Version: 6.x-1.0-alpha1 » 6.x-1.x-dev
Issue tags: +API mismatch

Just talked to Moneris level 2 support guy and he told me that there is basically no testing server for Moneris API Integration uc_moneris is using.

NO, IT'S NOT DIRECTPOST TYPE! DON'T USE THOSE ps_store_id and hpp_key CREDENTIALS!.

Just try one of the fake CC In the production environment with real store id (monNNNNNN) and API token. The transaction will be denied and you'll get "Credit card **purchase** declined: No Pre-auth corresponds to the store Id and order Id and transaction Id entered" log message which is ok for a fake CC.

As well, watch out for this one: http://drupal.org/node/716062 The patch described in the thread is still not applied. You'd have to apply it manually.