#vizio_webhooks

1 messages ¡ Page 1 of 1 (latest)

turbid flameBOT
#

👋 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/1316815403967582208

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

leaden swallow
#

Hi there

#

one of the cards has a new payment method id and the old payment method finger print
This is not abnormal. Fingerprints are based on the card number so if two different customers save the same card number, each of their cards will have a different PM ID but the same fingerprint. If one of those customers detaches their PM and re-adds the same card number, the new card will have a new PM ID but the same fingerprint

leaden swallow
#

Let me know if I've misunderstood your question or if you need more help!

royal pasture
#

ok but what I don't understand is this

we have a customer with an existing card
PM = A
fingerprint= AF

they then go an pay and I assume they are adding a new card (?), anyway a new payment method is created with
payment_method.attached
PM = B
fingerprint = BF

Then we call /v1/payment_methods to get the list of payment methods and at this point our logic decides to detach a card

Based on that detach call we then receive a detach event with
PM = A
fingerprint = BF

and then if we look at the customer cards we can see a card with
PM = B
fingerprint = AF

#

** PM = payment method ID

#

the thiings that confuses me is that detach event with the PM of the original card but the fingerprint of the newly attached card

leaden swallow
#

I want to make sure we're talking about the same ID so I won't grab the ID from the previous thread

#

Can you share an example here? it'll be helpful to share the Customer ID, PM A and PM B

royal pasture
#

you mean production data right?

leaden swallow
#

Sure, if that's where you're seeing the behavior you described above

royal pasture
#

Customer ID = cus_Ikpwj55pIfMsT0
PM A = pm_1QRKSlDD3nZJlvMpWGtGD9Qb
PM B = pm_1QSMjrDD3nZJlvMpX02cHN7P

leaden swallow
#

I don't think your summary is accurate in this specific case

royal pasture
#

ok

leaden swallow
#

PM A and PM B fingerprints were identical in the payment_method.attached events that were sent when each of these PMs were attached to the customer

royal pasture
#

ok

#

that makes sense as our dedupe logic triggers only if the fingerprints are identical

#

but then why does the finger print change?

leaden swallow
royal pasture
#

ok here is another example as now I have more logs

This is the log from our dedupe logic. We get all payment methods and we remove the ones that have the same finger print, keeping the method with the most recent created date:

12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1QVGduDD3nZJlvMp7zLCcpIQ
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1QSmiLDD3nZJlvMpTtvP8CTx
12/12/2024, 5:57:46 PM     LOG Current fingerprint: EYF6UfWbpB3Kwz1s
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1PMB6nDD3nZJlvMpRZFwOZFy
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######Detach duplicate card######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1PMB6nDD3nZJlvMpRZFwOZFy
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
#

if you look at that customer page, there is no card with fingerprint = v5gdHZanzX9BCjAd

#

the card with PM pm_1QVGduDD3nZJlvMp7zLCcpIQ has now a different finger print lcw0Es0Wup0jirtO

#

and based on our logs, this fingerprint lcw0Es0Wup0jirtO was already on one of the existing cards before this process started. But this could be just a red herring on our side.

leaden swallow
#

Hm, that's really odd

#

I think you may need to debug your logging

#

Ohhh, I think I see what's happening here

#

Connect is involved, as my teammate mentioned

#

So fingerprints are unique to a specific account

#

If Card Number A is added to Account 1 and another customer adds Card Number A to Account 2, the cards will have different fingerprints even though they're the same underlying card number

royal pasture
#

ok could that happen for the same customer?

#

same customer did add Card A to account 1 and now they are adding the same Card A to account 2

leaden swallow
#

Hold on a second

royal pasture
#

I've got a different event id

#

ignore me

#

mine is the attach

turbid flameBOT
high sparrow
#

Hello
Taking over as my colleague needs to step away soon

royal pasture
#

I will need to go soon as well

#

if it helps we are using the node sdk to call the detach and the only thing we pass is the payment method id, no fingerprint

high sparrow
#

How exactly are you looking at the card fingerprints? Are you looking via dashboard or retrieving them via the API?

My understanding is that the fingerprints are unique to an account. However, if the payment methods are created by a platform - if the platform retrieves the payment method using Stripe-Account header, they should be able to see the same fingerprint across connected accounts.

royal pasture
#

we are getting them through the node sdk

const stripePaymentMethods = this.stripe.paymentMethods.list(
            {
                customer: customerId,
                type: PaymentMethodTypeEnum.Card,
            },
            !isObjectEmpty(requestOptions) ? requestOptions : undefined
        )
#

we then log the results out and this is what we get

12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1QVGduDD3nZJlvMp7zLCcpIQ
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1QSmiLDD3nZJlvMpTtvP8CTx
12/12/2024, 5:57:46 PM     LOG Current fingerprint: EYF6UfWbpB3Kwz1s
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1PMB6nDD3nZJlvMpRZFwOZFy
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
12/12/2024, 5:57:46 PM     LOG ######Detach duplicate card######
12/12/2024, 5:57:46 PM     LOG Current customerId: cus_P4Z6lNMUGo5NF1
12/12/2024, 5:57:46 PM     LOG Current accountId: acct_1Gin94DD3nZJlvMp
12/12/2024, 5:57:46 PM     LOG Current paymentMethodId: pm_1PMB6nDD3nZJlvMpRZFwOZFy
12/12/2024, 5:57:46 PM     LOG Current fingerprint: v5gdHZanzX9BCjAd
12/12/2024, 5:57:46 PM     LOG ######
high sparrow
#

What API key are you using here? Are you passing Stripe-Account header?

royal pasture
#

yes we are, we are passing accountId: acct_1Gin94DD3nZJlvMp

#
const requestOptions = {
            ...conditionalFields(accountId, () => ({
                stripeAccount: accountId,
            })),
        }

        const stripePaymentMethods = this.stripe.paymentMethods.list(
            {
                customer: customerId,
                type: PaymentMethodTypeEnum.Card,
            },
            !isObjectEmpty(requestOptions) ? requestOptions : undefined
        )
#

we pass it as part of the options

#

we were wondering if it's because now the webhooks are triggered from the parent account instead of the child account

#

I think before the 3rd of Dec webhooks were triggered from the child account, and after the 3rd we started getting them from the parent

#

but I'm not sure if this was a change we made in the code or in the stripe config

high sparrow
#

Could be. Webhook events also reflect similar variation in terms of fingerprint.

Connect type webhook endpoints receive -> platform's fingerprint
Account type webhook endpoints receive -> connected account's fingerprint

#

The logs you've shared are a bit confusing to me. It seems like the customer has 3 payment methods attached and one of them is a duplicate of another. So your code tries to detach one of the duplicate ones

#

like
Card 1 -> pm_1QVGduDD3nZJlvMp7zLCcpIQ -> v5gdHZanzX9BCjAd
Card 2 -> pm_1QSmiLDD3nZJlvMpTtvP8CTx -> EYF6UfWbpB3Kwz1s
Card 3 -> pm_1PMB6nDD3nZJlvMpRZFwOZFy -> v5gdHZanzX9BCjAd

Card 1 == Card 3
So your code tries to detach Card 3

#

that's what I've understood from your logs

#

If you try to list the payment methods after detach has happened, what are you seeing then?

#

I think the issue here is that you're trying to look at it from the dashboard and its showing you account level fingerprint rather than platform level fingerprint

#

Try using the API

#

What response do you get?

#

If you look at this webhook event for example - https://dashboard.stripe.com/events/evt_1QVGdyDD3nZJlvMpEmfMuxr8

The event data shows you what we'd have sent to the account type webhook (so account level fingerprint - lcw0Es0Wup0jirtO )

If you look at the webhook attempts to connected platform section and it's payload - you'd see platform level fingerprint - v5gdHZanzX9BCjAd

#

I removed the attachment since it contained user data. but you can look at it via dashboard

#

this is all expected