#azhar_error
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/1311979391441436703
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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;
});
๐ taking over for my colleague. Let me catch up.
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'
what you're generating is the confirmation token
the backend team should migrate away from card tokens
it's not really a good approach
okay. is there any method to generate the card token?
tokens have been deprecated for non-card usage and soon they might also get deprecated for cards
because our mobile app team is able to do that
your mobile team should also move away from card tokens
untill our backend get upgraded can i do something from ui as temporary solution ?
for mobile https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration
if you adapt your code to generate tokens they won't change their backend code
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
ok let me check with them
Hi @golden oyster any workaround available as of now to generate cardtoken on ui?
We will definitely migrate to latest one.
so on ui I have to use the legacy ApplePay integration method?
what do you mean by that?
cardTokens can only be created on Card Element which doesn't support ApplePay
hi can you send link for backed change?
i will send to service team and close this thread
sorry I missed your message earlier, but even with this you don't create a cardToken, you create a PaymentMethod
is the backend team able to handle PaymentMethods?
I guess yes. because we have both cards, apple pay and googlepay support in mobile apps and cards in web
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
This guide should contain current recommended integration for both frontend and backend for all platforms: https://docs.stripe.com/payments/accept-a-payment?platform=react-native
so express checkout element will generate only confirmation token only
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.