#nikunj-karolia_webhooks

1 messages ยท Page 1 of 1 (latest)

rotund pewterBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1476194454489661502

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

elfin oak
#

๐Ÿ‘‹ Hi there! Let me take a look

#

What happens when you run that command?

#

Is that the exact command you're running? I see that it says inovice instead of invoice in the override

thin moon
#

stripe trigger invoice.paid
--override invoice:customer=cus_neonexiss_test
--override invoice:amount_paid=2900
--override invoice:lines.data[0].price.id=price_fixed_plan
--override invoice:lines.data[0].quantity=1
--override invoice:lines.data[0].amount=1900
--override invoice:lines.data[1].price.id=price_usage_metered
--override invoice:lines.data[1].quantity=100
--override invoice:lines.data[1].amount=1000

#

this is the actual stripe cli command

elfin oak
#

OK, and what problem are you having?

thin moon
#

Trigger failed: Request failed, status=400, body={
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameters: lines, amount_paid",
"param": "lines",
"request_log_url": "https://dashboard.stripe.com/acct_1R3uXtID9tx75xrh/test/workbench/logs?object=req_m9XQx20md9Ku3t",
"type": "invalid_request_error"
}
}

But THe invoice Object had the values lines and amount_paid don't know how to use it

Review the list of error codes Stripe might return in an API response so you can handle responding to them in your integration.

elfin oak
#

Thanks. The trigger command is first creating an Invoice object, so it can then be paid. But there is no amount_paid parameter when creating an Invoice, and that's what you can see if you look at the request log URL

#

But you don't want to just use stripe trigger invoice.paid on its own? You need those specific details in the invoice?

thin moon
#

okay so how to do it

#

yes see I want to test real subscription data as test get exact details that will come using the webhook so It could be handled safely

elfin oak
#

If you want to see what exact events you would see for a Subscription Invoice, then you should create a Subscription in a sandbox/testmode

thin moon
#

so instead of trigger I should use fixtures correct but fixtures will use test mode correct ?

elfin oak
#

Yes, fixtures will run by default in testmode

#

You said you want to see real subscription data, to test your webhook endpoint. The best way to do that is to create a Subscription in testmode, as that will generate the real events for the Subscription and its invoices

thin moon
#

okay got it, thanks