Reply
Highlighted
Member
Posts: 2
Registered: ‎07-07-2019
Accepted Solution

getTransactionDetailsResponse can't retrieve the InvoiceNumber

Hello,

 

I have been searching and testing for a while, I hope someon can help me out here!

 

I am using Accept Hosted, with Redirect method, PHP SDK library and PHP language.

I am using WebHook to check notification of authorize+capture. I managed to get the transID and then I use it to run getTransactionDetails.

 

I get correctly the response and can retrieve the status, so this is work fine:

$status = $response->getTransaction()->getTransactionStatus();

 

However, it seems that I can't retrieve the invoiceNumber or desc. I have set them at the  createTransactionRequest step and I can actually see the invoice number and description both on Authorize Payment Step (when redirected to Authorize to enter credit card details) and in my Authorize Sandbox dashboard.

 

Here is what I use :

$invoice = $response->getOrder()->getInvoiceNumber();
$desc = $response->getOrder()->getDescription();

 

I have checked the getter and they seem correct so I wonder what is going wrong...

 

Thank you in advance!


Accepted Solutions
Highlighted
Solution
Accepted by topic author Maestreldev
‎07-07-2019 11:57 PM
All Star
Posts: 707
Registered: ‎11-05-2018

Re: getTransactionDetailsResponse can't retrieve the InvoiceNumber

@Maestreldev

The object is one more node down. I am sending you an IM.

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author Maestreldev
‎07-07-2019 11:57 PM
All Star
Posts: 707
Registered: ‎11-05-2018

Re: getTransactionDetailsResponse can't retrieve the InvoiceNumber

@Maestreldev

The object is one more node down. I am sending you an IM.
Highlighted
Member
Posts: 2
Registered: ‎07-07-2019

Re: getTransactionDetailsResponse can't retrieve the InvoiceNumber

[ Edited ]

Thank you! The documentation was misleading since it seems that invoiceNumber is a node of Order, yes, but not that Order is a node of Transaction...

 

For anyone who is looking for the getter for invoiceNumber, I post here the solution given by Renaissance :

 

$result = $response->getTransaction()->getOrder()->getInvoiceNumber();

 

Thanks again. ;-)