} $request['param'] = $order['order_id']; //APPLY UTF-8 ENCODING TO ALL REQUEST (STRING VALUE) foreach ($request as $key => $value) { if (is_string($value)) { $request[$key] = utf8_encode($value); } elseif (is_array($value)) { foreach ($value as $val_key => $val_value) { if (is_string($val_value)) { $request[$key][$val_key] = utf8_encode($val_value); } } } } //PROCESS REQUEST $class_plog = new payone_logger(); $process_time = date('Y-m-d H-i:s'); $fconnect = new financegateConnect(); $fconnect->setApiUrl(PAYONE_API_URL); $response = $fconnect->processByArray($request); $result = $order_id; if (!is_array($response)) { $result .= ',0'; //$result = "<b>Error in Connection</b>"; } else { if ($response['status'] == 'APPROVED') { $result .= ',1'; $payi->markSubmitted($response); if ($response['userid'] != '') { tep_db_query("UPDATE jng_sp_customers SET payone_userid = " . tep_db_prepare_input($response['userid'])); }
<?php global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; require_once DIR_WS_FUNCTIONS . 'html_output.php'; tep_db_connect(); use_class('payone/financegateConnect'); use_class('payone_logger'); $class_plog = new payone_logger(); if (isset($_GET['id'])) { $success_ids = array(); $fail_ids = array(); $bad_ids = array(); $log_ids = explode(',', $_GET['id']); foreach ($log_ids as $log_id) { $id = tep_db_prepare_input($log_id); $log = $class_plog->retrieveDetailData($id); if ($log['log_process'] == 'R') { $request = unserialize($log['log_process_data_submit']); $request['mid'] = PAYONE_MERCHANT_ID; $fconnect = new financegateConnect(); $fconnect->setApiUrl('http://www.manobo.de/gateway/payone_status_updates.php'); $response = $fconnect->processByArray($request); if ($response[0] == 'TSOK') { $success_ids[] = $id; } else { $fail_ids[] = $id; } } else {
function payoneCustomerConsumerScore($order_id, $is_sp = true) { use_class('jng_sp_orders'); use_class('jng_sp_customers'); $class_orders = new jng_sp_orders(); $class_cust = new jng_sp_customers(); $process_method = PAYONE_REQUEST_CONSUMERSCORE; $result = null; if ($is_sp) { $q = "SELECT c.`customer_firstname` firstname,c.`customer_lastname` lastname\n , o.`customer_billing_address` street, o.`customer_billing_postcode` zip, o.`customer_billing_city` city, o.`customer_billing_country` country, o.`customer_billing_phone` telephonenumber\n FROM jng_sp_orders o\n INNER JOIN jng_sp_customers c ON c.`customer_id` = o.`customer_billing_id`\n WHERE o.`jng_sp_orders_id` = {$order_id}"; } else { $q = $q = "SELECT o.`delivery_name`, o.`delivery_company` company, o.`delivery_street_address` street, o.`delivery_postcode` zip, o.`delivery_city` city, o.`delivery_country` country\n , c.`customers_telephone` telephonenumber\n FROM orders o\n INNER JOIN customers c ON c.`customers_id` = o.`customers_id`\n WHERE o.`orders_id` = {$order_id}"; } $dbq = tep_db_query($q); $r = array(); $r = tep_db_fetch_array($dbq); if (count($r) > 1) { $request = array(); //--STANDARD PARAMETERS $request['mid'] = PAYONE_MERCHANT_ID; $request['portalid'] = PAYONE_PORTAL_ID; $request['key'] = md5(PAYONE_PORTAL_KEY); $request['mode'] = PAYONE_MODE; $request['request'] = $process_method; $request['encoding'] = 'UTF-8'; $request['aid'] = $is_sp ? PAYONE_SUBACCOUNT_ID_OTTODE : PAYONE_SUBACCOUNT_ID_JNG; //PREPARE PARAMETERS $request['addresschecktype'] = 'BA'; //BA : Addresscheck Basic; PE : Addresscheck Person (cannot used, must have another settings) $request['consumerscoretype'] = 'IB'; //IH : Infoscore (hard criteria); IA : Infoscore (all criteria); IB : Infoscore (all criteria + boni score) if ($is_sp) { $request['firstname'] = $r['firstname']; $request['lastname'] = $r['lastname']; } else { list($request['firstname']) = split(" ", $r['billing_name']); $request['lastname'] = trim(substr($r['billing_name'], strlen($request['firstname']), strlen($r['billing_name']) - strlen($request['firstname']))); } if ($r['company'] != '') { $request['company'] = $r['company']; } $request['street'] = $r['street']; $request['zip'] = $r['zip']; $request['city'] = $r['city']; $request['country'] = getISO3166CountryCode($r['country']); if ($r['telephonenumber'] != '') { $request['telephonenumber'] = $r['telephonenumber']; } // echo "<pre>";return var_dump($request);die(); use_class('payone_logger'); use_class('payone/financegateConnect'); $class_plog = new payone_logger(); $fconnect = new financegateConnect(); $process_time = date('Y-m-d H:i:s'); $fconnect->setApiUrl(PAYONE_API_URL); $response = $fconnect->processByArray($request); $class_plog->add('S', $process_time, $process_method, $request, $response); $result = $returns['txid']; if (is_array($response)) { // $result = $response['status']; $result = $response; } } return $result; }
######################################### # Author : D3W4, SAHAT # # Created : Feb 17, 2010 11:35:16 AM # ######################################### global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; require_once DIR_WS_FUNCTIONS . 'html_output.php'; tep_db_connect(); use_class("Order"); use_class("payone"); use_class("payone_invoice"); use_class("payone_logger"); $class_plog = new payone_logger(); //$raw = $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents("php://input"); /* * Just backup, maybe needed later for translation $method_options = array(); $method_options['elv'] = 'Debit Payment (Bankeinzug)'; $method_options['cc'] = 'Credit Card'; $method_options['vor'] = 'Advance Payment (Vorkasse)'; $method_options['rec'] = 'Invoice'; $method_options['sb'] = 'Online Bank Transfer'; $method_options['cod'] = 'Cash on Delivery'; $method_options['wlt'] = 'E-Wallet (Paypal)'; */ /* if(!empty($raw)&&$raw<>''){ $data = unserialize($raw); //DATA SENT SERIALIZED
<?php use_class('payone_logger'); $class_paylog = new payone_logger(); if (isset($_POST['me_action']) && $_POST['me_action'] != '') { if ($_POST['me_action'] == 'CANCELQUEUEDREFUND') { use_class('payone'); $class_payone = new payone(); $pkey_id = tep_db_prepare_input($_POST['pkeyid']); $status = str_replace('C', '', tep_db_prepare_input($_POST['type'])); $class_payone->updateReturnStatus($pkey_id, $status); echo utf8_encode($pkey_id); exit; } elseif ($_POST['me_action'] == 'UPDATEINVOICE') { use_class('payone_invoice'); $invoice_id = tep_db_prepare_input($_POST['invid']); $payi = new payone_invoice('invoice_id', $invoice_id); $field = tep_db_prepare_input($_POST['fld']); $value = tep_db_prepare_input($_POST['val']); if ($field == 'invoice_complete_status') { $value = trim(strtoupper($value)); } $payi->updateField($field, $value); echo utf8_encode($field); exit; } } //DETAIL VIEW if (isset($_GET['id']) && $_GET['id'] != '') { $id = tep_db_prepare_input($_GET['id']); $content = $class_paylog->retrieveDetail($id);
<?php global $db; require_once '../confy.php'; require_once '../functions.php'; require_once '../functions-2.php'; tep_db_connect(); use_class("payone_logger"); $class_plog = new payone_logger(); $server_name = 'http://' . $_SERVER['SERVER_NAME']; $log_ids = $class_plog->retrieveErrorsUnnotified(); if (count($log_ids) > 0) { $subjet = 'Payone Error'; $message = 'Please check payone log ID:' . '<br />' . "\n"; foreach ($log_ids as $id => $log) { $pmi_link = ''; $txid = ''; if (strlen($log['log_process_data_result']) <= 4) { $result = $log['log_process_data_result']; } else { $result_array = unserialize($log['log_process_data_result']); $submit_array = unserialize($log['log_process_data_submit']); $result = $result_array['errormessage']; if (isset($result_array['txid'])) { $txid = $result_array['txid']; } elseif (isset($submit_array['txid'])) { $txid = $submit_array['txid']; } if ($txid != '') { $pmi_link = ' (txid: ' . payoneWebLink($txid) . ')'; }