#B33fb0n3

1 messages · Page 1 of 1 (latest)

soft hollyBOT
exotic needle
#

You cannot use the retrieve endpoint to get more than one price. You use the List endpoint to return multiple prices

alpine stone
#

Hm ok. Do you know, How I can do the following:
The customer choose a custom product with some extras. In this example we say the Customer buy ice cream online. He choose a default product with a Price and take the extra „schoclate saurce“. In the frontend I deal with the PriceIds, so the Customer cannot modify the Price. I want to use my frontend (so no Stripe checkout), but Need to create a paymentintent to get the payment Elements. To create a payment intent, I cannot Just say „take these PriceIds and make a paymentintent.“ I Need to say the specific price. If I now request every amount from each priceId it would be very inefficant. How do I resolve this Problem with the Stripe api?

exotic needle
#

I'm sorry but I find that wording very confusing. Why don't you know the correct PriceID at the time of creating a Payment Intent?

#

Also Payment Intents do not use Price IDs

#

So what does your integration look like?

alpine stone
exotic needle
#

So how are you using Stripe APIs here?

alpine stone
alpine stone
exotic needle
#

How are you charging your customer?

alpine stone
exotic needle
#

Yes that is true

alpine stone
#

So How do I resolve this Problem?

exotic needle
alpine stone
#

I know, but I want to use a Custom checkout

exotic needle
#

Okay so how about Invoicing? An invoice generates a Payment Intent you can use to render a Payment Element on your own site and uses Price IDs.

alpine stone
exotic needle
#

The one I shared earlier

alpine stone
#

Ah. The customer get in each case an email with the invoice?

exotic needle
alpine stone
#

Ok, so I can choose, if I send an invoice (than Stripe checkout process) or Not to send (than I have the paymentintent thought the invoice creation and can use it), Right?

exotic needle
#

I'm sorry I'm totally lost by that statement. You can choose whether to send emails or not in your Dashboard settings. You can also use whichever API (Checkout, Invoice) best suits your use case. They are independent of each other.

alpine stone
#

But where do I get the payment intent via the PriceIds to create the payment Elements?

exotic needle
#

You don't get the Payment Intent via the Price ID

#

If a user selects an item that has a Price ID, your server would then create an Invoice object which would include a Payment Intent

alpine stone
exotic needle
#

You use that payment_intent.client_secret to render the Payment Element

alpine stone
exotic needle
#

Okay so you select multiple items and pass those back to your server. Then you create the Invoice and expand the Payment Intent parameter by including the expand: ['payment_intent'] in your call to create the Invoice: https://stripe.com/docs/api/expanding_objects
This would return an Invoice object with the payment_intent.client_secret property you can return to your front-end

alpine stone
#

Ah got it. So no emails to the Customer, Right?

exotic needle
#

That depends on your customer email settings

alpine stone
#

Ok, would the Customer be confused, if he get a Mail, but paid directly on the page and also get the „you paid“- Email?

exotic needle
#

That would be up to you

#

I can only offer help with the Stripe API questions

alpine stone
#

Ah ok. The api For the invoice will also accept productIds and than choose the default priceid if a Customer choose a product?

exotic needle
#

No. I think you will need to carefully review our Invoice docs to make sure the behavior is what you want first.

alpine stone
#

Ah ok. But multiple PriceIds maybe with multiple quantitis are possible, Right?

gray cairn
#

👋 stepping in as Snufkin needs to step away

#

Yes multiple Prices with different quantities is supported

alpine stone
#

Ah perfect. I gonna Test this integration tomorror. If I have further questions, than Just find this thread and reopen it, Right? 🙂