Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

300
Visualizações
Failed to load resource: the server responded with a status of 406 ()

I am trying to integrate Stripe payment gateway in spring boot project. I am getting error from client side, I don't know why. I am using STS IDE.

Below is the checkout form:

             <div class="checkout">
                <form id="checkoutform" class="form" autocomplete="off">
                    <h4>Pay With Card</h4>
                    <!-- A Stripe Element will be inserted here. -->
                    <div id="payment-element"></div>
                    <button class="btn" id="submit" type="submit">
                        <i class="fa fa-lock"></i>Pay Now
                    </button>
                    <div id="error-message">
                        <!-- Display error message to your customers here -->
                    </div>
                </form>
                <div id="messages" role="alert" style="display: none;"></div>
               </div>
      <script src="https://js.stripe.com/v3/"></script>
      <script src="public/web/js/userpayment.js" defer></script> 

Below is the script for checkout page:

document.addEventListener('DOMContentLoaded', async () => {
debugger
    // Load the publishable key from the server. The publishable key is set in your .env file.
    const {publishableKey} = await fetch('api/config').then((r) => r.json());
    if (!publishableKey) {
        addMessage(
            'No publishable key returned from the server. Please check `.env` and try again'
        );
        alert('Please set your Stripe publishable API key in the .env file');
    }

    const stripe = Stripe(publishableKey, {
        apiVersion: '2020-08-27',
    });

});

Below is my payment controller:

@RequestMapping(value = {ApiUrl.apiConfig}, method = {RequestMethod.GET}, produces = {MediaType.APPLICATION_JSON_VALUE})
    public ResponseEntity<?> config() {
        
        return new ResponseEntity<>(new ConfigResponse(stripePublishableKey), HttpStatus.OK);
    }

I don't know why I am getting this error.

Screenshot to show error

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda