#.abishek

1 messages · Page 1 of 1 (latest)

lean tartanBOT
daring dagger
nova hinge
#

it looks like it defaults to the product name, will setting that affect what product name is shown on the checkout page?

daring dagger
#

The default value is product name, but if you set a custom value, it will display instead

nova hinge
#

will it take HTML or just plain text?

daring dagger
#

Should be plain text

nova hinge
#

receive this error Received unknown parameter: line_items[0][data]

daring dagger
#

Probably just som syntax issue? Could you share the full code?

nova hinge
#

This is what I am passing to create the checkout session

daring dagger
#

That syntax (0 => ...) is correct

#

Is that Node.js?

nova hinge
#

PHP

#

that is the var_dump of array data being passed

#

here is the json output of the array if this is helpful

{"success_url":"https:\/\/tdba2.test\/thank-you?session_id={CHECKOUT_SESSION_ID}","cancel_url":"https:\/\/tdba2.test\/programs\/membership-packages","line_items":[{"data":{"description":"Zyon Floyd - 15"},"price_data":{"currency":"usd","unit_amount":11800,"product":"prod_OgpGSNoCNM7VTu","recurring":{"interval":"month"}},"quantity":1},{"data":{"description":"Zyon Floyd - 15, Test - 12"},"price_data":{"currency":"usd","unit_amount":4410,"product":"prod_OgpGl5OrEtzf9r"},"quantity":2}],"mode":"subscription","client_reference_id":"aaf0c284-baa1-453d-990b-7618f3e346e1","customer":"cus_JleLRxju5KkjYP","consent_collection":{"terms_of_service":"required","promotions":"auto"},"custom_text":{"submit":{"message":"You additionally accept to the cancellation policy as documented here: .https:\/\/tdba2.test\/cancellation-policy"}},"metadata":{"cart_id":"aaf0c284-baa1-453d-990b-7618f3e346e1"}}
#

i feel like line_items.data is only a getter and not a setter

daring dagger
#
$stripe->checkout->sessions->create([
  'success_url' => 'https://example.com/success',
  'line_items' => [
    [
      'price' => 'price_H5ggYwtDq4fbrJ',
      'quantity' => 2,
    ],
  ],
  'mode' => 'payment',
]);
#

Let's try passing it like this

nova hinge
#

i am already doing that and that works fine

#

i want to pass additional data per line item and that is what I was initially asking about

lean tartanBOT
honest timber
#

Hello! I'm taking over and catching up...

daring dagger
#

Just remove data

#

and add description

nova hinge
#

ok

honest timber
nova hinge
#

ok, i am on the latest version of the API and I get this error when I try to create a session with description on the line_items

You cannot use `line_items.amount`, `line_items.currency`, `line_items.name`, `line_items.description`, or `line_items.images` in this API version. Please use `line_items.price` or `line_items.price_data`. Please see https://stripe.com/docs/payments/checkout/migrating-prices for more information.
#

looks like that is for older api versions

honest timber
#

Yep, that won't work, sorry. The guidance above about setting a description there was not correct.

nova hinge
#

and I am not using product_data because I have reference to the product_id on stripe

honest timber
#

Then you would need to change that Product's name.

nova hinge
#

ok ya, that won't work because my intention is not to change the product name, but show additional info for that product info. Our website does event registrations and I was hoping to show the name of the person registering for the each event on the checkout page

#

each event can have multiple users registering, so per lineitem can have multiple people.

#

so, looks like a no go. if you have any other suggestions of acheiving this, it would be helpful