#MMunir-dynamic-product

1 messages · Page 1 of 1 (latest)

still flame
#

Hi 👋 it's used for creating a product dynamically rather than relying on a pre-existing one.

vale totem
#

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

still flame
vale totem
#

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

still flame
#

Are you still designing your integration?

vale totem
#

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

still flame
#

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.

vale totem
#

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

still flame
#

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

Securely accept payments online.

vale totem
#

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...

â–¶ Play video
still flame
#

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.