#PERF

1 messages · Page 1 of 1 (latest)

wise axleBOT
woeful summit
#

PERF

#

It should work

#

What's the issue you're seeing?

silver parcel
#

according to the typescript definition it doesn't exist.

wise axleBOT
old pumice
#

Gotcha. Is that producing a specific error or is it more of a warning but the code can still run?

#

Are you able to use other things from Stripe.js or are all of them showing up as not defined?

silver parcel
#

other methods work. I just didn't know what to pass to the method since there is no docs on it.

I get the following error

IntegrationError: You cannot call `stripe.updatePaymentIntent` without supplying an appropriate beta flag when initializing Stripe.js.
old pumice
#

Oh I did not realize that that was part of a beta. Are you currently in a beta that uses that call or did you see the call in some doc of ours?

#

If this is for a beta, the beta team should have given you a contact email and they would be the best ones to ask about this. We mostly know about generally available functionality on this server

silver parcel
#

Unsure about beta status, but I was just looking at the existing methods on the stripe value from useStripe in search of a way to update an existing payment intent

#

found that and ran into this

old pumice
#

Gotcha. So to take a step back: what are you currently trying to do overall? Like what are you trying to update the payment intent with?

silver parcel
#

So to my current understanding, the react-native stripe library when confirming a payment intent via the confirmPaymentSheetPayment method from usePaymentSheet import by @stripe/stripe-react-native will automatically add a newly entered payment method if it is a card.

However in the equivalent method confirmPayment from useStripe imported by @stripe/react-stripe-js it does not. I wanted to update the payment intent's setup_future_usage to off_session only if that new card information is filled out in the <PaymentElement />

old pumice
#

Is that to say you only want to set that setting if they are using a card to pay? I think we actually have a setting for that on the payment intent itself that you can use

silver parcel
#

ah amazing! This would only be regarding new cards correct?

old pumice
#

As in "Will stripe recognize duplicates and not create a new PaymentMethod object?" or "Will stripe set up a card for future usage if I pass in its PaymentMethod ID to the confirm call and it was not set up before?"

#

Or something else entirely?

silver parcel
#

the second

old pumice
#

Good question. Will check in to that and get back to you.

#

I am still having trouble finding info on this. Asking my colleagues

#

To clarify, do you want a previously saved card to also be saved for offline usage here? Or are you trying to avoid it? I am assuming offline setup is the desired outcome but just wanted to double check.

wise axleBOT
silver parcel
#

yea

paper ember
#

@silver parcel What does "yea" mean? That was an either-or question

silver parcel
#

oh sorry lol

#

I only want to save a card for off_session if it new. So for example of someone uses apple or google pay i don't want to add it to the customer

paper ember
#

Have you run tests for this already? What behavior are you seeing on your test integration?

silver parcel
#

when setting setup_future_usage to off_session on payment intent creation then confirming that payment intent on the web with

const stripe = useStripe()
...
stripe.confirmPayment({
 elements,
})

while google pay is selected makes the credit card that used with google pay save to the stripe customer's payment methods

paper ember
#

I believe that's expected and I don't think you can change that. You could retroactively go back and make sure the defaults are set to other Payment Methods, but I don't think you can get around using those for off_session payments without attaching them to the customer

silver parcel
paper ember
#

No, because the card payment method type encompasses both regular card payments, and also the wallet payments (e.g. G-Pay and Apple Pay)