#MMunir-dynamic-product
1 messages · Page 1 of 1 (latest)
Hi 👋 it's used for creating a product dynamically rather than relying on a pre-existing one.
any example shown in video
or githhub
let's say if one is using product data so how will the pram be used will it be blank
No, it probably won't be blank when you try to use it. It is shown in use in snippets in several of our docs, here are a couple examples:
https://stripe.com/docs/payments/accept-a-payment
https://stripe.com/docs/payments/checkout/migrating-prices
i want two product with one grand price is it possible?
Product A
Product B
10$
like i dont want to define individual price
or can one product has 0 price
Are you still designing your integration?
yes need to be specific in detail so that my customer doesn't get confused
http://bigdunestours.com/grid-test.html
try this product page, i can have product name as private or shared morning safari but what about atv ,my customer might get confused if atv is included or not and we dont charge seperate price for it
its like if i want to add atv i need to price it and which i dont want to name a price for it
A lot of this is up to how you want to structure your flows and pricing, that's a business decision and up to you, but we can help you understand how to map that into Stripe once you know.
i want the main product name as private morning safari but want to show that atv is included with price 0 or no price at all it shpould be mentioned
$app->post('/checkout_sessions', function(Request $request, Response $response) use ($app) {
$params = json_decode($request->getBody());
$payment_method_types = [
'usd' => ['card'],
'eur' => ['alipay'],
'cad' => ['card']
];
$products = [
'private morning safari' & 'with Atv' => 'pr27383002',
];
i tried using this & but didnt work like if pram is getting private morning safari and atv as string from json so use this product
'line_items' => [[
'price_data' => [
'currency' => 'aed',
'product' => $products[
$params->occupancy,
$prams->atv
],
'unit_amount' => $params->amount,
],
'quantity' => 1,
]],
this was the line item
I'm sorry, but I'm not sure what you're trying to accomplish. That first snippet appears to be you defining a route to an endpoint on your server, and the second looks like you setting some values for line_items.
Are you trying to walk through this doc?
https://stripe.com/docs/payments/accept-a-payment
https://www.youtube.com/watch?v=FOLRATK4pVA
what i am trying to is follow this guide but little changes like cause and cause 2 both be selected and i define pram in php that if cause a and cause x is selected product name should be cause a and cause x
In this livestream, I answered a request from one of our users to show how to take variable amount donations with Stripe Checkout using php. We use the price_data attribute to create Price objects on the fly.
We show how to use metadata, accept different currencies, and talked a bit about associating an existing Stripe customer object with ne...
I'm not familiar with exactly what that video demonstrates. My suggestion is that you work through the example to get a single product scenario working, and then go back and build your conditional logic into that once you have a better grasp of the flow.