Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction ID #17

Closed
ghost opened this issue Mar 6, 2015 · 11 comments
Closed

Transaction ID #17

ghost opened this issue Mar 6, 2015 · 11 comments

Comments

@ghost
Copy link

ghost commented Mar 6, 2015

Hello,

I am trying to integrate Omnipay into CodeIgniter - I'm a seasoned PHP developer, but I am having some difficulty getting a transaction id from a Purchase or Authorization using the Authorize.net module. If I run the ->getData() method on the response, I get a large array of values, which can be a little overwhelming. Could you tell me which index is the TransactionID or if there is a method defined to get the transaction id from the response?

Thanks,

Kyle

@greydnls
Copy link
Contributor

greydnls commented Mar 6, 2015

Kyle,

$response->getTransactionReference(); should do it for you. Let me know if you have any further questions.

@ghost
Copy link
Author

ghost commented Mar 6, 2015

Thank you Kayla! :)

On Fri, Mar 6, 2015 at 1:16 PM, Kayla Daniels notifications@github.com
wrote:

Kyle,

$response->getTransactionReference(); should do it for you. Let me know
if you have any further questions.


Reply to this email directly or view it on GitHub
#17 (comment)
.

@ghost
Copy link
Author

ghost commented Mar 6, 2015

Sorry, but this did not work for the Authorize.net AIM api

On Fri, Mar 6, 2015 at 2:01 PM, Kyle Dye kyle.dye@gmail.com wrote:

Thank you Kayla! :)

On Fri, Mar 6, 2015 at 1:16 PM, Kayla Daniels notifications@github.com
wrote:

Kyle,

$response->getTransactionReference(); should do it for you. Let me know
if you have any further questions.


Reply to this email directly or view it on GitHub
#17 (comment)
.

@greydnls
Copy link
Contributor

greydnls commented Mar 6, 2015

The function should exist on your response object, as seen here.
https://github.com/thephpleague/omnipay-authorizenet/blob/master/src/Message/AIMResponse.php#L54-L57

Is it giving you a specific error, or just not working?

@pollen8
Copy link

pollen8 commented Mar 17, 2015

I'm having the same issue for me it returns "0"
I'm currently just testing so have the following:

$gateway->setTestMode(true);
$gateway->setDeveloperMode(true);

The response variable seems to be an array and the transaction reference index at 37, not 4 as used in AIMResponse.php (line 46):

public function getAuthorizationCode()
{
    return $this->data[4];
}

so I changed that to

public function getAuthorizationCode()
{
    return $this->data[37];
}

and for the test environment that works. I don't yet have a live account set up to test this on live though

@pollen8
Copy link

pollen8 commented Mar 17, 2015

ok a quick look at the docs states that it is index 37.
http://www.authorize.net/support/AIM_guide.pdf
see the section "Table 17 Payment Gateway Response Fields "

@pollen8
Copy link

pollen8 commented Mar 17, 2015

woops sorry its not the getAuthorizationCode() but getTransactionReference()

see this pr
pollen8#1

@ghost
Copy link
Author

ghost commented Apr 27, 2015

The current code works for me. To get a non-zero transaction ID turn test mode off. Provided developer mode is still on, you can use the test credit card numbers listed here for successful transactions.

Click the response tab of the docs for charging a card and scroll down to the transId row...

When testRequest is set to a positive response, or when Test Mode is enabled on the payment gateway, this value will be 0.

@judgej
Copy link
Member

judgej commented Apr 27, 2015

Can confirm, in test mode the transactionReference (sent as x_trans_id) will always be zero (for AIM and SIM at least). Similarly, the x_auth_code will be "000000".

Some gateways will send you a validly formatted transaction reference even in test mode, but not this one.

@judgej
Copy link
Member

judgej commented Jul 5, 2015

Can this be closed? It looks like it is working as it should.

@ghost
Copy link
Author

ghost commented Jul 15, 2015

Yes it can be - thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants