#RubyDev

1 messages ยท Page 1 of 1 (latest)

silent edgeBOT
tender pawn
#

Hi there, as explained in the error message, id is not a valid parameter for PaymentLink creation API.

dim yacht
#

actually that is price I wanted to pass in?

#

so what should I pass price: ?

tender pawn
dim yacht
#

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

tender pawn
#

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?

dim yacht
#

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

tender pawn
#

This looks good to me, can you try again?

dim yacht
#

check this request req_D3ybiYqDasvAA9

#

still saying same thing

tender pawn
#

Can you share with me the complete code?

dim yacht
#

Okay sure

tender pawn
#

Ah, I see the problem

#

you are updating a paymentlink, not creating one, that's why the ID is needed

dim yacht
#

yep I told you already I'm updating

tender pawn
#

Then you should first retrieve the PaymentLink and expand the line_item fields so that the line_items are included in the response.

dim yacht
#

sorry it's 3 times

tender pawn
#

Once you have the ID, use the ID to update the item in line_items with PaymentLink update API.

dim yacht
#

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} )

tender pawn
#

No, it's the ID of the item in the line_items

dim yacht
#

Okay