Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $module_cart = getModuleInfo('iCart');
- if(!empty($_POST['payment_type']) && ($_POST['payment_type'] == 2 || $_POST['payment_type'] == 5))
- {
- $shipFields = [
- // Shipping address
- "first_name" => "",
- "last_name" => "",
- "city" => "",
- "country" => "",
- "state_prefix" => "",
- "address1" => "",
- "address2" => "",
- "zip" => "",
- "email" => "",
- "phone1" => "",
- ];
- }
- else
- {
- $shipFields = [
- // Shipping address
- "first_name" => "",
- "last_name" => "",
- "city" => "",
- "country" => "",
- "state_prefix" => "",
- "address1" => "",
- "address2" => "",
- "zip" => "",
- "email" => "",
- "phone1" => "",
- ];
- }
- $billFields = [
- // Billing address
- "first_name" => "",
- "last_name" => "",
- "country" => "",
- "city" => "",
- "state_prefix" => "",
- "address1" => "",
- "address2" => "",
- "zip" => "",
- // Payment Information
- "card_number" => "",
- "month" => "",
- "year" => "",
- "security_id" => "",
- "phone1" => "",
- "email" => "",
- ];
- if(!empty($_SESSION['post']['s']))
- $_POST['post']['s'] = $_SESSION['post']['s'];
- if(empty($_POST['post']['s']) and !empty($_POST['post']['b']))
- {
- $_POST['post']['s']['email'] = $_POST['post']['b']['email'];
- $_POST['post']['s']['phone1'] = $_POST['post']['b']['phone1'];
- }
- if(isset($_POST['post']['s']) && isset($_POST['post']['b']))
- {
- //$payment_type = ( isset( $_POST['payment_type'] ) ? $_POST['payment_type'] == 1 ? 1 : $_POST['payment_type'] == 2 ? 2 : 3 : 2 );
- $payment_type = (!empty($_POST['payment_type'])) ? $_POST['payment_type'] : 2;
- foreach($_POST['post']['s'] as $key => $val)
- {
- if(is_string($val))
- {
- if(ini_get('magic_quotes_gpc') == 1)
- {
- $_POST['post']['s'][$key] = trim(stripslashes($val));
- }
- else
- {
- $_POST['post']['s'][$key] = trim($val);
- }
- }
- }
- foreach($_POST['post']['b'] as $key => $val)
- {
- if(is_string($val))
- {
- if(ini_get('magic_quotes_gpc') == 1)
- {
- $_POST['post']['b'][$key] = trim(stripslashes($val));
- }
- else
- {
- $_POST['post']['b'][$key] = trim($val);
- }
- }
- }
- if(isset($_POST['post']['ship_as_bill_address']) && ($payment_type == 1 || $payment_type == 3 || $payment_type == 4))
- {
- foreach($billFields as $key => $val)
- {
- if(!empty($_POST['post']['s'][$key]))
- $_POST['post']['b'][$key] = $_POST['post']['s'][$key];
- }
- }
- $original_ship_fields_count = count($shipFields);
- $shipFields = array_merge($shipFields, $_POST['post']['s']);
- $original_bill_fields_count = count($billFields);
- $billFields = array_merge($billFields, $_POST['post']['b']);
- $out['p'] = [
- 'ship' => $shipFields,
- 'bill' => $billFields
- ];
- if($original_ship_fields_count == count(
- $shipFields
- ) && $original_bill_fields_count == count($billFields)
- )
- {
- $is_abon_c = 0;
- $other_items_c_2 = 0;
- foreach($_SESSION['cart']['items'] as $item_num => $item_value)
- {
- $abon = exec_sql2array(
- //"SELECT * FROM `" . PREFIX . "product_info` WHERE `product_type_id`='4' and `id`='$item_num'"
- "SELECT * FROM `" . PREFIX . "product_info` WHERE `physical`='0' and `id`='$item_num'"
- );
- if(!empty($abon))
- {
- $is_abon_c++;
- }
- $other_items = exec_sql2array(
- "SELECT * FROM `" . PREFIX . "product_info` WHERE `physical`='1' and `id`='$item_num'"
- );
- if(!empty($other_items))
- {
- $other_items_c_2++;
- }
- }
- if($is_abon_c > 0 && $other_items_c_2 == 0)
- {
- if(!empty($_POST['payment_type']) && ($_POST['payment_type'] == 2 || $_POST['payment_type'] == 5))
- {
- $shipTestFields = [
- "phone1" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "email" => [
- "!is_fill()" => trans("This entry is required"),
- "!testEmail()" => trans(
- "Not correctly specified E-mail"
- ),
- ],
- ];
- }
- else
- {
- $shipTestFields = [
- "email" => [
- "!is_fill()" => trans("This entry is required"),
- "!testEmail()" => trans(
- "Not correctly specified E-mail"
- ),
- ],
- ];
- }
- }
- else
- {
- if(!empty($_POST['payment_type']) && ($_POST['payment_type'] == 2 || $_POST['payment_type'] == 5))
- {
- $shipTestFields = [
- "first_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "last_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "city" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "state_prefix" => [
- ],
- "address1" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "address2" => [
- ],
- "zip" => [
- ],
- "phone1" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "email" => [
- "!is_fill()" => trans("This entry is required"),
- "!testEmail()" => trans(
- "Not correctly specified E-mail"
- ),
- ],
- ];
- }
- else
- {
- $shipTestFields = [
- "first_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "last_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "city" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "state_prefix" => [
- ],
- "address1" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "address2" => [
- ],
- "zip" => [
- ],
- "email" => [
- "!is_fill()" => trans("This entry is required"),
- "!testEmail()" => trans(
- "Not correctly specified E-mail"
- ),
- ],
- ];
- }
- }
- $billTestFields = [
- "first_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "last_name" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "city" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "state_prefix" => [
- ],
- "address1" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "address2" => [
- ],
- "zip" => [
- ],
- "card_number" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "month" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "year" => [
- ],
- "security_id" => [
- "!is_fill()" => trans("This entry is required"),
- ],
- "phone1" => [
- "!is_fill()" => "",
- ],
- "email" => [
- "!is_fill()" => trans("This entry is required"),
- "!testEmail()" => trans("Not correctly specified E-mail"),
- ],
- ];
- if(!empty($billFields))
- {
- if($billFields['city'] == 'New York')
- {
- $group = '2';
- }
- else if($billFields['city'] == 'Brooklyn')
- {
- $group = '1';
- }
- else
- {
- $group = '';
- }
- $fields_2 = [
- "`email`",
- "`groups`",
- "`location`",
- "`subscribe`",
- "`new`",
- ];
- $values_2 = [
- "'" . $billFields['email'] . "'",
- "'" . $group . "'",
- "'" . $billFields['city'] . "'",
- "'1'",
- "'0'",
- ];
- if(!empty($billFields['email']))
- {
- $is_subscribers = exec_sql2array(
- "SELECT * FROM `dd_subscrib_emails` WHERE `email`='" . $billFields['email'] . "'"
- );
- if(empty($is_subscribers))
- {
- exec_sql(
- "INSERT INTO `dd_subscrib_emails` (" . implode(
- ",",
- $fields_2
- ) . ") VALUES (" . implode(
- ",",
- $values_2
- ) . ");"
- );
- }
- }
- if(!empty($shipFields))
- {
- if($shipFields['city'] == 'New York')
- {
- $group = '2';
- }
- else if($shipFields['city'] == 'Brooklyn')
- {
- $group = '1';
- }
- else
- {
- $group = '';
- }
- $fields_3 = [
- "`email`",
- "`groups`",
- "`location`",
- "`subscribe`",
- "`new`",
- ];
- $values_3 = [
- "'" . $shipFields['email'] . "'",
- "'" . $group . "'",
- "'" . $shipFields['city'] . "'",
- "'1'",
- "'0'",
- ];
- $is_subscribers_2 = exec_sql2array(
- "SELECT * FROM `dd_subscrib_emails` WHERE `email`='" . $shipFields['email'] . "'"
- );
- if(empty($is_subscribers_2))
- {
- exec_sql(
- "INSERT INTO `dd_subscrib_emails` (" . implode(
- ",",
- $fields_3
- ) . ") VALUES (" . implode(
- ",",
- $values_3
- ) . ");"
- );
- }
- }
- }
- if($payment_type == 1 || $payment_type == 3 || $payment_type == 4)
- {
- $shipFields['email'] = $billFields['email'];
- }
- if($payment_type == 2 || $payment_type == 5)
- {
- $billFields['phone1'] = $shipFields['phone1'];
- }
- $shipErrors = [];
- foreach($shipTestFields as $key => $value)
- {
- if(($error = testField($shipFields[$key], $value)) !== true)
- {
- if(!empty($error))
- {
- $shipErrors[$key] = $error;
- }
- }
- }
- $billErrors = [];
- if($payment_type == 1 || $payment_type == 3)
- {
- foreach($billTestFields as $key => $value)
- {
- if(($error = testField($billFields[$key], $value)) !== true)
- {
- if(!empty($error))
- {
- $billErrors[$key] = $error;
- }
- }
- }
- }
- if(count($shipErrors) == 0 && count($billErrors) == 0)
- {
- $shipFields['state'] = get_field(
- $zip_table,
- "`state_name`",
- "WHERE `state_prefix`='" . $shipFields['state_prefix'] . "'"
- );
- $billFields['state'] = get_field(
- $zip_table,
- "`state_name`",
- "WHERE `state_prefix`='" . $billFields['state_prefix'] . "'"
- );
- /*if ( !empty( $shipFields['zip'] ) ) {
- $zip_data = get_fields( $zip_table, "WHERE `zip_code`='".$shipFields['zip']."';" );
- if ( count( $zip_data ) > 0 ) {
- $shipFields['city'] = $zip_data['city'];
- $shipFields['state_prefix'] = $zip_data['state_prefix'];
- $shipFields['state'] = $zip_data['state_name'];
- }
- }
- if ( !empty( $billFields['zip'] ) ) {
- $zip_data = get_fields( $zip_table, "WHERE `zip_code`='".$billFields['zip']."';" );
- if ( count( $zip_data ) > 0 ) {
- $billFields['city'] = $zip_data['city'];
- $billFields['state_prefix'] = $zip_data['state_prefix'];
- $billFields['state'] = $zip_data['state_name'];
- }
- }*/
- $total_price = calcAllPrice();
- $cart_total = $total_price['total_price'];
- $shipFields['orders_count'] = 0;
- $shipFields['phone1'] = $billFields['phone1'];
- $shipFields['phone2'] = "";
- $service = [];
- $service['user'] = $shipFields;
- $service['bill'] = $billFields;
- $service['cart'] = $_SESSION['cart'];
- if($payment_type == 3)
- {
- $service['layaway'] = [
- "count" => $total_price['layaway_count'],
- "total" => $total_price['layaway_total'],
- ];
- }
- if(!empty($_SESSION['login']) && !empty($_SESSION['user']['id']))
- {
- $user_id = $_SESSION['user']['id'];
- }
- else
- {
- $user_id = '0';
- }
- $currency = 'USD';
- if($is_us == '1')
- {
- $currency_todb = 'USD';
- }
- else
- {
- $currency_todb = 'EUR';
- }
- $is_russia = '1';
- if($is_us == '1')
- {
- $is_russia = '0';
- if($is_canada == '1')
- {
- $order_country = 'Canada';
- }
- else
- {
- $order_country = 'USA';
- }
- }
- else
- {
- $order_country = 'Rest';
- }
- if(isset($_SESSION['cart']['shipping_country']))
- {
- if($_SESSION['cart']['shipping_country'] == 'USA')
- {
- $order_country = 'USA';
- }
- else
- {
- $order_country = 'Canada';
- }
- }
- $fields = [
- "user_id",
- "_create",
- "services",
- "status",
- "mc_gross",
- "mc_currency",
- "txn_id",
- "country",
- "country_by_ip",
- "europe"
- ];
- //$is_europe = (isset($is_europe) && strlen($is_europe) ? $is_europe : '0');
- $values = [
- "'" . $user_id . "'",
- "NOW()",
- "'" . mysql_real_escape_string(serialize($service)) . "'",
- "'0'",
- "'" . $cart_total . "'",
- "'" . $currency_todb . "'",
- "''",
- "'" . $order_country . "'",
- "'" . $ip . "'",
- "'" . $is_europe . "'"
- ];
- exec_sql(
- "INSERT INTO " . $accounts_table . " (" . implode(",", $fields) . ") VALUES (" . implode(",", $values) . ");"
- );
- // Order number here
- $account_id = mysql_insert_id();
- $_SESSION['expect_order'] = $account_id;
- if($payment_type == 1 || $payment_type == 4)
- {
- // Card Payment
- $what_user = exec_sql2array(
- "SELECT * FROM `" . PREFIX . "users` WHERE `id`='" . $user_id . "'"
- );
- if(!empty($what_user))
- {
- $what_user = $what_user[0];
- if(empty($what_user['card_number']) && empty($what_user['b_name']) && empty($what_user['l_name']))
- {
- if(!empty($billFields['card_number']))
- {
- $b_card_number = htmlspecialchars(
- $billFields['card_number']
- );
- $_SESSION['payment']['card_number'] = $b_card_number;
- }
- else
- {
- $b_card_number = '';
- $_SESSION['payment']['card_number'] = '';
- }
- if(!empty($billFields['month']))
- {
- $b_month = htmlspecialchars(
- $billFields['month']
- );
- $_SESSION['payment']['month'] = $b_month;
- }
- else
- {
- $b_month = '';
- $_SESSION['payment']['month'] = '';
- }
- if(!empty($billFields['year']))
- {
- $b_year = htmlspecialchars(
- $billFields['year']
- );
- $_SESSION['payment']['year'] = $b_year;
- }
- else
- {
- $b_year = '';
- $_SESSION['payment']['year'] = '';
- }
- if(!empty($billFields['security_id']))
- {
- $b_card_id = htmlspecialchars(
- $billFields['security_id']
- );
- $_SESSION['payment']['card_id'] = $b_card_id;
- }
- else
- {
- $b_card_id = '';
- $_SESSION['payment']['card_id'] = '';
- }
- if(!empty($billFields['first_name']))
- {
- $nu_first_name = $billFields['first_name'];
- }
- else
- {
- $nu_first_name = '';
- }
- if(!empty($billFields['last_name']))
- {
- $nu_last_name = $billFields['last_name'];
- }
- else
- {
- $nu_last_name = '';
- }
- if(!empty($billFields['phone1']))
- {
- $nu_phone = $billFields['phone1'];
- }
- else
- {
- $nu_phone = '';
- }
- if(!empty($billFields['email']))
- {
- $nu_mail = $billFields['email'];
- }
- else
- {
- $nu_mail = '';
- }
- if(!empty($billFields['address1']))
- {
- $nu_address = $billFields['address1'];
- }
- else
- {
- $nu_address = '';
- }
- if(!empty($billFields['city']))
- {
- $nu_city = $billFields['city'];
- }
- else
- {
- $nu_city = '';
- }
- if(!empty($billFields['state']))
- {
- $nu_state = $billFields['state'];
- }
- else
- {
- $nu_state = '';
- }
- if(!empty($billFields['zip']))
- {
- $nu_zip = $billFields['zip'];
- }
- else
- {
- $nu_zip = '';
- }
- exec_sql(
- "UPDATE `dd_users` SET `b_mail`='" . $nu_mail . "', `card_number`='**********" . substr(
- $b_card_number,
- -4,
- 4
- ) . "', `card`='" . $b_card_number . "', `month`='" . $b_month . "', `year`='" . $b_year . "', `card_id`='" . $b_card_id . "', `b_name`='" . $nu_first_name . "', `b_lname`='" . $nu_last_name . "', `b_phone`='" . $nu_phone . "', `b_address_1`='" . $nu_address . "', `b_city`='" . $nu_city . "', `b_state`='" . $nu_state . "' , `b_zip`='" . $nu_zip . "' WHERE `id`='" . $user_id . "';"
- );
- $_SESSION['payment']['phone'] = $nu_phone;
- }
- }
- $price_for_subscribe = 0;
- $is_abon_subscribe = 0;
- $subscription_paid = 1;
- ######################### оплата подписки на абонемент
- $subscr_cart = prepareCart($_SESSION['cart']);
- foreach($subscr_cart['items'] as $record)
- {
- $subsct_abon = exec_sql2array(
- //"SELECT * FROM `" . PREFIX . "product_info` WHERE `product_type_id`='4' and `id`='" . $record['item']['id'] . "' and `issubscribe`='1'"
- "SELECT * FROM `" . PREFIX . "product_info` WHERE `physical`='0' and `id`='" . $record['item']['id'] . "' and `issubscribe`='1'"
- );
- if(!empty($subsct_abon))
- {
- $is_abon_subscribe++;
- $price_for_subscribe += $record['total_price']; //цена подписки
- }
- }
- if(!empty($is_abon_subscribe) && $is_abon_subscribe > 0)
- {
- //$subscription_paid=0;
- //include "subscription_create.php";
- }
- $cart_price_for_card = $cart_total - $price_for_subscribe; //цена без учета стоимости подписки
- ###############
- //if just subscribe abon
- // временно - в связи с изменениями у Kartina.tv, все заказы обрабатываем вручную
- //if(true)
- // заказы из Европы проводятся вручную
- if((!$is_us && !$is_canada)) // || ($is_canada && $cart_price_for_card > 0) || ($is_canada && $is_abon_subscribe == 0))
- {
- // ручная обработка заказов
- $subscription_paid = 1;
- $response_array[0] = 1;
- }
- else
- {
- if(!empty($is_abon_subscribe) && $is_abon_subscribe > 0 && $other_items_c_2 == 0)
- {
- $response_array[0] = 1;
- }
- else
- {
- if($cart_price_for_card > 0)
- {
- if($payment_type == 1)
- {
- $post_url = "https://secure.authorize.net/gateway/transact.dll";
- $post_values = [
- "x_login" => $settings['auth_login'],
- "x_tran_key" => $settings['auth_key'],
- "x_version" => "3.1",
- "x_delim_data" => "TRUE",
- "x_delim_char" => "|",
- "x_relay_response" => "FALSE",
- "x_type" => "AUTH_CAPTURE",
- "x_method" => "CC",
- "x_currency_code" => $currency,
- "x_card_num" => $billFields['card_number'],
- "x_exp_date" => $billFields['month'] . $billFields['year'],
- "x_card_code" => $billFields['security_id'],
- "x_amount" => number_format(
- $cart_price_for_card,
- 2,
- '.',
- ''
- ),
- "x_description" => "Payment for services on the site " . $uri['domain'],
- "x_first_name" => $billFields['first_name'],
- "x_last_name" => $billFields['last_name'],
- "x_city" => $billFields['city'],
- "x_address" => $billFields['address1'],
- "x_state" => $billFields['state']
- //"x_zip" => $billFields['zip']
- ];
- $post_string = "";
- foreach($post_values as $key => $value)
- {
- $post_string .= (!empty($post_string) ? "&" : "") . $key . "=" . urlencode(
- $value
- );
- }
- $request = curl_init($post_url);
- curl_setopt(
- $request,
- CURLOPT_HEADER,
- 0
- );
- curl_setopt(
- $request,
- CURLOPT_RETURNTRANSFER,
- 1
- );
- curl_setopt(
- $request,
- CURLOPT_POSTFIELDS,
- $post_string
- );
- curl_setopt(
- $request,
- CURLOPT_SSL_VERIFYPEER,
- false
- );
- $post_response = curl_exec(
- $request
- );
- curl_close($request);
- $response_array = explode(
- $post_values["x_delim_char"],
- $post_response
- );
- $out['payment_type'] = $payment_type;
- }
- if($payment_type == 4)
- {
- // Card Payment
- $sandbox = false;
- $api_version = '85.0';
- $api_endpoint = $sandbox ? 'https://api-3t.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp';
- $api_username = $sandbox ? 'xander.monk-facilitator_api1.gmail.com' : $settings['pppro_username'];
- $api_password = $sandbox ? '1397164939' : $settings['pppro_password'];
- $api_signature = $sandbox ? 'AURHNsg1Fk3cAULW4uwMYSQHlV95APcQBFyukiiZVFZ3w9rSn9wwU2w0' : $settings['pppro_signature'];
- $c_type = substr(
- $billFields['card_number'],
- 0,
- 1
- );
- switch($c_type)
- {
- case '3':
- $card_type = 'AMEX';
- break;
- case '4':
- $card_type = 'Visa';
- break;
- case '5':
- $card_type = 'MasterCard';
- break;
- case '6':
- $card_type = 'Discover';
- break;
- }
- $request_params = [
- 'METHOD' => 'DoDirectPayment',
- 'USER' => $api_username,
- 'PWD' => $api_password,
- 'SIGNATURE' => $api_signature,
- 'VERSION' => $api_version,
- 'PAYMENTACTION' => 'Sale',
- 'IPADDRESS' => $_SERVER['REMOTE_ADDR'],
- 'CREDITCARDTYPE' => $card_type,
- 'ACCT' => $billFields['card_number'],
- 'EXPDATE' => $billFields['month'] . $billFields['year'],
- 'CVV2' => $billFields['security_id'],
- 'FIRSTNAME' => $billFields['first_name'],
- 'LASTNAME' => $billFields['last_name'],
- 'STREET' => $billFields['address1'],
- 'CITY' => $billFields['city'],
- 'STATE' => $billFields['state'],
- 'COUNTRYCODE' => $billFields['country'],
- //'ZIP' => $billFields['zip'],
- 'AMT' => number_format(
- $cart_price_for_card,
- 2,
- '.',
- ''
- ),
- 'CURRENCYCODE' => 'EUR',
- 'DESC' => 'Order ' . $account_id
- ];
- $nvp_string = '';
- foreach($request_params as $var => $val)
- {
- $nvp_string .= '&' . $var . '=' . urlencode(
- $val
- );
- }
- //echo $nvp_string;
- $curl = curl_init();
- curl_setopt(
- $curl,
- CURLOPT_VERBOSE,
- 1
- );
- curl_setopt(
- $curl,
- CURLOPT_SSL_VERIFYPEER,
- false
- );
- curl_setopt(
- $curl,
- CURLOPT_TIMEOUT,
- 30
- );
- curl_setopt(
- $curl,
- CURLOPT_URL,
- $api_endpoint
- );
- curl_setopt(
- $curl,
- CURLOPT_RETURNTRANSFER,
- 1
- );
- curl_setopt(
- $curl,
- CURLOPT_POSTFIELDS,
- $nvp_string
- );
- $result = curl_exec($curl);
- if(curl_errno($curl))
- {
- //echo "cURL error number:" .curl_errno($ch)." / cURL error:" . curl_error($ch);
- curl_close($curl);
- }
- else
- {
- curl_close($curl);
- }
- //echo $result;
- $NVPString = $result;
- $nvp_response_array = parse_str(
- $result
- );
- $payment_result = [];
- while(strlen($NVPString))
- {
- $keypos = strpos(
- $NVPString,
- '='
- );
- $keyval = substr(
- $NVPString,
- 0,
- $keypos
- );
- $valuepos = strpos(
- $NVPString,
- '&'
- ) ? strpos(
- $NVPString,
- '&'
- ) : strlen($NVPString);
- $valval = substr(
- $NVPString,
- $keypos + 1,
- $valuepos - $keypos - 1
- );
- $payment_result[$keyval] = urldecode(
- $valval
- );
- $NVPString = substr(
- $NVPString,
- $valuepos + 1,
- strlen(
- $NVPString
- )
- );
- }
- switch($payment_result['ACK'])
- {
- case 'Success':
- $response_array[0] = 1;
- break;
- case 'Failure':
- $response_array[0] = 2;
- break;
- case 'SuccessWithWarning':
- $response_array[0] = 3;
- break;
- case 'FailureWithWarning':
- $response_array[0] = 4;
- break;
- }
- $response_array[3] = $payment_result['ACK'];
- }
- }
- else
- {
- $response_array[0] = 1;
- }
- }
- }
- //$response_array[ 0 ]=1;
- if($response_array[0] == 1)
- {
- // successfuly paid
- if($subscription_paid == 1)
- {
- $account = get_fields(
- $accounts_table,
- " WHERE `id`='" . $account_id . "';"
- );
- $account['status'] = $account['status'] | 2;
- if(exec_sql(
- "UPDATE `" . $accounts_table . "` SET `status`='" . $account['status'] . "' WHERE `id`='" . $account_id . "';"
- ))
- {
- include "chek.php";
- ######################### проверка номеров абонементов
- include "ticket_send.php";
- ###############
- if(empty($tickets_numbers))
- {
- if(!empty($shipFields['email']))
- {
- $subject = preg_replace(
- [
- '/\[order\]/i',
- '/\[name\]/i',
- '/\[domain\]/i',
- '/\[sum\]/i',
- ],
- [
- $account_id,
- $shipFields['last_name'] . ' ' . $shipFields['first_name'],
- $uri['domain'],
- number_format(
- $account['mc_gross'],
- 2,
- '.',
- ' '
- ),
- ],
- $settings['order_subject']
- );
- $letter = preg_replace(
- [
- '/\[order\]/i',
- '/\[name\]/i',
- '/\[domain\]/i',
- '/\[sum\]/i',
- '/\[check\]/i',
- ],
- [
- $account_id,
- $shipFields['last_name'] . ' ' . $shipFields['first_name'],
- $uri['domain'],
- number_format(
- $account['mc_gross'],
- 2,
- '.',
- ' '
- ),
- $check,
- ],
- nl2br(
- $settings['order_text']
- )
- ) . "\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion(
- );
- if(@mail(
- $shipFields['email'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- }
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars(
- $shipFields['last_name']
- );
- $i = htmlspecialchars(
- $shipFields['first_name']
- );
- $street1 = htmlspecialchars(
- $shipFields['address1']
- );
- $street2 = htmlspecialchars(
- $shipFields['address2']
- );
- $city = htmlspecialchars(
- $shipFields['city']
- );
- $state = htmlspecialchars(
- $shipFields['state']
- );
- $email = htmlspecialchars(
- $shipFields['email']
- );
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars(
- $shipFields['phone1']
- );
- // админу
- $subject = "New order on site (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Paid with the card</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion(
- );
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- if(!empty($is_abon_subscribe) && $is_abon_subscribe > 0)
- {
- exec_sql(
- "UPDATE `" . $accounts_table . "` SET `subscribe`='1' WHERE `id`='" . $account_id . "';"
- );
- //send admin message about new subscription!!!
- if(!empty($settings['administratorEmail']))
- {
- $subject = "New subscription order on site (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Subscription!!!</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion(
- );
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- }
- // Чистим корзину
- $_SESSION['cart'] = [];
- $_SESSION['post'] = [];
- $_SESSION['order_details'] = $account_id;
- if(empty($tickets_numbers))
- {
- $out['payment_type'] = $payment_type;
- $out['html'] = '<form name="PaymentOkForm" action="" method="post"><input type="hidden" name="paymentOk" value="' . $account_id . '" /></form>';
- $out['form_name'] = 'PaymentOkForm';
- $out['error'] = 0;
- }
- else
- {
- $out['payment_type'] = $payment_type;
- $out['html'] = '<form name="PaymentOkForm" action="" method="post"><input type="hidden" name="paymentOkTicket" value="' . $tickets_number_mail . '" /></form>';
- $out['form_name'] = 'PaymentOkForm';
- $out['error'] = 0;
- }
- }
- }
- else
- {
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars(
- $shipFields['last_name']
- );
- $i = htmlspecialchars(
- $shipFields['first_name']
- );
- $street1 = htmlspecialchars(
- $shipFields['address1']
- );
- $street2 = htmlspecialchars(
- $shipFields['address2']
- );
- $city = htmlspecialchars(
- $shipFields['city']
- );
- $state = htmlspecialchars(
- $shipFields['state']
- );
- $email = htmlspecialchars(
- $shipFields['email']
- );
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars(
- $shipFields['phone1']
- );
- // админу
- $subject = "New order on site - not paid (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site - not paid (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion(
- );
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- $out['errorString'] = 'Error';
- $out['error'] = 3;
- $_SESSION['cart_error'] = 1;
- }
- }
- else if($response_array[0] == 2)
- {
- // no payed this order
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars($shipFields['last_name']);
- $i = htmlspecialchars(
- $shipFields['first_name']
- );
- $street1 = htmlspecialchars(
- $shipFields['address1']
- );
- $street2 = htmlspecialchars(
- $shipFields['address2']
- );
- $city = htmlspecialchars($shipFields['city']);
- $state = htmlspecialchars($shipFields['state']);
- $email = htmlspecialchars($shipFields['email']);
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars(
- $shipFields['phone1']
- );
- // админу
- $subject = "New order on site - not paid (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site - not paid (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion();
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- $out['error'] = 2;
- $_SESSION['cart_error'] = 1;
- }
- else if($response_array[0] == 3)
- {
- // error generated
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars($shipFields['last_name']);
- $i = htmlspecialchars(
- $shipFields['first_name']
- );
- $street1 = htmlspecialchars(
- $shipFields['address1']
- );
- $street2 = htmlspecialchars(
- $shipFields['address2']
- );
- $city = htmlspecialchars($shipFields['city']);
- $state = htmlspecialchars($shipFields['state']);
- $email = htmlspecialchars($shipFields['email']);
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars(
- $shipFields['phone1']
- );
- // админу
- $subject = "New order on site - not paid (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site - not paid (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion();
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- $out['errorString'] = $response_array[3];
- $out['error'] = 3;
- $_SESSION['cart_error'] = 1;
- }
- else
- {
- // unknown return error code
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars($shipFields['last_name']);
- $i = htmlspecialchars(
- $shipFields['first_name']
- );
- $street1 = htmlspecialchars(
- $shipFields['address1']
- );
- $street2 = htmlspecialchars(
- $shipFields['address2']
- );
- $city = htmlspecialchars($shipFields['city']);
- $state = htmlspecialchars($shipFields['state']);
- $email = htmlspecialchars($shipFields['email']);
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars(
- $shipFields['phone1']
- );
- // админу
- $subject = "New order on site - not paid (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site - not paid (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion();
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- $out['error'] = 4;
- $_SESSION['cart_error'] = 1;
- }
- }
- else if($payment_type == 2)
- {
- // PayPal Payment
- // Генерим имя хоста для ответного запроса
- $host = $uri['protocol'] . '://' . ((!empty($uri['language']['current']['urlname'])) ? $uri['language']['current']['urlname'] . '.' : '') . $uri['domain'];
- // In this project, do not use the phone
- $phone_array = [];
- $phone = str_pad(
- preg_replace('#[^0-9]+#i', '', $shipFields['phone1']),
- 10,
- " ",
- STR_PAD_LEFT
- );
- for($i = 0; $i < 3; $i++)
- {
- $phone_array[] = trim(
- substr(
- $phone,
- -1 - ((3 - $i) * 3),
- $i == 2 ? 4 : 3
- )
- );
- }
- ////////!!!!!!!!!!!!!!!!!!!!!!/////
- $_SESSION['not_paid_paypal_s'] = '1'; //add this for listing
- $_SESSION['paypal_notpaid_order'] = $account_id;
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $_SESSION['not_paid_paypal']['f'] = $shipFields['last_name'];
- $_SESSION['not_paid_paypal']['i'] = $shipFields['first_name'];
- $_SESSION['not_paid_paypal']['street_1'] = $shipFields['address1'];
- $_SESSION['not_paid_paypal']['street_2'] = $shipFields['address2'];
- $_SESSION['not_paid_paypal']['city'] = $shipFields['city'];
- $_SESSION['not_paid_paypal']['state'] = $shipFields['state_prefix'];
- $_SESSION['not_paid_paypal']['mail'] = $shipFields['email'];
- ////////!!!!!!!!!!!!!!!!!!!!!!/////
- $paypalFields = [
- "cmd" => "_xclick",
- "business" => $settings["pp_account_email"],
- // Receiver
- "lc" => "US",
- "button_subtype" => "services",
- "no_note" => 1,
- "no_shipping" => 1,
- "rm" => 2,
- "return" => $host . '/payapl_ok',
- "cancel_return" => $host . $module_cart['url'] . "?ro=" . $account_id,
- "notify_url" => $host . "/ajax/paypal.php",
- // сюда PayPal сделает запрос о подтвержении оплаты
- "currency_code" => $currency_todb,
- "item_name" => "Payment for services on the site " . $uri['domain'],
- "item_number" => $account_id,
- "amount" => number_format($cart_total, 2, '.', ''),
- // Сумму обязательно указываем именно в таком формате
- "first_name" => $shipFields['first_name'],
- "last_name" => $shipFields['last_name'],
- "address1" => $shipFields['address1'],
- "address2" => $shipFields['address2'],
- "city" => $shipFields['city'],
- "state" => $shipFields['state_prefix'],
- "zip" => $shipFields['zip'],
- "email" => "",
- "night_phone_a" => $phone_array[0],
- "night_phone_b" => $phone_array[1],
- "night_phone_c" => $phone_array[2],
- //"cpp_headerback_color" => "E5E5E5",
- //"cpp_headerborder_color" => "E5E5E5",
- //"cpp_payflow_color" => "E5E5E5",
- ];
- // Чистим корзину
- $_SESSION['cart'] = [];
- $_SESSION['post'] = [];
- $postData = '<form name="PayPalForm" action="' . $settings['pp_redirect_ssl_url'] . '" method="post">' . "\r\n";
- foreach($paypalFields as $field => $value)
- {
- $postData .= '<input type="hidden" name="' . $field . '" value="' . htmlspecialchars(
- $value
- ) . '" />' . "\r\n";
- }
- $postData .= '</form>';
- $out['payment_type'] = $payment_type;
- $out['html'] = $postData;
- $out['form_name'] = 'PayPalForm';
- $out['error'] = 0;
- }
- else if($payment_type == 5)
- {
- $price = $cart_total;
- $count = 1;
- // Мыльники отправим тогда когда получим от Yandex подтверждение об оплате см. /ajax/yandex.php
- $cart_total_y = number_format(($price * $count), 2, '.', '');
- $yandex_total = number_format(
- ($cart_total_y * $settings['rur_course_yandex'] + (($cart_total_y * $settings['rur_course_yandex']) * 0.005)),
- 2,
- ".",
- ""
- );
- //print number_format( ( $price * $count ), 2, '.', '' );
- $postFields = [
- "receiver" => $settings['yd_key'],
- "formcomment" => "Пополнение счета Kartina-Tv",
- "short-dest" => "Kartina-Tv",
- "writable-targets" => "false",
- "quickpay-form" => "shop",
- "targets" => "Пополнение счета Kartina-Tv",
- "label" => $account_id,
- "sum" => $yandex_total,
- // Сумму обязательно указываем именно в таком формате
- ];
- $_SESSION['cart'] = [];
- $_SESSION['post'] = [];
- $postData = '<form name="YandexForm" action="https://money.yandex.ru/quickpay/confirm.xml" method="post">' . "\r\n";
- foreach($postFields as $field => $value)
- {
- $postData .= '<input type="hidden" name="' . $field . '" value="' . htmlspecialchars(
- $value
- ) . '" />' . "\r\n";
- }
- $postData .= '</form>';
- $out['payment_type'] = $payment_type;
- $out['html'] = $postData;
- $out['form_name'] = 'YandexForm';
- $out['error'] = 0;
- }
- else
- {
- $account = get_fields(
- $accounts_table,
- " WHERE `id`='" . $account_id . "';"
- );
- $account['status'] = $account['status'] | 3;
- exec_sql(
- "UPDATE `" . $accounts_table . "` SET `status`='" . $account['status'] . "' WHERE `id`='" . $account_id . "';"
- );
- if(!empty($settings['administratorEmail']))
- {
- if(empty($shipFields['address2']))
- $shipFields['address2'] = '';
- $f = htmlspecialchars($shipFields['last_name']);
- $i = htmlspecialchars($shipFields['first_name']);
- $street1 = htmlspecialchars($shipFields['address1']);
- $street2 = htmlspecialchars($shipFields['address2']);
- $city = htmlspecialchars($shipFields['city']);
- $state = htmlspecialchars($shipFields['state']);
- $email = htmlspecialchars($shipFields['email']);
- $address = htmlspecialchars(
- $shipFields['city'] . ' ' . (!empty($shipFields['state_prefix']) ? $shipFields['state_prefix'] : $shipFields['state']) . ', ' . $shipFields['zip']
- );
- $phone = htmlspecialchars($shipFields['phone1']);
- // админу
- $subject = "New order on site (" . $uri['domain'] . ")";
- $letter = "<br>";
- $letter .= "<h2>New order on site (" . $uri['domain'] . ")</h2>\r\n";
- $letter .= "<h2>Paid with the card</h2>\r\n";
- $letter .= "<h2>Order #" . $account_id . "</h2>\r\n";
- $letter .= "<p><b>First name</b>: " . $i . "</p>\r\n";
- $letter .= "<p><b>Last name</b>: " . $f . "</p>\r\n";
- $letter .= "<p><b>Street</b>: " . $street1 . "</p>\r\n";
- $letter .= "<p><b>Street2</b>: " . $street2 . "</p>\r\n";
- $letter .= "<p><b>City</b>: " . $city . "</p>\r\n";
- $letter .= "<p><b>State</b>: " . $state . "</p>\r\n";
- $letter .= "<p><b>Address</b>: " . $address . "</p>\r\n";
- $letter .= "<p><b>Phone</b>: " . $phone . "</p>\r\n";
- $letter .= "<br>----\r\n";
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
- //$headers .= "From: Kartina-tv <no-reply@kartinatv.ru>\r\n";
- $headers .= "From: no-reply@kartinatv.ru\r\n";
- //$headers .= "From: no-reply@".$uri['domain']."\r\n";
- //$headers .= "Reply-To: info@".$uri['domain']."\r\n";
- $headers .= "X-Mailer: PHP/" . phpversion();
- if(@mail(
- $settings['administratorEmail'],
- $subject,
- $letter,
- $headers
- )
- )
- {
- }
- }
- // Чистим корзину
- $_SESSION['cart'] = [];
- $_SESSION['post'] = [];
- $out['html'] = '<form name="PaymentOkForm" action="" method="post"><input type="hidden" name="paymentOk" value="' . $account_id . '" /><input type="hidden" name="paymentOklayaway" value="1" /></form>';
- $out['form_name'] = 'PaymentOkForm';
- $out['error'] = 0;
- }
- }
- else
- {
- $out['shipFields'] = $shipFields;
- $out['shipErrors'] = $shipErrors;
- $out['billFields'] = $billFields;
- $out['billErrors'] = $billErrors;
- $out['error'] = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement