Виконується переадресація
$method='document.insurance.save';
$save = _insuranceSave($_POST);
$save = insur_sendXML( $save , $method);
//file_put_contents( FULL_PATH . '/bus_cache/insurance_save.xml' , $save );
//$save = file_get_contents( FULL_PATH . '/bus_cache/insurance_save.xml' );
$save = new SimpleXMLElement($save);
//print_r( $save );
//die;
if (!isset( $save->error->text ) ) {
$wpdb->show_errors();
$wpdb->tablename = $table_prefix . 'insur_paym';
if ( false === $wpdb->insert( $wpdb->tablename, array( "order_number"=>(string)$save->transaction->insurance,
"sum"=>(string)$save->transaction->price,
"buyer"=> $_POST["insurer"]["last-name"] . " " . $_POST["insurer"]["first-name"] /* . " " . $_POST["insurer"]["middle-name"] */,
"program" => (int)$save->transaction->program,
"phone"=> $_POST["insurer"]["phone"],
"mail" => $_POST["insurer"]["e-mail"] ),
array ( "%s", "%f", "%s", "%s", "%s" ))) {
if ( $wp_error ) {
return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb->last_error );
} /* else {
return 0;
} */
}
include_once( $_SERVER['DOCUMENT_ROOT']."/wp-content/themes/custom_themes/includes/class.liqpay.php");
$liqpay = new LiqPay( "i34121819070", "b5VEd9Cngov6egRE3JIhmOue7PDsd9kMhvxzWud1" );
$html = $liqpay->cnb_form(array(
'version' => '3',
'amount' => (string)$save->transaction->price,
'currency' => "UAH", //Можно менять 'EUR','UAH','USD','RUB','RUR'
'description' => "Oplata strahovogo polisa " .(string)$save->transaction->insurance, //Или изменить на $desc
'order_id' => (string)$save->transaction->insurance,
'sandbox' => "1" , // ТЕСТОВА
'server_url' => "http://kag.ua/requests/lp_status.php" . "?id=" . (string)$save->transaction->insurance ."&lang=" . ICL_LANGUAGE_CODE ,
'result_url' => get_page_link( 650 ). "?id=" . (string)$save->transaction->insurance ."&lang=" . ICL_LANGUAGE_CODE
));
echo $html;
} else {
echo "" . $save->error->code ." : " . $save->error->text . "
";
}
?>