By MosquitoWeb on Thursday, 01 July 2021
Posted in General Issues
Replies 7
Likes 0
Views 669
Votes 0
Hello,

is ther a way to print in the invoice the "Gateway Txn Id" received from payment gateway during payment?
I use bitpay gateway.

Thanks,
Mario
Hey Mario,

Let me know where you want to show exactly and how.
Can you explain so i'll check it's possibility.
·
Friday, 02 July 2021 13:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

I need to show in any place in the invoice. I already customize invoice so I can modify template bu myself.

What I don't know is how to retreive this parameter: "Gateway Txn Id"
Is there a php variable or I have to query database directly before and then show the result in the pdf template?

Thanks,
M.
·
Friday, 02 July 2021 16:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey,

Directly there is no way to show the gateway transaction , you need to do it by customisation.
To get the transation id , refer below mentioned code.


$transaction = $invoice->getTransactions();
if ($transaction) {
$gatewayTransactionId = $transaction->getGatewayTxnId();
}


Let me know if you have any query.
·
Friday, 02 July 2021 17:07
·
0 Likes
·
0 Votes
·
0 Comments
·
I receive this error: Call to a member function getGatewayTxnId() on array
Maybe I have to cast someting?
Sorry but I do not know PHP...
·
Sunday, 04 July 2021 18:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey,

Sorry for the delayed response.

Use the below mentioned code.

<?php $transaction = $invoice->getTransactions();
$transaction = array_pop($transaction);
if ($transaction) {
$gatewayTransactionId = $transaction->getGatewayTxnId();
}
?>


Update us if still issue persist.
·
Monday, 05 July 2021 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

now works but I've another issue.
It works for payement with credit cards and offline but id doesn't works for Bitcoin payment:

It return 0

Please see picture in attachment to understand the transaction details.
I need "gateway txn id"

Thanks,
Mario
·
Monday, 05 July 2021 22:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Is it possible for you to provide us with the back end and FTP access to your site to check on this issue?
·
Tuesday, 06 July 2021 10:37
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post