function process_risk_information_notification($Gresponse, $googlepayment) { global $db; list($root, $data) = $Gresponse->GetParsedXML(); $google_order_number = $data[$root]['google-order-number']['VALUE']; $google_order = $db->Execute("SELECT orders_id from " . "" . $googlepayment->table_order . " where google_order_number = " . "'" . makeSqlString($google_order_number) . "'"); // fwrite($message_log,sprintf("\n%s\n", $google_order->fields['orders_id'])); $sql_data_array = array('orders_id' => $google_order->fields['orders_id'], 'orders_status_id' => GC_STATE_NEW, 'date_added' => 'now()', 'customer_notified' => 0, 'comments' => GOOGLECHECKOUT_STATE_STRING_RISK_INFO . "\n" . GOOGLECHECKOUT_STATE_STRING_RISK_ELEGIBLE . $data[$root]['risk-information']['eligible-for-protection']['VALUE'] . "\n" . GOOGLECHECKOUT_STATE_STRING_RISK_AVS . $data[$root]['risk-information']['avs-response']['VALUE'] . "\n" . GOOGLECHECKOUT_STATE_STRING_RISK_CVN . $data[$root]['risk-information']['cvn-response']['VALUE'] . "\n" . GOOGLECHECKOUT_STATE_STRING_RISK_CC_NUM . $data[$root]['risk-information']['partial-cc-number']['VALUE'] . "\n" . GOOGLECHECKOUT_STATE_STRING_RISK_ACC_AGE . $data[$root]['risk-information']['buyer-account-age']['VALUE'] . "\n"); zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); $db->Execute("UPDATE " . TABLE_ORDERS . " SET orders_status = '" . GC_STATE_NEW . "' " . "WHERE orders_id = '" . makeSqlInteger($google_order->fields['orders_id']) . "'"); $Gresponse->SendAck(); }
// Coustom Order Totals // ver el tema del tax... //$_POST['dc_redeem_code'] = 'ROPU'; require_once DIR_WS_CLASSES . 'order_total.php'; $order_total_modules = new order_total(); $order_total_modules->collect_posts(); $order_total_modules->pre_confirmation_check(); $order_totals = $order_total_modules->process(); //print_r($order_totals); $tax_address = zen_get_tax_locations(); $ot_used = false; foreach ($order_totals as $order_total) { if (!in_array($order_total['code'], $googlepayment->ot_ignore)) { // Cant used this since the OT is passed as an item, and tax cant be calculated $tax_class_id = @constant("MODULE_ORDER_TOTAL_" . substr(strtoupper($order_total['code']), 3) . "_TAX_CLASS"); $tax = $db->Execute("select tax_class_title \n from " . TABLE_TAX_CLASS . " \n where tax_class_id = " . makeSqlInteger($tax_class_id)); $tt = @$tax->fields['tax_class_title']; if (!empty($tt) && !in_array($tax_class_id, $tax_array)) { $tax_array[] = $tax_class_id; $tax_name_array[] = $tt; } $ot_value = $order_total['value'] * (strrpos($order_total['text'], '-') === false ? 1 : -1); //($order_total['text']{0}=='-'?-1:1); $Gitem = new GoogleItem($order_total['title'], '', '1', $currencies->get_value(DEFAULT_CURRENCY) * $ot_value, 'LB', 0); $Gitem->SetMerchantPrivateItemData(new MerchantPrivateItemData(array('order_total' => base64_encode(serialize($order_total))))); //print_r($order_total); if (!empty($tt)) { $Gitem->SetTaxTableSelector($tt); } // TaxTable with 0% Rate // $Gitem->SetTaxTableSelector('_OT_cero_tax');