#harcon_api

1 messages ยท Page 1 of 1 (latest)

rotund runeBOT
#

๐Ÿ‘‹ 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/1268127754319040575

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

knotty viperBOT
#

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.

rotund runeBOT
fringe surge
#

Here is the code I added after talking to support last week, again - it is no longer getting called, but you can imagine why I thought it was causing the issue

  async enableRedisplay(customer, paymentMethodId) {
    const paymentMethod = await stripeLts.customers.retrievePaymentMethod(customer, paymentMethodId);
    console.log('paymentMethod', paymentMethod);

    if (paymentMethod && paymentMethod.allow_redisplay === 'unspecified') {
      const res = await stripeLts.paymentMethods.update(paymentMethodId, { allow_redisplay: 'always' });
      return res;
    }
  },
limber jay
#

๐Ÿ‘‹ happy to help

fringe surge
#

Thanks

limber jay
#

would you mind sharing the request IDs?

fringe surge
#

sure, give me a minute

#

pi_3PiXvDGyjGYV1j4Z0AYeDmHv

#

This was a payment intent that used apple pay and created a new card

limber jay
#

you're passing setup_future_usage: "off_session", when creating the PaymentIntent https://dashboard.stripe.com/test/logs/req_KHY6nu9JxQbzBz which is the reason why the confirmation request https://dashboard.stripe.com/test/logs/req_OReGlYQHhn9N4G is creating a new PM

#

actually wait I might be wrong give me a second

fringe surge
#

Apple pay should ignore setup_future_usage due to how it functions though, correct?

limber jay
#

would you mind sharing both Payment Method Ids that way I could better understand the workflow here?

fringe surge
#

Apple pay: pm_1PiXx9GyjGYV1j4Zclkpv354
Card that was created: pm_1PiXuNGyjGYV1j4Zq9gA8z7K

There is also a card that was created which has the same ID as the payment method used during the payment intent with apple pay

limber jay
#

taking a look

#

please give me a couple of minutes

fringe surge
#

take your time, understand it's a weird one

plush loom
fringe surge
#

I can't see anywhere we make a request to payment_methods - we should be letting stripe and the payment element/sheet handle that

plush loom
#

Could you please share the relevant frontend code?

fringe surge
#

Initializing payment sheet:

    const initializePaymentSheet = async () => {
      if (addedPaymentIntent.paymentResponse.type === 'payment_intent') {
        const { error } = await initPaymentSheet({
          merchantDisplayName: 'Zark Parking',
          customerId: addedPaymentIntent.paymentResponse.customer,
          customerEphemeralKeySecret: addedPaymentIntent.paymentResponse.ephemeralKey,
          paymentIntentClientSecret: addedPaymentIntent.paymentResponse.clientSecret,
          // Set `allowsDelayedPaymentMethods` to true if your business can handle payment
          //methods that complete payment after a delay, like SEPA Debit and Sofort.
          allowsDelayedPaymentMethods: true,
          defaultBillingDetails: {
            name: 'Jane Doe',
          },
          applePay: {
            merchantCountryCode: 'US',
          },
        });
        if (error) {
          console.error('ERROR:', error);
          setReservationError(error.message);
        }
      } else if (addedPaymentIntent.paymentResponse.type === 'setup_intent') {
        const { error } = await initPaymentSheet({
          merchantDisplayName: 'Zark Parking',
          customerId: addedPaymentIntent.paymentResponse.customer,
          customerEphemeralKeySecret: addedPaymentIntent.paymentResponse.ephemeralKey,
          setupIntentClientSecret: addedPaymentIntent.paymentResponse.clientSecret,
          // Set `allowsDelayedPaymentMethods` to true if your business can handle payment
          //methods that complete payment after a delay, like SEPA Debit and Sofort.
          allowsDelayedPaymentMethods: true,
          defaultBillingDetails: {
            name: 'Jane Doe',
          },
          applePay: {
            merchantCountryCode: 'US',
          },
        });
        if (error) {
          console.error('ERROR:', error);
          setReservationError(error.message);
        }
      }
    };

#

Here is where we check the payment was confirmed, and we send a req to our API to handle

  const openPaymentSheet = async () => {
    const { error } = await presentPaymentSheet();

    if (error) {
      Alert.alert(error.message);
    } else {
      const reservationId = addedPaymentIntent.pendingReservation.id;
      await handleReservationConfirm(reservationId, addedPaymentIntent.paymentResponse.paymentIntent);
    }
  };
plush loom
plush loom
fringe surge
#

and payed with apple pay

plush loom
fringe surge
#

yes for two separate reservations

#

each one creating a new card method from apple pay

plush loom
#

That's normal actually. Did you expect it would reuse the same PaymentMethod?

fringe surge
#

I would expect that apple pay obsfucates my card details enough that stripe doesnt create a new one, the whole purpouse of apple pay right?

#

I dont want my user seeing a new method every time they use apple pay

#

like it's creating new methods for the same card

plush loom
#

Not really. Choosing Apple Pay or any other payment method type is still bringing in a new PaymentMethod object externally to Stripe. You only reuse Stripe PaymentMethods when you charge them off-session. Otherwise a new one is always created.

fringe surge
#

yeah but it's creating multiple methods for the same card, that can't be correct

plush loom
fringe surge
#

so if my user makes 100 reservations with apple pay then they will see 100 of the same card in the element...

#

it might be expected but that's whack

plush loom
#

You can proactively delete the copies by fingerprint, or re-display the PMs, then they wouldn't need to use Apple Pay.

fringe surge
#

Is there somewhere that I can contact the product team to make feature requests

plush loom
fringe surge
#

I don't mean to be rude but I just don't understand why apple pay functions this way with stripe

#

it's a very bad user experience - when I use apple pay on any other service such as Uber eats for example, i don't see a new card created - especially not for the same card

#

Can you see why i'm frustrated?

#

That's all I need... thank you for your help

fringe surge
#

I'm working on a solution now where i'm trying to get a customers payment methods and delete the ones with the same fingerprint

#

but the method to list a customers payment methods doesn't return the finger print in the response....

#

am i using the wrong request?

gentle lance
#

what method/request are you using?

fringe surge
#

const paymentMethods = await stripe.customers.listPaymentMethods(customer);

gentle lance
#

then for example paymentMethods.data[0].card.fingerprint should have a value(assuming it's a type:"card" PaymentMethod), what do you actually see?

fringe surge
#

my bad I wasn't accessing the card object and couldn't see it in my logs

gentle lance