#bb8t_error

1 messages ยท Page 1 of 1 (latest)

fathom ferryBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1293192896874287147

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

manic surge
#

hi there!

cedar spindle
#

Hello!

#

I am sending the videos, brb

manic surge
#

how are you accepting payments? Checkout Session, Payment Element, something else?

cedar spindle
#

react native with paymentsheet

manic surge
#

can you send the full error message and the code that is throwing that error? the code you shared in your original message has been truncated.

cedar spindle
#

on it

#
    paymentMethod,
    shouldSavePaymentMethod,
    intentCreationCallback
  ) => {
    stripeCheckout(
      {
        orderId: orderData.orderId,
        paymentMethod: {
          ...paymentMethod,
        },
        returnUrl: linkingUrl,
        savePaymentMethod: shouldSavePaymentMethod,
      },
      {
        onSuccess: ({ clientSecret }) => {
          intentCreationCallback({ clientSecret });
        },
        onError: (error) => {
          intentCreationCallback({
            error: {
              code: 'Failed',
              message: getResponseErrorMessages(error, 'response.data.errors.base[0]'),
              localizedMessage: getResponseErrorMessages(error, 'response.data.errors.base[0]'),
            },
          });
        },
      }
    );
  };``` confirmHandler
#
    await initPaymentSheet({
      style: 'alwaysLight',
      customerId: orderData.payments.customerId,
      customerEphemeralKeySecret: orderData.payments.ephemeralKey,
      appearance: {
        colors: {
          componentText: '#333333',
          icon: '#000000',
          placeholderText: '#8C8C8C',
          primary: '#19B6C1',
          secondaryText: '#666666',
        },
        primaryButton: {
          shapes: {
            borderRadius: 24,
          },
          colors: {
            background: '#E84358',
            border: '#E84358',
          },
        },
      },

      applePay: {
        merchantCountryCode: 'US',
      },
      googlePay: {
        merchantCountryCode: 'US',
        testEnv: config.ENVIRONMENT !== 'production',
      },

      merchantDisplayName: 'Better Off',
      intentConfiguration: {
        mode: {
          amount: orderData.payments.amountInCents,
          currencyCode: 'USD',
        },
        confirmHandler: confirmHandler,
      },
      returnURL: linkingUrl,
    });

    const { error } = await presentPaymentSheet();

    if (error) {
      onPaymentError();
      Bugsnag.notify(new Error('Stripe PaymentSheet error'), (event) => {
        event.addMetadata('details', {
          orderId: orderData.orderId,
          errorMessage: JSON.stringify(error),
        });
      });
    } else {
      queryClient.invalidateQueries('getActionItems');
      queryClient.invalidateQueries('getEventRegistrations');
      queryClient.invalidateQueries('getEventRegistrationDetails');
      queryClient.invalidateQueries('getEvents');
      queryClient.invalidateQueries('getEventDetails');
      sendAnalyticsEvent({
        event_type: 'purchase',
        order_id: orderData.orderId,
      });
      setNextOrderStep();
    }
    return;
  };
``` - init & show paymentSheet
#

stripeCheckout post mutation with backend response - clientSecret or error

manic surge
#

thanks! having a look...

cedar spindle
fathom ferryBOT
crisp hare
#

hey there, was looking at this with soma and they need to step away

#

Not really sure what's happening here, but its not even clear its a Stripe SDK error vs RN SDK/platform issue causing there error/disconnect. Do you have an actually error capture from that sequence showing the raw error type/message thrown?

#

It's also not clear what the difference is between the two video sequences. One seems to work like you expect and the other fails, yes, but are there reproducible condition differences between them?.

cedar spindle
#

Sure!
The "success" video - our stripeCheckout method and backend returns status 200 with clientSecret.
The other one returns status 403 - event has been closed before payment so this endpoint returns error status

#

It works well with card payment, the error from stripeCheckout is beeing displayed under the card fields
It works well with applepay when stripeCheckout method returns 200 and clientSecret

crisp hare
#

I suspect this is not originating in the stripe SDK but can't be certain based on the details availble, so a minimal reproduction without anything else involved is the ideal path

cedar spindle
#

ok ๐Ÿ˜ฆ
The reporduction steps are

  • init & open the paymentsheet
  • during that change backend response of request which returns clientSecret - it must return error 404/500etc
  • press applepay button
  • app is beeing crashed
    Are you able to check that before I create a ticket?
crisp hare
#

I mean, create a new RN project without other dependencies in play, just the Stripe SDK, and implement a barebones app that creates this scenario with a few dependencies as possible (ideally only requiring putting in a PK and being able to hardcode any client secrets etc).