#taylan-pl

1 messages · Page 1 of 1 (latest)

quartz trail
#

Hey, how can I help?

neat hull
#

$x = $stripe->products->create([
'name' => 'Taylan',
])->toArray();

$y = $stripe->prices->create([
'currency' => 'usd',
'product' => $x['id'],
'custom_unit_amount' => [
"maximum" => null,
"minimum" => null,
"preset" => null,
],
'unit_amount' => [],
])->toArray();

#

Request req_0W8AJ0zNyQhm8I) Invalid integer:

quartz trail
#

You can't pass null to those parameters

#

They need to be integers. If you don't want to set them, just don't pass them (they're optional)

neat hull
#

Error Prices require an unit_amount or unit_amount_decimal parameter to be set.\n thrown in

quartz trail
#

Can you share the req_xxx?

neat hull
#

req_izlfx2EnbsIVAw

quartz trail
#

You need something like this:

stripe->prices->create([
        'currency' => 'usd',
        'product' => $x['id'],
        'custom_unit_amount' => [
            'enabled' => true
        ]
neat hull
#

okey let me try

#

yess thank you

#

can I embed this page to my site?

quartz trail
#

In an iframe?

neat hull
#

like a checkout page I don't prefer iframe

#

so the customer doesn't have to click the payment link generated

quartz trail
neat hull
#

can I make it customizable

quartz trail
neat hull
#

the amount

quartz trail
#

Yes, that'd be set on the Payment Intent you create

neat hull
#

I see that I need to set an amount

#

which is static, I don't understand where I can make it client side

barren scaffold
#

Hi! I'm taking over this thread.

#

You want to create a PaymentIntent, but use a price coming from the frontend?

neat hull
#

Well I've set 2 things

#

Basicly I want to have 1 page where client can enter the amount and I collect the money

#

without a product if possible

#

like a donation

barren scaffold
#

Then yes you would add an input field on your frontend to collect the amount, send that to your backend and create a PaymentIntent for that amount, then confirm the PaymentIntent on the frontend.

neat hull
#

okey thanks

#

apart from creating a product what is bad with the second option

#

because second option I don't have to create anything on frontend stripe take cares of that