#PERF
1 messages · Page 1 of 1 (latest)
according to the typescript definition it doesn't exist.
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?
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.
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
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
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?
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 />
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
We have a payment_method_options hash where you can set options per payment method. So you can set setup_future_usage: offline for just cards https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ah amazing! This would only be regarding new cards correct?
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?
the second
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.
yea
@silver parcel What does "yea" mean? That was an either-or question
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
Have you run tests for this already? What behavior are you seeing on your test integration?
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
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
if you use whats described in https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage will that only affect new card payment methods and not google or apple pay?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No, because the card payment method type encompasses both regular card payments, and also the wallet payments (e.g. G-Pay and Apple Pay)