#vinicius_link-passthrough
1 messages ยท Page 1 of 1 (latest)
๐ 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.
๐ When Link is used in Passthrough mode it is functionally a card transaction with type card.
If I try to handle it as a card and call createPaymentMethod passing in card as type it fails with this error message
{
"name": "Error",
"message": "Unexpected element_payment_method_id or element_payment_method",
"stack": "Error: Unexpected element_payment_method_id or element_payment_method\n at https://js.stripe.com/v3/fingerprinted/js/controller-with-preconnect-479c27096597f5977c343c8bdf0d54df.js:1:974231"
}
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.
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
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)
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 :/
@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
I need to differentiate because our systems are not fully ready to handle card async as we do for Link
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
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
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
{
"name": "Error",
"message": "Unexpected element_payment_method_id or element_payment_method",
"stack": "Error: Unexpected element_payment_method_id or element_payment_method\n at https://js.stripe.com/v3/fingerprinted/js/controller-with-preconnect-479c27096597f5977c343c8bdf0d54df.js:1:974231"
}
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?
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
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
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
You can use test@peek.com then, and use 00000 as the code
The error is thrown when I call the createPaymentMethod passing in card and the paymentElement
do you have more specific details? You call createPaymentMethod() in multiple places and the code looks minified
hm...let me check
You can probably find a check for the payment method I'm mentioned if (lastSelectedPaymentMethod === 'card') {
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
hmm, let me debug it a little bit on my end and check that, maybe I can find something easier to find
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
Nice, I can do that, for sure
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
I don't think so since it works perfectly for card payments
I mean, regular card, without Link
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
Let me do this sample, check what's going on and get back here with more information
sounds good!