#chaimat-event-testing

1 messages · Page 1 of 1 (latest)

sleek jacinthBOT
sour robin
#

Hello there

#

Can you share your code where you are using those arguments ?

ocean cairn
#

I just have a standard route to listen to webhook. I was just trying to log what data do I receive when a subscription is over

#

stripe trigger customer.subscription.deleted

Setting up fixture for: customer
Running fixture for: customer
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: subscription
Running fixture for: subscription
Setting up fixture for: subscription_deleted
Running fixture for: subscription_deleted
Trigger succeeded! Check dashboard for event details.

this is the logs from stripe cli

sour robin
#

Okay yeah so when you run that trigger a lot of other events are going to be created as well

#

As you can see there is a Sub created

#

So you are going to receive a customer.subscription.created webhook as well

#

So you need to check your code for all of your variables and ensure they aren't causing those errors

ocean cairn
#

So what should I do under customer.subscription.created? I don't understand that. I get all the events sucessfully till customer.subscription.created after that an error arises as you can see below in my logs

Listening on port 3030...
Database connected
customer.created
payment_method.attached
product.created
plan.created
price.created
customer.updated
invoice.payment_failed
failed
invoice.finalized
customer.subscription.created
subscription created

#

What should I handle under customer.subscription.created?

sour robin
#

Well what do you want to do with it?

#

Right now you are updating the Sub

#

But it is likely erroring due to data.object.subscription

ocean cairn
#

Ohh I see...

#

I just wanted to see the subscription object that is passed when customer.subscription.deleted is triggered.

#

is it the same as all other customer.subscription object (as in the schema is same right?)

#

Also I commented that piece of code. And there was no error this time but seems like, the customer.subscription.deleted was not received as you can see in the logs below

payment_method.attached
customer.created
product.created
plan.created
price.created
invoice.payment_failed
failed
customer.updated
invoice.created
invoice.finalized
customer.subscription.created
subscription created
payment_intent.created
payment_intent.payment_failed
payment_intent.canceled
invoice.updated
invoice.voided
customer.subscription.updated

sour robin
#

You used trigger customer.subscription.deleted and the above was output?

#

Doesn't look like that Event was even generated?

ocean cairn
#

Yes

sour robin
#

Regardless of being received

ocean cairn
#

stripe trigger customer.subscription.deleted
Setting up fixture for: customer
Running fixture for: customer
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: subscription
Running fixture for: subscription
Setting up fixture for: subscription_deleted
Running fixture for: subscription_deleted
Trigger succeeded! Check dashboard for event details.

this was the logs from stripe cli

#

Oh, the invoice actually fails

#

So there was no subscription created in the first place

sour robin
#

Ah yeah okay that makes sense

ocean cairn
#

stripe trigger checkout.session.completed
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Trigger failed: Request failed, status=400, body={
"error": {
"message": "As per Indian regulations, only registered Indian businesses (i.e. sole proprietorships, limited liability partnerships and companies, but not individuals) can accept international payments. More info here: https://stripe.com/docs/india-exports",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_RgAS726hb7m0zb?t=1675350418",
"type": "invalid_request_error"
}
}

This is the output by stripe cli when i run checkout.session.completed. How do I trigger that event with a domestic payment. I don't want to accept international payment anyways

#

I think that is causing the issue

sour robin
#

Hmm weird

#

Do you have an India account?

ocean cairn
#

Yeah I have an indian individual account

#

And i just want to accept domestic payment. I don't mind not being able to accept international payments as of now

#

Are there any kind of flags that I can use to specifcy that the payment was made using an indian credit card (basically the test card for india) or somehow state that the payment was made with an indian context

sour robin