#azhar_error

1 messages ยท Page 1 of 1 (latest)

low shadowBOT
#

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

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

rapid dawn
#

using this code i am generating token

expressCheckoutElement.on('confirm', async (event) => {
console.log('confirm call executed');
const messagestepone = document.querySelector('#success-messagestepone');
messagestepone.textContent = 'Confirm call Executed.';

            const { error: submitError } = await elementsNew.submit();
            if (submitError) {
                handleError(submitError);
                return;
            }

            // Create a ConfirmationToken using the details collected by the Express Checkout Element
            const { error, confirmationToken } = await stripe.createConfirmationToken({
                elements: elementsNew,
                params: {
                    payment_method_data: {
                        billing_details: {
                            name: 'Jenny Rosen',
                        }
                    },
                    // return_url: 'https://example.com/order/123/complete'
                }
            });
            const successmessage = document.querySelector('#success-message');

successmessage.textContent = 'Card Token :' + confirmationToken.id;
});

low shadowBOT
golden oyster
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

rapid dawn
#

okay

#

my team member saying i need to pass card token starts with "tok_"
but i am getting this kind of confirmation toekn 'ctoken_1QQNvJG6LVRn1ExlzynhsKbU'

golden oyster
#

what you're generating is the confirmation token

#

the backend team should migrate away from card tokens

#

it's not really a good approach

rapid dawn
#

okay. is there any method to generate the card token?

golden oyster
#

tokens have been deprecated for non-card usage and soon they might also get deprecated for cards

rapid dawn
#

because our mobile app team is able to do that

golden oyster
#

your mobile team should also move away from card tokens

rapid dawn
#

untill our backend get upgraded can i do something from ui as temporary solution ?

golden oyster
golden oyster
#

please tell them that Stripe advise for migrating into PaymentIntents as soon as possible

#

and I guess since the backend is supporting both web and mobile and it seems you want to have server-side confirmation instead of client-side, they need to check whether they're receiving a confirmationToken or a PaymentMethod and billingDetails and generate the PaymentIntent and confirm it accordingly

#

if someone from the backend team is available to join this discord thread, I would be happy to guide them through this

rapid dawn
#

ok let me check with them

rapid dawn
#

Hi @golden oyster any workaround available as of now to generate cardtoken on ui?

#

We will definitely migrate to latest one.

golden oyster
#

not with ECE

#

express checkout element

rapid dawn
#

so on ui I have to use the legacy ApplePay integration method?

golden oyster
#

what do you mean by that?

#

cardTokens can only be created on Card Element which doesn't support ApplePay

rapid dawn
rapid dawn
#

hi can you send link for backed change?

#

i will send to service team and close this thread

golden oyster
#

is the backend team able to handle PaymentMethods?

low shadowBOT
rapid dawn
#

I guess yes. because we have both cards, apple pay and googlepay support in mobile apps and cards in web

pliant dock
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

rapid dawn
#

so express checkout element will generate only confirmation token only

pliant dock
#

Yes. But following this guide will let you avoid generating tokens at all. You will just create a PaymentIntent on the backend and confirm it on the frontend. Web and Mobile Payment Elements will take care of everything else.