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

250
Views
¿Cómo cerrar la interfaz de pago si el pago falla en Stripe Google pay?

Necesita cerrar la interfaz de pago si el pago falla. Ahora muestra un error en lugar de cerrar. ingrese la descripción de la imagen aquí

 paymentRequest.on('paymentmethod', function(ev) { console.log('ev response',ev) that.accountService.makePaymentIntent(totAmt).then((data)=>{ console.log("Promise resolved with: " + JSON.stringify(data)); let clientSecret = data.data.client_secret; // Confirm the PaymentIntent without handling potential next actions (yet). stripe.confirmCardPayment( clientSecret, {payment_method: ev.paymentMethod.id}, {handleActions: false} ).then(function(confirmResult) { console.log('confirmResult',confirmResult); if (confirmResult.error) { // Report to the browser that the payment failed, prompting it to // re-show the payment interface, or show an error message and close // the payment interface. ev.complete('fail'); } else { // Report to the browser that the confirmation was successful, prompting // it to close the browser payment method collection interface. ev.complete('success'); // Check if the PaymentIntent requires any actions and if so let Stripe.js // handle the flow. If using an API version older than "2019-02-11" // instead check for: `paymentIntent.status === "requires_source_action"`. if (confirmResult.paymentIntent.status === "requires_action") { // Let Stripe.js handle the rest of the payment flow. stripe.confirmCardPayment(clientSecret).then(function(result) { console.log('confirmCardPayment result',result); if (result.error) { // The payment failed -- ask your customer for a new payment method. } else { that.orderComplete(confirmResult, ev); } }); } else { // The payment has succeeded. that.orderComplete(confirmResult, ev); } } }); }).catch((error)=>{ ev.complete('success'); console.log("Promise rejected with " + JSON.stringify(error)); that.orderFailed(error); }); });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No es posible hacer esto: el navegador controla el comportamiento de la hoja de solicitud de pago para Google/Apple Pay. En Chrome, cuando le informa al navegador que el pago falló (llamando a ev.complete('fail') ), muestra un mensaje y no cierra la hoja. Me temo que eso no es algo en lo que tengas alguna forma de influir.

about 4 years ago · Juan Pablo Isaza Report

0

puede usar ev.complete('success') en lugar de ev.complete('fail')

about 4 years ago · Juan Pablo Isaza Report
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!