#dashen0897_code
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/1332252735197810721
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dashen0897_code, 23 hours ago, 13 messages
Question 1: Under what circumstances will Apple Pay and Google Pay be displayed? Question 2: I currently have two different payment buttons on Google Pay. Why do they appear?
Can you share the link to your site where we can see the Element? Please share the test login credentials (if any) and steps to navigate to the page where the Element is displayed
you have two Google Pay buttons because you're using both the Payment Element and Express Checkout Element. If you want to disable Google Pay / Apple Pay on the Payment Element, you can disable showing those wallets here : https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-wallets
can the combination be used to automatically remove duplicates and display quick payment?
??????????
No one replied to me
If you're asking whether using the Payment Element with the Express Checkout Element can prevent duplicate wallet payment methods from showing, yes, but it likely depends on how you've combined them specifically. If you can share your site, we can take a look
You need to log in to see the page, so it won’t work.
I have shared the code just now
do you have test login credentials which you can share so we can take a look?
<div
id="express-checkout-element"
style="width: 430px; margin-top: 20px"
></div>
<div class="pay-main">
<form id="payment-form" @submit.prevent="handleSubmit">
<div id="payment-element" class="pay-center-main">
<Loading v-if="!showSuccessModal" />
</div>
<button id="submit" :disabled="loading" v-if="showBtn">
<span id="button-text" style="font-weight: bold; font-size: 20px">
<template v-if="loading">
{{ t('Processing') }}
</template>
<template v-else>
{{ t('PAYMENT') }}
{{ currentYuan }}
{{
(itemPrice &&
new Intl.NumberFormat('en-US').format(itemPrice)) ||
0
}}
</template>
</span>
<div id="spinner" v-if="loading" class="spinner hidden"></div>
</button>
</form>
</div>
elements = stripe.elements({
locale: pay_lang.value || 'es',
appearance,
clientSecret: clientSecret.value,
})
const paymentElement = elements.create('payment', {
layout: 'accordion',
fields: {
billingDetails: 'never',
},
})
paymentElement.mount('#payment-element')
paymentElement.on('ready', (e) => {
showBtn.value = true
})
const options2 = {}
const expressCheckoutElement = elements.create(
'expressCheckout',
options2
)
expressCheckoutElement.mount('#express-checkout-element')
i try
gimme a while to test things out
try moving your Express Checkout Element to inside of <form id="payment-form">
<div
id="express-checkout-element"
style="width: 430px; margin-top: 20px"
></div>
I found a phenomenon that if the quick payment fails to load, it will be displayed in the current dynamic payment option.
Will the current code be affected?
i'm sorry but i don't understand, can you explain step by step how to replicate this? What do you mean by quick payment? What are you referring to when you say dynamic payment option
The Express Checkout Element is not displayed, but the Payment Element will display Google
okay, what did you expect to happen instead?
"try moving your Express Checkout Element to inside of <form id="payment-form">" What does it do?
Just to clarify, you wanted to display only one set of Google/Apple Pay buttons, correct? That's why I suggested moving your Express Checkout Element inside the <form id="payment-form"> to see if that fixes the issue where you're now currently seeing two Google Pay buttons
Ok,I just want to make sure this works as expected and under what circumstances (e.g. network stability?)
Network stability shouldn't affect this. You'll want to test out my suggestion to see if it works
Thanks, I'll try your suggestion and see the effect