function ICEPAYOneOffPay($orderInfo, $params = array()) { require_once OSEMSC_B_LIB . DS . 'icepayAPI' . DS . 'icepay.php'; $pConfig = oseMscConfig::getConfig('payment', 'obj'); $merchant_id = $pConfig->icepay_merchant_id; $secret_code = $pConfig->icepay_secret_code; $icepay_country = $pConfig->icepay_country; $icepay_lang = $pConfig->icepay_lang; $db = oseDB::instance(); $payment = oseRegistry::call('payment'); $paymentOrder = $payment->getInstance('Order'); $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id); if (empty($icepay_country)) { $query = "SELECT country_2_code FROM `#__osemsc_country` WHERE `country_3_code` = '{$billinginfo->country}'"; $db->setQuery($query); $icepay_country = $db->loadResult(); } if (empty($icepay_lang)) { $lang =& JFactory::getLanguage(); $arr = explode("-", $lang->get('tag')); $icepay_lang = strtoupper($arr[0]); } //$orderInfo->payment_price = "19.99"; $amount = intval(strval(100 * $orderInfo->payment_price)); $Desc = $this->generateDesc($orderInfo->order_id); $currency = $orderInfo->payment_currency; $tran = new ICEPAY($merchant_id, $secret_code); $tran->SetOrderID($orderInfo->order_id); $tran->SetReference($orderInfo->order_number); //$tran->assignCountry('US'); //$tran->assignLanguage('EN'); //$tran->assignCurrency($currency); //$tran->assignAmount($amount); return $tran->Pay($icepay_country, $icepay_lang, $currency, $amount, $Desc); }
if(!$valid_ip) { $mailsubject= "ICEPAY IPN Fatal Error on your Site"; $mailbody= "Hello, A fatal error occured while processing a ICEPAY transaction(IP not in range). ---------------------------------- IP: ".$_SERVER['REMOTE_ADDR']; $emailObj= new stdClass(); $emailObj->subject= $mailsubject; $emailObj->body= $mailbody; $apiEmail->sendToAdminGroup($emailObj, $oseMscConfig->admin_group); exit; } } $tran = new ICEPAY($merchant_id,$secret_code); if($tran->OnPostback()) { $data = $tran->GetPostback(); $status = $data->status; $reference = $data->reference; $db = JFactory::getDBO(); $where= array(); $where[]= "`order_number`=".$db->quote($reference); $payment= oseRegistry :: call('payment'); $orderInfo = $payment->getOrder($where, 'obj'); $order_id= $orderInfo->order_id; $member_id= $orderInfo->user_id; $orderInfoParams= oseJson :: decode($orderInfo->params); if(empty($orderInfo)) {
<?php /** * ICEPAY Library for PHP * * This file is a base class for all payment methods of ICEPAY. * However, creating an instance of this class will redirect you to a payment screen of ICEPAY * where you will be able to choose from different payment methods. * * @author ICEPAY <*****@*****.**> * @copyright Copyright (c) 2011, ICEPAY * @version 1.0.9 */ foreach (ICEPAY::GetCoreClasses() as $filename) { require_once $filename; } class ICEPAY { protected $version = "1.1.0"; protected $merchantID = 0; protected $secretCode = ""; protected $orderID = ""; protected $issuer = ""; protected $country = ""; protected $language = ""; protected $currency = ""; protected $amount = 0; protected $description = ""; protected $paymentMethod = ""; protected $reference = ""; protected $logging = false;