Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
¿Cómo configuro la ruta en una API de búsqueda?

Estoy intentando implementar stripe en mi proyecto. El siguiente código es de la integración de Stripe para asp.net MVC. Pero no tengo MVC, es un proyecto de páginas de afeitar de asp.net core 5. Así que estoy modificando el código para adaptarlo a la maquinilla de afeitar.

Este es el guión.

 // A reference to Stripe.js initialized with a fake API key. const stripe = Stripe("abc"); // The items the customer wants to buy const items = [{ id: "Art Works" }]; let elements; initialize(); checkStatus(); document .querySelector("#payment-form") .addEventListener("submit", handleSubmit); // Fetches a payment intent and captures the client secret async function initialize() { const response = await fetch('./?handler=create', { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ items }), }); const { clientSecret } = await response.json(); const appearance = { theme: 'stripe', }; elements = stripe.elements({ appearance, clientSecret }); const paymentElement = elements.create("payment"); paymentElement.mount("#payment-element"); }

Este parece ser el código ofensivo "const response = await fetch('./?handler=create'", sé que la URL de búsqueda es incorrecta.

Este es el controlador que estoy tratando de buscar en la página detrás de index.cshtml

 public IActionResult OnPostCreate(PaymentIntentCreateRequest request) { var paymentIntentService = new PaymentIntentService(); var paymentIntent = paymentIntentService.Create(new PaymentIntentCreateOptions { Amount = CalculateOrderAmount(request.Items), Currency = "AUD", PaymentMethodTypes = new List<string> { "card", }, }); return new JsonResult(new { clientSecret = paymentIntent.ClientSecret }); }

Cualquier ayuda sería apreciada Gracias.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!