I made a custom payment method that posts data to a payment gateway and the gateway then posts data back to the entered return URL. This is the code I am using for my callback function but it doesnt seem to respond
Code: Select all
public function callback() {
require_once('money_functions/functions.php');
$logfile = "money_.".date ("Y-m-d_His")."__".rand(100,999).".log";
dLogOpen ($logfile);
dLogWrite("Test:\n function seen and implemented \n");
dLogClose();
if (isset($this->request->post['orderid'])) {
$order_id = $this->request->post['orderid'];
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
if($_GET['unique_transaction_id'])
{
$order_status_id = $this->config->get('config_order_status_id');
$transactionArray['transaction_reference'] = trim($_GET['transaction_reference']);
$transactionArray['unique_transaction_id'] = trim($_GET['unique_transaction_id']);
$transactionArray['item_number'] = trim($_GET['item_number']);
if($transactionArray['unique_transaction_id'] != '' && $transactionArray['transaction_reference'] != '')
{
$transactionArray = yo_account_tx_check_status($transactionArray);
if($transactionArray['api_response']['TransactionStatus'] == "SUCCEEDED")
{
$order_status_id = "Complete";
$this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
}
else
{
$order_status_id = "Failed";
$this->model_checkout_order->addOrderHistory($order_id, $order_status_id);
}
}
}
else{
}
}
}