#dizzydizz1101_webhooks

1 messages ยท Page 1 of 1 (latest)

azure oliveBOT
#

๐Ÿ‘‹ 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/1265920151665119275

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

candid timberBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

river crow
#

it continues from the webhooks 19 hours ago

#

we want to test a webhoook for charge.dispute.created with our subscripiton models and struggle with the fixtures to trigger the webook with the right data in the cli

#

everything else is working but we are alwys stuck at this part

#

{
"name": "subscription_items",
"path": "/v1/subscription_items",
"method": "get",
"params": {
"subscription": "${subscription:id}"
}
},
{
"name": "usage_record",
"path": "/v1/subscription_items/${subscription_items:[0].id}/usage_records",
"method": "post",
"params": {
"quantity": 10,
"timestamp": "now"
}
},

#

tells us allways No such subscription item: '${subscription_items:[0].id} no matter how we try to get the subscription item

native bluff
river crow
#

sure req_cktNV3RJMY7Vwm

native bluff
#

Looks like you are passing "${subscription_items:[0].id}" string as the subscription item ID

#

I believe ${subscription_items:[0].id} is a variable that carry the ID of the subscription item.

river crow
#

i mean you see the fixture above also

#

where i use it in the path of the usage record. so we also think it is a variable, but how do we then integrate it in the fixutre path of the usage record

#

we could not find anything in the stripe doctumatnion how to handle a var or "wildcard" in the path for usage records for fixturesw

native bluff
#

OK, what Stripe CLI command did you use trigger the event? are you using the latest version of Stripe CLI

river crow
#

stripe fixtures /path to file

#

stripe version 1.21.0

native bluff
#

OK, is the purpose is to trigger a charge.dispute.created event, I'd suggest you to create a payment with these test cards https://docs.stripe.com/testing#disputes

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

river crow
#

unfortunately i can not send you the complete fixture caus it complains it is to long

#

bet we alredy use the test cards

#

{
"_meta": {
"template_version": 0
},
"fixtures": [
{
"name": "test_clock",
"path": "/v1/test_helpers/test_clocks",
"method": "post",
"params": {
"frozen_time": 1596840000,
"name": "Test clock for subscription"
}
},
{
"name": "customer",
"path": "/v1/customers",
"method": "post",
"params": {
"name": "New Customer",
"email": "new_customer@example.com",
"metadata": {
"created_by": "Stripe CLI"
}
}
},
{
"name": "product",
"path": "/v1/products",
"method": "post",
"params": {
"name": "Sample Product",
"type": "service"
}
},
{
"name": "price",
"path": "/v1/prices",
"method": "post",
"params": {
"product": "${product:id}",
"unit_amount": 2000,
"currency": "eur",
"recurring": {
"interval": "month",
"usage_type": "metered"
}
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_createDisputeProductNotReceived/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},

azure oliveBOT
crimson pewter
#

๐Ÿ‘‹ I'm taking over this thread, catching up now

river crow
#

hi river ๐Ÿ‘‹

crimson pewter
#

Checking what is the correct syntax to get the subscription item ID

river crow
#

thanks.. if it helps we also tried to add a "subscription_item_retrieve" step inbetween to "get" the subscripiton id to make sure we having it but seemed also not to work

crimson pewter
#

Can you try to use {subscription_items:data.0.id}?

river crow
#

sure one secion without the dollar sign?

crimson pewter
#

Sorry that I missed it out. Dollar sign should be included! ${subscription_items:data.0.id}

river crow
#

it did not throw an error at least but still the first invoice was 0dollar

crimson pewter
#

That's great! This means that the subscription item ID is retrieved correctly. Can you share the invoice ID (in_xxx)?

river crow
#

sure in_1PgM0DAgeNa2VITfcZlgUzZW

#

this is definetly create that it took the right subscription id already.. took us hours and hours yesterday

#

we definetly can work with the test clock

#

if we advance time we can simulate the dispute

#

unfortunately it did not trigger charge.dispute.created but invoice.payment_failed

#

do we then need to take a different testcard insted of pm_card_createDisputeProductNotReceived

crimson pewter
#

Thanks for sharing! For usage based billing, the customer will only be billed at end of the billing cycle

#

Why are you creating the invoice manually? For usage billing, subscription will create invoice automatically

river crow
#

dont now thought in the fixture we need to use it this way

crimson pewter
river crow
#

and we have a really really important understanding question to this legacy thing

#

can we ask you this right here, or do we need to open a new thread?

#

cause you are not in the topic already for a little bit

crimson pewter
#

It's fine to use the same thread

river crow
#

Okay, to give you small overview what we do we have actually a saas for b2b and three different prices small, medium, premium where the companies get charged on the amount of employess "per-seat" they have in there.. but they can quickly swith also inbetween the month and say this user is small now and this one is premium now

#

back then beeing relatively new to stripe we thought the only solution to be this flexible with per-seat pricing would be using metered prices and create usage record which was the soltion back then. the new meters and everything was not there already

#

so one of the other support members also told us that the stuff we using is legacy and we urgently should update all our customers to meters and the the usage-based billing.

#

now that we need to do a lot of work an somehow migrate all the customers would you recomend to just update the subscription of the user with monthly recuring prices just a plain subscription with three different prices.. or would you go with the meters

#

cuause we definetly dont want that if the customer swithces from premium to small, that in the end the customer is charged twice

#

i hope you understand what i try to tell you here? ๐Ÿ˜…

crimson pewter
#

Thanks for sharing the information. When do you expect to charge to the customer? At the start or end of the billing cycle? For example, if the customer changes from small to premium in the middle of cycle, how would you like to charge to the customer?

river crow
#

at the end of the billing cycle we charge, so if the change in the middle from small to premium the next invoice should contain premium instead of small

crimson pewter
river crow
#

okay thanks. so the other way without useage based you would recommend when the customer is charged at the begining of the month?

crimson pewter
river crow
#

Okay proration sounds interesting so thanks for sharing the article we will instensely compary both soltions

#

and the with the new usage-based with is using a meter, it is also possible to then see in realtime the current propably revenue in realtime

#

cause currentyl we struggle that it is not possbible to see what is the total active revenue, which defiently is possbile with the upgrade downgrade subscriptions thig cause there you would see MRR

#

i guess

crimson pewter
#

This channel is for technical integration questions. We don't have necessary expertise with MRR. Our support team will be able to assist you better than I can: https://support.stripe.com/contact/email

river crow
#

yeah sorry i know this.. but its a hard topic cause it depends on both worlds. like if i use this kind of API subscription will it then show this or that values in the dashboard

#

anyways you helped a lot and we have to do our homework now, read a lot documentation and try to build a small prototype..

#

also the fixture hint from you helped a lot so thanks again for this as well

azure oliveBOT
crimson pewter
#

like if i use this kind of API subscription will it then show this or that values in the dashboard
I'd recommend checking with Support how upgrading / downgrading a subscription will be reflected in MRR in Dashboard

#

No problem! Happy to help ๐Ÿ˜„