#taylan-pl
1 messages · Page 1 of 1 (latest)
Hello I've created this link
https://buy.stripe.com/test_6oEcNo4dO3fZeS4aEE
by ui, how can I replicate this on api
$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:
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)
Error Prices require an unit_amount or unit_amount_decimal parameter to be set.\n thrown in
Can you share the req_xxx?
req_izlfx2EnbsIVAw
You need something like this:
stripe->prices->create([
'currency' => 'usd',
'product' => $x['id'],
'custom_unit_amount' => [
'enabled' => true
]
custom_unit_amount.enabled is required: https://stripe.com/docs/api/prices/create?lang=python#create_price-custom_unit_amount-enabled
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
In an iframe?
like a checkout page I don't prefer iframe
so the customer doesn't have to click the payment link generated
That's an entirely different integration that you'd need to build yourself: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
can I make it customizable
Which part? The Element, sure: https://stripe.com/docs/elements/appearance-api
the amount
Yes, that'd be set on the Payment Intent you create
I see that I need to set an amount
which is static, I don't understand where I can make it client side
Hi! I'm taking over this thread.
You want to create a PaymentIntent, but use a price coming from the frontend?
Well I've set 2 things
fumelsoftware.com/divinc/divinc_stripe.php?email=example@example.com
this is where I create payment intent and when customer enters amount I just update the payment intent amount
I've created payment link like this
https://buy.stripe.com/test_5kAeVwcKk7wfaBOdQS
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
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.