ajax加载页面中的x_october_redirect

时间:2018-08-03 14:24:37

标签: octobercms

我遇到X_OCTOBER_REDIRECT问题,我收到200则正常消息,但页面未重定向 以下是代码

  if ($order->paymentGateway) {
     $url = $this->controller->pageUrl($order->paymentGateway->payment_page, [ 'slug' => $order->getSlug()] );

        return Redirect::to($url);
    }
    else {
        return Redirect::to("404");
    }

此代码基本上可以正常运行,但是当我在jkskhop插件的order.php部分中使用一类sms expettexting时,

   $expertTexting =  new \Jiri\JKShop\Classes\experttexting_sms(); 

在发送电子邮件的下方区域,我遇到了无法重定向的问题。

{"X_OCTOBER_REDIRECT":"http:\/\/amazfit.bikesalepurchase.com\/custom-payment-cash-delivery\/5b646ab62f866-48"}

基本上我想随电子邮件一起发送短信 这是我的order.php代码

public function onOrderStatusChange($newOrderStatus, $prevOrderStatus) {

    $jkshopSetting = \Jiri\JKShop\Models\Settings::instance();


    if (isset($newOrderStatus)) {
        // prepair data
        $data = [];
        $data["first_name"] = $this->is_first_name;
        $data["last_name"] = $this->is_last_name;
        $data["order_id"] = $this->id;
        $tracking_url = ($this->carrier) ? $this->carrier->tracking_url : "";
        $tracking_url = str_replace("@", $this->tracking_number , $tracking_url);
        $data["tracking_url"] = ($this->tracking_number != null && $this->tracking_number != "") ? $tracking_url : "";

        // send email
        if ($newOrderStatus->mail_template != null) {
            Mail::send($newOrderStatus->mail_template->code, $data, function($message) use ($jkshopSetting, $newOrderStatus) {

                $message->to($this->contact_email);

                if ($jkshopSetting->copy_all_order_emails_to != "") {
                    $message->bcc($jkshopSetting->copy_all_order_emails_to);
                }

                // attach invoice?
                if (($newOrderStatus->attach_invoice_pdf_to_email) && ($this->invoice != null)) {
                    $message->attach($this->invoice->getLocalPath(), ['as' => "invoice-".$this->id.".pdf"]);
                }
            });  
          // here is my code for the sms from exporttexting and when i use this code it shows the x_october_redirect problem
 $expertTexting =  new \Jiri\JKShop\Classes\experttexting_sms(); 

    //sending sms
    if(isset($this->orderstatus)){

         if ($this->orderstatus->mail_template != null) {
             $expertTexting->from    = 'DEFAULT';

             // The full international mobile number without the + or 00
           $expertTexting->to      = 'xxxxxxx';

            // The SMS content.
            $expertTexting->msgtext = $this->orderstatus->mail_template->content_text;      

            // Use the below method to sent simple text //.
            // Uncomment the line below to run this call.
             echo $expertTexting->send();  

       }
    }        

}

0 个答案:

没有答案