Hi,

The transaction information is stored in the DB table uc_desjardins. Unfortunately it is difficult to search that table if one does not have the associated transaction ID (trxnid). Given an Ubercart order ID, I have not been able to easily access the associated Desjardins infos.

Since Desjardins requires some specific transaction info to be present on the order invoices, I have added the trxnid to the data stored in the uc_payment_receipts table.

I submit the attached patch as a potential solution.

I use the following code for the lookup:

  $infos = array();
  
  $receipt = uc_payment_load_payments($order_id);
  if($receipt) {
    $data = unserialize($receipt[0]->data);
    if(isset($data['trn_id'])) {
      $trn_infos = db_result(db_query("SELECT trn_info FROM {uc_desjardins} WHERE trn_id = '%s'", $data['trn_id']));
      if($trn_infos) {
        $infos = unserialize($trn_infos);
      }
    }
  }

-Patrick

CommentFileSizeAuthor
adding_trxnid_to_payment_data.patch487 bytesPatrick Hubert

Comments

samuelsov’s picture

Status: Active » Fixed

Patch applied.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.