#vinicius_link-passthrough

1 messages ยท Page 1 of 1 (latest)

dense tinselBOT
#

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

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

fallow wind
#

๐Ÿ‘‹ When Link is used in Passthrough mode it is functionally a card transaction with type card.

lavish flame
#

If I try to handle it as a card and call createPaymentMethod passing in card as type it fails with this error message

fallow wind
#

Do you have a request ID demonstrating the above error? Some Example Code would also be appreciated in addition to the req id

Can you provide more detail as to what you are trying to accomplish? Just trying to get the full picture so we can provide informed guidance.

lavish flame
#

Can I have the request ID for JS SDK calls?
I can def pull these and share...
Just to give you context, we currently handle card payments and Link payments differently.
For regular card payments, without Link, we create the payment method by using the SDK and pass the id to our backend and do the calls to create the customer, attach the payment method, create and capture the payment intent.
When using Link(without PT) we let Stripe handle the capture for us and listen for the payment_intent.succeeded event in order to finish the process...That's why is so important to us to know upfront if the customer is paying using Link or not

#

Not sure if it helps but the sdk fails and show this message after calling https://api.stripe.com/v1/consumers/payment_details/share which returns the wallet data with type equal to link... so I wonder if there is a way to before proceding, check this property using any function provided by the sdk

fallow wind
#

Let me try and test this and see if there a way.

#

I'm seeing similiar. I have both Card and ACH PMs saved to Link and when I select those the onChange reflects the underlying PM (bank, card)

lavish flame
#

Yeah, that's fine as far as we could have access to the underlying wallet object and check its type

#

But I can't find a way to do that :/

dense tinselBOT
fathom adder
#

@lavish flame Just to be clear, you use passthrough mode so everything is just a card at that point there should be no need to "differentiate"
What are you really trying to answer exactly? Like show sample code you have where you want to do something you can't anymore

lavish flame
#

I need to differentiate because our systems are not fully ready to handle card async as we do for Link

fathom adder
#

what does that mean though?

#

vinicius_link-passthrough

lavish flame
#

For regular card we create the payment method using the js sdk and pass the pm_ to the BE, the BE creates the customer, attach it to the PM, creates the payment intent and capture.
For Link we create the payment intent and let Stripe handle the capture and listen for the webhooks

fathom adder
#

But you don't have Link at all anymore since you use passthrough, to your back end it all looks like normal card, there's nothing to do.
That's why I'm asking for code, I don't get what that could mean

lavish flame
#

Ok, so why am I receving that error back?

#

I call stripe.createPaymentMethod('card', paymentElement) for card payments so I tokenize the card and can send to my BE

#

When I try to do the same with a Link passthrough I receive an error from Stripe sdk

fathom adder
#

That is the part we don't understand and were asking for more details

#

Do you have a URL where I can just reproduce in Test mode?

lavish flame
#

sure, let me grab it to you

fathom adder
#

Can you give me detailed exact step by step test instructios and values for each field?

#

okay I can put random thing you don't validate cool

#

okay so I can repro: what part of your code triggers that error so I can put a breakpoint and look at it

lavish flame
#

sure

#

the last step triggers the error, please log into your Link account, select a card and proceed with the checkout

#

When you click "Complete purchase" you'll see the error in the console

fathom adder
#

please log into your Link account
to be clear I can't. It's all Test mode, not real Link accounts (otherwise every time you test a random email it could text someone) so I would need a fake Link account you already have configured on that specific Stripe account.

But I hit the error while just signing for Link. I see the error. I'm asking you what part of your code triggers the error so I can add a breakpoint and debug

lavish flame
#

The error is thrown when I call the createPaymentMethod passing in card and the paymentElement

fathom adder
#

do you have more specific details? You call createPaymentMethod() in multiple places and the code looks minified

lavish flame
#

hm...let me check

#

You can probably find a check for the payment method I'm mentioned if (lastSelectedPaymentMethod === 'card') {

fathom adder
#

I don't think so because the code is all minified

#

I added a breakpoint to all mentions of createPaymentMethod() but not hitting any, are you sure it's not something else causing the error?

#

sorry really hard to debug live with so much code so I think we need to take a couple steps back and focus on the simplest possible reproduction with just basic Stripe UI stuff

lavish flame
#

hmm, let me debug it a little bit on my end and check that, maybe I can find something easier to find

fathom adder
#

Yeah what I recommend is making a simple separate/standalone example that just loads PaymentElement with your Publishable key and then call createPaymentMethod and see if you can reproduce that exact error

lavish flame
#

Nice, I can do that, for sure

fathom adder
#

Maybe add a log before/after Stripe calls too so we can pinpoint the potential root cause

#

I wonder if the problem is passing createPaymentMethod('card' instead of {type:'card',...} but I know we iterated on those shapes over the years many times so wouldn't surprise me we support both

lavish flame
#

I don't think so since it works perfectly for card payments

#

I mean, regular card, without Link

fathom adder
#

yeah I think that's where I need to be able to see simple repro code. I tried everything with your current code and put breakpoints everywhere but can't seem to hit a relevant one for some reason

lavish flame
#

Let me do this sample, check what's going on and get back here with more information

fathom adder
#

sounds good!