#Muttakin Islam Hasib

1 messages · Page 1 of 1 (latest)

pliant adderBOT
green rivet
#

Hi
Can you share an eventId that you were expecting to get? and could you please copy past the webhook Id

gray gorge
#

we_1MZBmUGtB6p6nHNaWWv5WROT

green rivet
#

Do you have an eventId?

#

Or what actions you did that you were expecting to get an account.updated event?

gray gorge
#

no

#

this is my implementation

#

it's work on the local but not on the live test mode

green rivet
#

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

gray gorge
#

it's triggering on my local stripe cli

green rivet
#

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 ?

gray gorge
#

payment_intent.succeeded:

id: evt_3MZCCqGtB6p6nHNa1bDTXmp3

#

payment_intent.succeeded this event is triggering and showing on the stripe dashbaord...

green rivet
#

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 ?

gray gorge
#

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

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

gray gorge
#

maybe you did not get my issue

gray gorge
green rivet
#

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.

gray gorge
#

here is two endpoint .... one is live test mode and another is localhost testmode

gray gorge
#

everything is working on localhost

green rivet
#

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

gray gorge
#

like this ?

green rivet
#

Oh I think that's an option too

gray gorge
#

then ?

green rivet
#

try to trigger the account.updatedevent

gray gorge
#

not working

#

no account.updated logs here

green rivet
#

I need more details about what's not working please? do you have an event Id ?

green rivet
gray gorge
#

i need to select this option ??

green rivet
#

Yes

gray gorge
#

let me check

gray gorge
green rivet
#

If the Subscription was created on the Connected Account, then yes.

gray gorge
#

can I use the same endpoint with different types?

stiff wharf
#

Sure, you can

gray gorge
#

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

stiff wharf
#

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

gray gorge
#

can you please guide me how to do that ?

stiff wharf
#

You should try yourself, then I can help debug. We don't write code here, plus this isn't specifically Stripe related