#jamesr9118

1 messages · Page 1 of 1 (latest)

raven stratusBOT
near wolf
#

hi! it depends on the exact area. Prices represent the item/product/service you're selling, as a structured object with extra data and information, which allows for richer checkout experiences and easier reporting. Some APIs require you to pass a Price(like creating a Subscription), for some they require them but you can create the Price "ad-hoc" at the time of calling the API(like Checkout), and some APIs are more basic(like creating a raw PaymentIntent) and don't accept Prices at all.

#

in general we recommend using Prices everywhere it's possible to do so

bronze parcel
#

You mean Price ID as generated by stripe?

near wolf
bronze parcel
#

Yes I recognise that, have created a product in the dashboard. but I prefer the stripe ui in my app.

#

$paymentIntent = $stripe->paymentIntents->create([
'amount' => 2000,
'currency' => 'sgd',
'automatic_payment_methods' => ['enabled' => true], // for sdg includes PayNow
// 'payment_method_types' => ['card'], // has limited payment options
]);

near wolf
#

yeah unfortunately as I said, raw PaymentIntents don't accept Prices

#

only things like Checkout/Subscriptions/Invoices do

bronze parcel
#

This work in my embedded stripe elements

near wolf
#

if you're using a raw PaymentIntent + Elements you have to manually pass the amount and currency(you could read those from your Price object and pass them through if you want)

bronze parcel
#

Yes, or I could do that with my own database and shopping cart and pass the final amount at checkout, right?

near wolf
#

yep, you could

bronze parcel
#

What is the disadvantage? Billing would be cryptic?

near wolf
#

mainly it's just that the reporting experience on Stripe doesn't "know" what customers are actually buying

#

since all we know are the raw amounts

bronze parcel
#

Can I add more product data in this $stripe->paymentIntents->create() method in addition to just amount?

near wolf
#

no

bronze parcel
#

Hmm ...

near wolf
#

you can add metadata if you want, but I don't think Stripe will use that for anything, but it can make your own reporting easier if you pull data from the API later

#

really I don't know much about the details of how the reports or any of that stuff works, we don't focus on that type of question on Discord

#

also, I have to run but my colleague @glass palm will take over

bronze parcel
#

thank you.

#

$paymentIntent = $stripe->paymentIntents->create([
'amount' => 2000,
'currency' => 'sgd',
'automatic_payment_methods' => ['enabled' => true], // for sdg includes PayNow
// 'payment_method_types' => ['card'], // has limited payment options
]);

glass palm
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

bronze parcel
#

in this code, can I use 'price' => 'price_xxxxx'?

near wolf
#

no

#

as I said, raw PaymentIntents don't accept Prices (sorry to jump back in, but I did already answer that 🙂 )

bronze parcel
#

Ok, just clarifying. Thank again.

#

That's all for now. Regards.