#kuvana_api

1 messages ยท Page 1 of 1 (latest)

deft pawnBOT
#

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

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

sand lark
#

What do you mean by current value?

#

What data point are you trying to retrieve?

crude vale
#

Well the onClick returns and event that includes event.expressPaymentType we then pass that to our backend to handle the payment confirmation. But if the user is already logged in, that onClick is never called, so I need a way to retrieve the expressPaymentType

deft pawnBOT
crude vale
#

This is what im referring too.

cunning isle
#

๐Ÿ‘‹ codename_duchess has to head out so i'll be jumping in to take over

#

Just need to clarify some points. By current value, do you mean the amount the user would be charged?

crude vale
#

No, just the payment type, I need to know they are paying with link

cunning isle
#

Do you have an account id? Do you know if you are using Link with th e default Payment Method mode or are you using Passthrough mode?

crude vale
#

Essentially this state occurs when they are already logged in to link, could be from a failed payment request, but once we are in this state, I dont have a way of continuing with the express checkout element, so I need to retrieve the payment type from this so I can pass it to the backend confirm api

#

acct_1F88VkB2H7X7BCaJ

cunning isle
#

I presume you are not using Direct Charges (account type is express)

The platform account has Link set up in Passthrough mode which. When this is the case the payment method is of type card and won't show as being link.

#

Do you have a public test page we could look at to try and debug?

crude vale
#

Thats fine, but is there anyway for me to know that from a code perspective?

cunning isle
#

And can you share with me the client side code you are using currently to try and acertain the Payment Method Type?

crude vale
#

const handleExpressElementChange = (event: StripeExpressCheckoutElementClickEvent) => {
onPaymentChange(event.expressPaymentType, true);
event.resolve();
};

const handlePaymentChange = (event: StripePaymentElementChangeEvent) => {
onPaymentChange(event.value.type, event.complete);
};

const onPaymentChange = (type: string, isComplete: boolean) => {
switch (type) {
case 'link':
setPaymentMethod(PaymentMethodTypeEnum.LINK);
onRedirectPaymentMethod?.();
break;
case 'us_bank_account':
setPaymentMethod(PaymentMethodTypeEnum.ACH);
handleACHPaymentMethod();
break;
case 'affirm':
setPaymentMethod(PaymentMethodTypeEnum.AFFIRM);
onRedirectPaymentMethod?.();
break;
default:
setPaymentMethod(PaymentMethodTypeEnum.CARD);
break;
}
setPaymentElementComplete(isComplete);
};

#

This particular flow is a single request page, so I could send you a link, but you would only be able to process once, before it would deny access to view this form

cunning isle
#

doing some quick tests

cunning isle
#

I don't seem to be able to reproduce this. When already logged into Link i'm still getting onPaymentChange events.

#

So It sounds like what you want shouldbe possible. It might make sense to try and create a minimal repro to see if you can isolate the cause.

crude vale
#

Hmm, okay, I'll play around with it some more then

#

Where are you seeing those onPaymentChange events though? Are you clicking on the element at all?

cunning isle
#

Correct when I select one of the available methods showin in the ECE

#

I signed into link reloaded the page and then clicked on Link and the event was triggered.

#

I'm just logging to console the Payment Type depending on the case. In my little mock up but I regularly get Link logged when ever I click on it.

crude vale
#

alright thanks, I got it working

cunning isle
#

Nice!