# Created : Mar 1, 2010 12:19:26 PM # ######################################### global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; tep_db_connect(); use_class('jng_sp'); use_class('jng_sp_orders'); use_class('payone'); use_class('payone_invoice'); $class_sp = new jng_sp(); $class_jo = new jng_sp_orders(); $class_payone = new payone(); $class_pi = new payone_invoice(); $sets_of_returns = $class_payone->retrieveRefundList("status = 0"); //TODO : ALSO INCLUDE ALL OVERPAYMENT FROM payone_invoice WITH invoice_complete_status = 'O' if (count($sets_of_returns) > 0) { #echo "<pre>";var_dump($sets_of_returns); foreach ($sets_of_returns as $returns) { $joi_id = $returns['jng_sp_orders_items_id']; $amount_return = round($returns['amount']); $invoice_id = $returns['invoice_id']; $payi = $class_payone->retrieveList("invoice_id = {$invoice_id}"); #echo "<pre>";var_dump($payi); if (count($payi > 0)) { $amount = round($payi[0]['invoice_amount'] * 100); $amount_paid = round($payi[0]['invoice_amount_paid'] * 100); $amount_cancel = round($payi[0]['invoice_amount_cancel'] * 100); $amount_overpayment = round($payi[0]['invoice_amount_overpayment'] * 100); //PLEASE REPLACE BOTH LINES BELOW AND CHANGE WITH BOTH LINES ABOVE WHEN GOING LIVE
use_class('minierp_customers'); use_class('payone'); use_class('payone_invoice'); use_class('payone_logger'); $class_sp = new jng_sp(); $class_jo = new jng_sp_orders(); $class_o = new orders(); $class_payone = new payone(); $class_jcust = new jng_sp_customers(); $class_cust = new minierp_customers(); $process_method = 'DEBIT'; //$sets_of_returns = $class_payone->retrieveRefundSubmitReadyList("status = 0"); $pkey_ids = explode(',', tep_db_prepare_input($_GET['pkey_id'])); if (count($pkey_ids) > 0) { $pkey_ids = implode(',', $pkey_ids); $sets_of_returns = $class_payone->retrieveRefundList("status = 0 AND pkey_id IN (" . $pkey_ids . ")"); $counter = 0; $counter_returns = 0; $counter_returns_no_txid = 0; $status_paid_complete = array('P', '1'); //$counter_is_refund = 0; $counter_is_refund = array(); if (count($sets_of_returns) > 0) { //echo "<pre>";var_dump($sets_of_returns);die(); $success = array(); $failed = array(); foreach ($sets_of_returns as $returns => $data) { //echo "<pre>";var_dump($data);die(); if ($returns != '') { $txid = $returns; $class_pi = new payone_invoice("payone_txid", $txid);