#stefan_code

1 messages ยท Page 1 of 1 (latest)

torn forumBOT
wintry ravenBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

torn forumBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1256207632482701414

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

naive arch
#

Share the code please

prime kite
#

async onConfirm(event: StripeExpressCheckoutElementConfirmEvent) {
const { expressPaymentType, paymentFailed } = event;
console.log(event);

// this is a reference to the stripe elements object
const stripe = this.stripe.getInstance();


// You can only call `paymentFailed` before calling `confirmPayment` to signal
// an error before payment confirmation.
    const { error, confirmationToken } = await stripe!.createConfirmationToken({
      elements: this.expressCheckout.elements,
      params: {
        return_url: 'https://bonfi-sk.ngrok.dev/order/123/complete'
      }
    });
    console.log(confirmationToken);
const value: any = await this.http.post(environment.apiUrl + '/stripe-checkout/' + this.checkoutTransactionState?.id + '/express', confirmationToken).toPromise();
stripe!
  .confirmPayment({
    clientSecret: value.clientSecret,
    elements: this.expressCheckout.elements,
    confirmParams: {
      confirmation_token: confirmationToken!.id,
      return_url: 'https://ngx-stripe.dev'
    }
  }).then(result=>{
    console.log(result)
  });
#

this is with ngx

#

this is with stripe.js directyle

#

directly

naive arch
prime kite
#

i did

#

if you look at the previous conv

#

you will see that it's called when i mounted the ECE directly with stripe.js

naive arch
#

What is this onConfirm function? I don't see any evidence of you listening for the .on('confirm') event?

#

If this is specific to that library then you'll need to reach out to them for help โ€“ its' not a Stripe official lib

prime kite
#

this comes from the ngx-stripe.dev

#

it is being called when i click the apple pay button

#

im reporting this here, as it's the same error im getting when not using the ngx library

#

when i use stripe.js directly - same error

#

exactly the same 'on confirm'

#

IMHO, ECE is not working at all in angualar

naive arch
#

Maybe, but we don't officially support Angular for reasons stated by my colleague earlier (and hence why there's a third-party lib)

#

In any case, I'd recommend you write in to my team as this will require that we take a deeper look at what's going on (beyond the remit of this server really): https://support.stripe.com/contact/email?topic=api_integration

prime kite
#

alright

#

thanks anyway

#

one question before this closes

#

if i were to include a page that contains the ECE in vanilla JS via an iframe, would that work?

naive arch
prime kite
#

it would be the same domain, it will be just a file that is included

naive arch
#

Yep, just flagging the additional checks you need to be mindful of for wallets with an iframe