#Muttakin Islam Hasib
1 messages · Page 1 of 1 (latest)
Hi
Can you share an eventId that you were expecting to get? and could you please copy past the webhook Id
we_1MZBmUGtB6p6nHNaWWv5WROT
Do you have an eventId?
Or what actions you did that you were expecting to get an account.updated event?
it's work on the local but not on the live test mode
Could you please elaborate more... what you mean by "work" exactly? can you share the eventId you get
it's triggering on my local stripe cli
When you trigger a test event using stripe cli you'll get it for you test webhooks too.
could you try triggering another event using Stripe cli and share it's id ?
payment_intent.succeeded:
id: evt_3MZCCqGtB6p6nHNa1bDTXmp3
payment_intent.succeeded this event is triggering and showing on the stripe dashbaord...
Yes, in fact I see that it was also consumed by your endpoint
now what about generating a new event for account.updated using your stripe cli ?
i am not generating with stripe cli
let me generate with stripe cli
evt_1MZCW3Gds8Wn6130zqVlCwMF
this is the account.updated event id
evt_1MZCW9Gds8Wn613067mcfIvy
{
id: 'acct_1MZCTZGds8Wn6130',
object: 'account',
business_profile: {
mcc: null,
name: null,
support_address: null,
support_email: null,
support_phone: null,
support_url: null,
url: 'https://www.muttakinhasib.com'
},
capabilities: { transfers: 'active' },
charges_enabled: true,
country: 'US',
default_currency: 'usd',
details_submitted: true,
email: 'hasib@beweddy.com',
future_requirements: {
alternatives: [],
current_deadline: null,
currently_due: [],
disabled_reason: null,
errors: [],
eventually_due: [],
past_due: [],
pending_verification: []
},
payouts_enabled: true,
requirements: {
alternatives: [],
current_deadline: null,
currently_due: [],
disabled_reason: null,
errors: [],
eventually_due: [
'individual.dob.day',
'individual.dob.month',
'individual.dob.year',
'individual.ssn_last_4'
],
past_due: [],
pending_verification: []
},
settings: {
bacs_debit_payments: {},
branding: {
icon: null,
logo: null,
primary_color: null,
secondary_color: null
},
card_issuing: { tos_acceptance: [Object] },
card_payments: {
statement_descriptor_prefix: null,
statement_descriptor_prefix_kanji: null,
statement_descriptor_prefix_kana: null,
decline_on: [Object]
},
dashboard: { display_name: 'Muttakinhasib', timezone: 'Etc/UTC' },
payments: {
statement_descriptor: 'WWW.MUTTAKINHASIB.COM',
statement_descriptor_kana: null,
statement_descriptor_kanji: null
},
sepa_debit_payments: {},
payouts: {
debit_negative_balances: true,
schedule: [Object],
statement_descriptor: null
}
},
type: 'express',
created: 1675858214,
external_accounts: {
object: 'list',
data: [ [Object] ],
has_more: false,
total_count: 1,
url: '/v1/accounts/acct_1MZCTZGds8Wn6130/external_accounts'
},
login_links: {
object: 'list',
total_count: 0,
has_more: false,
url: '/v1/accounts/acct_1MZCTZGds8Wn6130/login_links',
data: []
},
metadata: {},
tos_acceptance: { date: 1675858370 }
}
@green rivet
The event is generated by the merchant acct_1MZCTZGds8Wn6130 but the webhook we_1MZBmUGtB6p6nHNaWWv5WROT is set for another merchant acct_1IZiatGtB6p6nHNa
You need to authenticate your stripe cli with the same account
maybe you did not get my issue
this one is from my local development
What I understand that you created a webhook we_1MZBmUGtB6p6nHNaWWv5WROT with this account acct_1IZiatGtB6p6nHNa, but you are generating an event for this account acct_1MZCTZGds8Wn6130 when using your Stripe Cli. If you want to test your webhook, you need to generate an event for the same Account.
here is two endpoint .... one is live test mode and another is localhost testmode
this one is from localhost stripe listen
everything is working on localhost
Try to authenticate your stripe cli for your account acct_1IZiatGtB6p6nHNa and generate another account.updateevent, your endpoint we_1MZBmUGtB6p6nHNaWWv5WROT will get the event and so you can test it
like this ?
Oh I think that's an option too
But what I meant is to login your stripe-cli using your webhook's account:
https://stripe.com/docs/cli/login
try to trigger the account.updatedevent
I need more details about what's not working please? do you have an event Id ?
This is a another Connect Account, you need to create a webhook endpoint that listens to your connect events:
https://stripe.com/docs/connect/webhooks
i need to select this option ??
Yes
let me check
is this one will cover also the customer.subscription ?
If the Subscription was created on the Connected Account, then yes.
can I use the same endpoint with different types?
https://beta.beweddy.com/api/stripe/webhook (type: account)
https://beta.beweddy.com/api/stripe/webhook (type: connect)
Sure, you can
You'd just need to handle the different events accordingly. Events from connected accounts on Connect endpoints have additional fields: https://stripe.com/docs/connect/webhooks#:~:text=In addition to,is being sent.
how to configure two secrets for different stripe webhooks types(account & connect) in nestjs
@Global()
@Module({
imports: [
MongooseModule.forFeature([{ name: Couple.name, schema: CoupleSchema }]),
MongooseModule.forFeature([{ name: Venue.name, schema: VenueSchema }]),
HoneymoonFundsModule,
StripeModule.forRoot(StripeModule, {
apiKey: ServerConfig.STRIPE_SECRET_KEY,
webhookConfig: {
stripeWebhookSecret: ServerConfig.STRIPE_WEBHOOK_SECRET,
},
}),
],
controllers: [StripeController],
providers: [StripeService, SubscriptionService, StripeWebhookService, StripeConnectService],
exports: [StripeService, SubscriptionService, StripeWebhookService, StripeConnectService],
})
export class AppStripeModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
applyRawBodyOnlyTo(consumer, {
method: RequestMethod.ALL,
path: 'stripe/webhook',
})
}
}
Yeah, that's the part you'll struggle with
I guess you'd need to do constructEvent twice, once with each secret, and handle accordingly
can you please guide me how to do that ?
You should try yourself, then I can help debug. We don't write code here, plus this isn't specifically Stripe related