Неожиданная ошибка связи с Stripe.Если проблема не устранена, сообщите нам по адресу support@stripe.com - PullRequest
0 голосов
/ 08 апреля 2019

Я пытаюсь реализовать полосу в моем проекте symfony 3.4, но получаю эту ошибку:

Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com.

(Network error [errno 92]: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1))

Эта часть кода полосы в моем действии контроллера:

    public function viewPostAction(){
      \Stripe\Stripe::setApiKey("sk_test_JKYj1WMuOsnaD5nOXiAYaPXr
");

\Stripe\Charge::create([
  "amount" => 2000,
  "currency" => "usd",
  "source" => "tok_visa", // obtained with Stripe.js
  "description" => "Charge for jenny.rosen@example.com"
]);

    $post = $this->getDoctrine()->getRepository('AppBundle:Post')->findAll();
        return $this->render("pages/index.html.twig",['post' => $post]);
    }

Это полоса HTML-формы:

  <form  method="post" id="payment-form">
  <div class="form-row">
    <label for="card-element">
      Credit or debit card
    </label>
    <div id="card-element">
      <!-- A Stripe Element will be inserted here. -->
    </div>

    <!-- Used to display Element errors. -->
    <div id="card-errors" role="alert"></div>
  </div>

  <button>Submit Payment</button>
</form>

Может кто-нибудь помочь мне решить эту проблему?

...