#michamitus_api

1 messages · Page 1 of 1 (latest)

north cobaltBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1298573006783905883

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

mint garnet
#

👋 happy to help

empty kiln
#

Unfortunately, no. There is a separate invoice system from which you get an invoice number and it must be set up based on that number

mint garnet
#

in that case you can simply update the invoice number https://docs.stripe.com/api/invoices/update#update_invoice-number by listening to the invoice.created webhookl event https://docs.stripe.com/billing/subscriptions/webhooks#understand

Learn to use webhooks to receive notifications of subscription activity.

empty kiln
#

The process works well for second and subsequent payments, but I’m encountering an issue with the first invoice. When creating a subscription using a pre-existing explicit PaymentIntent, the system automatically generates and finalizes the Invoice object, leaving no option to edit it.

I also tried using ScheduleSubscription. While payments and subscriptions were handled correctly, the invoice remained open and wasn’t linked to the completed payment.

I’m wondering if there’s a better way to implement this.

mint garnet
#

When creating a subscription using a pre-existing explicit PaymentIntent
why are you integrating this way?

empty kiln
#

To prevent the creation of unpaid first invoices and because of the need to edit the invoice

mint garnet
#

how are you creating the subscription?

#

actually how are you collecting the payment for the first invoice?

empty kiln
#

For the first payment I used: PaymentIntent
Then I created a subscription

mint garnet
#

how are you integrating?

empty kiln
#

Using python stripe library

mint garnet
#

I meant on the front-end

#

are you using the PaymentElement?

#

Are you using the deferred flow?

empty kiln
mint garnet
#

I think you should consider the deferred flow for your case

empty kiln
#

Does this integration support the p24 (Przelewy24) option that has BLIK?

"""This integration path doesn’t support BLIK or pre-authorized debits that use the Automated Clearing Settlement System (ACSS)."""

north cobaltBOT
sour oyster
#

what is " the p24 (Przelewy24) option that has BLIK" ? not familiar with that.

#

if it's like some "BLIK is actually inside/used in the P24 redirect" thing then I imagine it works fine, since it's abstracted as a type:"p24" PaymentMethod

empty kiln
#

Thanks

#

That what I meant

sour oyster
#

it is yes, the first invoice of a subscription always gets finalized immediaetly

#

it's a quirk and pain point that the first invoice works differently, as you've discovered

empty kiln
#

Is there a proper way to impement following scenario: Receive payment -> Create invoice marked as paid with custom number + start subscription

sour oyster
#

technically using a Schedule does work because for some reason Schedules create a draft invoice instead , but then it's a more complex integration. Should just work

#

like my colleague last night tried to help you with, it makes no sense to create your own PI, you should be using the Schedule->Subscription->latest_invoice->payment_intent->client_secret

sour oyster
#

like if you want, a possible flow is

  • create Schedule with start_date:now
  • edit the schedule->subscription->latest_invoice to change the number (since when using Schedules it will be a draft)
  • finalize the Invoice. Grab the invoice->payment_intent
  • on the frontend, confirm the PaymentIntent with Elements

that would be a more normal/supported flow here

empty kiln
#

Alright, thanks a lot for the clarification. I will have to talk to the team if this is appropriate.
If this is not a sufficient solution, is it possible to merge the created PaymentIntent with the invoice?

sour oyster
#

no, you can't attach a pre-existing PI to an Invoice

empty kiln
#

Okay, thank you very much for your help!

empty kiln
#

One more question: Is it possible to modify subscription items after the invoice has been finalized, such as by creating newer invoice with updated items?

sour oyster
#

no

#

if you new items to the subscription those are reflected in future invoices basically.
Depending on what you're looking for here you probably want to build the flow such that you handle all this "editing a cart/picking items etc" in your own logic and only create the Subscription on Stripe at the very end of the flow

empty kiln
#

Alrigth, thanks a lot again:)

north cobaltBOT