#hackbandito
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Have you looked at the defer intent approach already?
https://stripe.com/docs/payments/accept-a-payment-deferred
It allows you to collect payment method information prior to creating a PaymentIntent. That way you only create a PaymentIntent if the customer clicks on "Pay" and successfully completes the order
Will this work with Link? Last time I checked, for the link functionality to work there needs to be a payment intent
You mean Link payment method, correct?
Ah okay yes, that's link payment method type. Hang on, let me check if the defer intent apporach supports link
Ah looks like Link isn't currently supported by defer intent flow.
If you don't want these PaymentIntents to be in incomplete status then the alternative would be to cancel them after a certain period of time by calling the cancel API
https://stripe.com/docs/api/payment_intents/cancel
Ah okay, i'll have to fix link later i guess. Do you know what the difference is between mode on the ElementsProvider ? The docs states there are 3 different values, but not the difference between for example payment and setup
payment mode is when you're collecting payment method to process a payment (with PaymentIntents)
setup mode is for when you're collecting payment method info to save it and use it later on (with SetupIntents)
Thanks! I am trying it out, but PaymentElement and AddressElement is only rendering out empty divs. What can cause this?
Are you seeing any errors in your console?
None
Can you share the code you're running?
<Elements
stripe={stripePromise}
options={{
// loader: 'auto',
// clientSecret: paymentIntent,
mode: 'payment',
currency: 'nok',
amount: 1,
// appearance: appearance,
}}
>
<PaymentElement
options={{
layout: 'accordion',
wallets: {
applePay: 'auto',
googlePay: 'auto',
},
}}
/>
<AddressElement
options={{
mode: 'shipping',
allowedCountries: ['no'],
fields: {
phone: 'always',
},
}}
/>
Can you share the complete file? ๐
Also the amount is below the minimum supported amount for nok currency
https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts:~:text=RM 2-,NOK,3.00-kr.,-NZD
Try a different/larger amount than 3.00-kr
Cant share rest of the file due to work stuff.
But upping the amount made an error show: "No valid payment method types for this configuration. Please ensure that you have activated. Checking stripe dashboard now
๐
The amount prop is in cents, so I set it to 300, seems to work now
Awesome, glad you got it working
Thanks!
Anything else I can help with?
Not for now, thanks!