#Zigi - Mobile App

1 messages · Page 1 of 1 (latest)

lyric gust
#

Hello! Can you tell me more about your app? What language are you writing it in? What platforms does it support?

royal pine
#

Yes sure, I am using react native
It is a classic e-commerce flow
Customer chooses a product, sends to the server, my BE creates a paymentIntent, retrieves secret to customer

#

Customer then renders the react native widget with the payment intent client secret

lyric gust
royal pine
#

yes

lyric gust
#

In that case there should be no need to redirect the customer out of your app except in some cases where they need to provide authentication directly to their bank/card issuer. Is that what you're asking about?

royal pine
#

I am not sure, I am asking if paymentIntent is the correct way to go

#

Or maybe, what is the best practice for doing this flow?

#

Customer selects item -> BE receives the ID -> calls stripe with item + fees + tax and such -> customer pays -> customer gets detailed invoice

#

I am not sure that paymentIntent is the way to go as it does not work with "line items"
So maybe the correct way is using the checkout object?

lyric gust
royal pine
#

Okay, and after creating the invoice, what should I return to the customer in order for the app to render the correct card payment form?

#

Is it finalized on the spot? And creates a payment intent on the spot?

#

"About an hour after creation, Stripe finalizes the invoice. (You can no longer make any changes to it.)"
Saw this on the doc - invoice lifecycle

lyric gust
#

You can finalize them via the API. Invoices do create Payment Intents, yes.

royal pine
#

I see

lyric gust
royal pine
#

So create an invoice in the draft state, finalize it, send payment intent secret to customer

#

After the customer pays, an invoice receipt will be sent to them

lyric gust
royal pine
#

I see

#

Okay

lyric gust
#

Backing up a bit, what's your overall goal?

royal pine
#

Will try that

#

Enable the customer to pay inside the mobile app, get a detailed invoice upon payment

#

The full amount needs to be added with service fee on the BE

lyric gust
#

How do you want them to get the detailed Invoice? Email?

royal pine
#

Yea

lyric gust
#

You can also do this with Payment Intents directly, but you would need to handle the line items/emails entirely on your end.

royal pine
#

I see,
Okay thanks

#

Just 2 questions:

  1. After creating the invoice, is there a way not to send it to the customer before the payment? Only after receipt? The payment is done on my native app, I do not need to send it before customer completed payment
#
  1. How do I get the payment intent client secret to pass to the client after creating the invoice?
#

By pulling the payment intent via the API?

lyric gust
#

If you don't set collection_method to send_invoice Stripe won't send the Invoice to the Customer.

#

You would then get and use the client secret from the Payment Intent the same way you would if you weren't using Invoices.

royal pine
#

Oh okay great