#maks.piechota

1 messages · Page 1 of 1 (latest)

grand estuaryBOT
grave crag
#

Hey! Which event(s) are you using?

narrow wolf
#

so far, invoice.paid for checkout session only

#

but now I want to add payment link

#

for non-users

#

so if they pay, I want to create a new account for them

grave crag
#

Otherwise you'd probably need to set some subscription_data[metadata] which would be present on invoice.paid events

grand estuaryBOT
narrow wolf
#

ok but does checkout.session.completed mean that the invoice is paid

#

or I need to somehow check first webhook

#

and then wait for the another

#

and I guess they can come in reversed order right? (i.e. invoice.paid first)

snow agate
narrow wolf
#

i dont understand

#

in some cases, then the customer pays (like its not the first payment of a subscription) then the invoice is not used?

snow agate
#

Invoices are a specific API object and integration in Stripe yes, not all payments use them. It depends what exactly you're using the PaymentLink to pay for.

narrow wolf
#

how can I pay for something

#

and not get the invoice?

snow agate
#

An Invoice is not the same thing as a 'receipt', maybe that's your confusion.

snow agate
# narrow wolf and not get the invoice?

you can just process a PaymentIntent directly, for example. Invoices are not a core part of every payment API at Stripe, they're a specific object and product for specific types of payment. So I'd take a step back a little, I'm not sure how I can add clarity here.

narrow wolf
#

ok

#

so how do I ensure

#

that if I create payment link

#

within stripe dashboard

#

for specific product (subscprition)

#

the customer will get his invoice

snow agate
#

well if you're using Subscriptions then every payment will be processed via an Invoice.

narrow wolf
#

ok

#

you said that the first payment

#

for subscription

#

has invoice

narrow wolf
#

ok

#

so the payment link

#

will trigger the same invoice.paid

#

event

#

and I cannot differentiate if it comes from my created checkout session or from the external payment link?

snow agate
narrow wolf
#

Stripe payment link feature

#

how can I explain your own features

snow agate
#

be polite please.

#

as for differenciating, I think it's possible but will be a little tricky/fiddly, let me think.

#

I suppose the most sensible way would be

Some other options like saving the CheckoutSession ID in your database after you create them, which means you could skip that last check and instead check if you recognise the ID. Or adding subscription_data[metadata] when you create CheckoutSessions which your system can understand to mean "I created this", and checking for the presence of that.

Or you could not really care about the differenciation and just fulfill the subscription, it depends on the use case.