簡體   English   中英

發生404錯誤找不到頁面。 路由無法匹配請求的URL。 沒有例外

[英]A 404 error occurred Page not found. The requested URL could not be matched by routing. No Exception available

我已經使用條紋文檔在我的網站上實現了條紋系統

https://stripe.com/docs/tutorials/checkout

我已經做了付款文件和收費文件。

這是付款文件的代碼

    <div class="panel-body">
        <form action="in/payment/charge.phtml" method="POST">
          <script
            src="https://checkout.stripe.com/checkout.js" class="stripe-button"
            data-key="xxxxxxxxxxxxxxxxxxx"
            data-image="logo.png"
            data-name="abc.com"
            data-description="EBS($750.00)"
            data-amount="75000">
          </script>
        </form> 
    </div>

此外,收費文件的代碼包括try catch子句。

     <?php

try {
  require_once('Stripe/lib/Stripe.php');
  Stripe::setApiKey("secret_key_here"); //Secret Key

  $charge = Stripe_Charge::create(array(
  "amount" => 750,
  "currency" => "usd",
  "card" => $_POST['stripeToken'],
  "description" => "Charge for Events Plan Subscription."
 ));
    //send the file, this line will be reached if no error was thrown above
    echo "<h1>Your payment has been completed. You have Subscribed to Events Basic Plan</h1>";


//you can send the file to this email:
echo $_POST['abc@gmail.in'];
}
//catch the errors in any way you like

 catch(Stripe_CardError $e) {

 }


 catch (Stripe_InvalidRequestError $e) {
 // Invalid parameters were supplied to Stripe's API

 } catch (Stripe_AuthenticationError $e) {
 // Authentication with Stripe's API failed
 // (maybe you changed API keys recently)

} catch (Stripe_ApiConnectionError $e) {
  // Network communication with Stripe failed
} catch (Stripe_Error $e) {

// Display a very generic error to the user, and maybe send
// yourself an email
} catch (Exception $e) {

// Something else happened, completely unrelated to Stripe
}
?>

單擊卡付款后,它將立即顯示條紋彈出窗口。 但輸入詳細信息並按“付款”按鈕后不久,顯示404頁並顯示以下消息:

A 404 error occurred 
Page not found.  
The requested URL could not be matched by routing. 
No Exception available

我是zend框架的新手。 我已經在module.config.php中進行了必要的路由更改。

        return array(
'router' => array(
'routes' => array(
       'rpayment' => array(
                'type'    => 'Segment',
                'options' => array(
                        'route'    => 'payment[/:action[/]]',
                        'constraints' => array(
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                        ),
                        'defaults' => array(
                                '__NAMESPACE__' => 'Webin\Controller',
                               'controller' => 'Payment',
                                'action' => 'index',
                        ),
                ),
        ),

我不知道我哪里錯了? 任何人都可以指出錯誤嗎?

這是正確的路徑嗎?

require_once('Stripe/lib/Stripe.php');

網站的根目錄中的文件夾中是否有條帶? 我最近在這樣的一個小地方上花費了太多時間。 我必須在Stripe / lib / Stripe.php的前面添加../

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM