#hackbandito

1 messages ยท Page 1 of 1 (latest)

cosmic meteorBOT
spring yew
#

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

livid portal
#

Will this work with Link? Last time I checked, for the link functionality to work there needs to be a payment intent

spring yew
#

You mean Link payment method, correct?

livid portal
#

Link, as in the STripe link. That autofills information about the customer

spring yew
#

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

livid portal
#

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

spring yew
#

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)

livid portal
#

Thanks! I am trying it out, but PaymentElement and AddressElement is only rendering out empty divs. What can cause this?

spring yew
#

Are you seeing any errors in your console?

livid portal
#

None

spring yew
#

Can you share the code you're running?

livid portal
#
    <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',
                                            },
                                        }}
                                    />
spring yew
livid portal
#

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

spring yew
#

๐Ÿ‘

livid portal
#

The amount prop is in cents, so I set it to 300, seems to work now

spring yew
#

Awesome, glad you got it working

livid portal
#

Thanks!

spring yew
#

Anything else I can help with?

livid portal
#

Not for now, thanks!