#RubyDev
1 messages ยท Page 1 of 1 (latest)
Hi there, as explained in the error message, id is not a valid parameter for PaymentLink creation API.
@tender pawn if I pass price: it's saying wrong parameter price, I remove it totally it's saying Missing required param: line_items[0][id].
You can use the example code here, the price ID is to be passed to the line_items array
Can you share with me the code?
Okay so you mean it should be inside line items array
line_items: [{
price: stripe_price_id,
quantity: num_quantity,
adjustable_quantity: {
enabled: true,
minimum: quantity_minimum,
maximum: quantity_maximum
}
}]
btw I'm updating
@tender pawn
This looks good to me, can you try again?
Can you share with me the complete code?
Okay sure
Ah, I see the problem
you are updating a paymentlink, not creating one, that's why the ID is needed
yep I told you already I'm updating
stripe_payment_link = Stripe::PaymentLink.update(stripe_payment_link_id, link_hash, {:stripe_account => site.stripe_user_id} )
Then you should first retrieve the PaymentLink and expand the line_item fields so that the line_items are included in the response.
sorry it's 3 times
Once you have the ID, use the ID to update the item in line_items with PaymentLink update API.
I have ID of payment link
passing here stripe_payment_link = Stripe::PaymentLink.update(stripe_payment_link_id, link_hash, {:stripe_account => site.stripe_user_id} )
No, it's the ID of the item in the line_items
Okay