#vatron_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255962956039196743
๐ Have more to share? Add 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.
- vatron_pmc-delete, 2 hours ago, 14 messages
Hi ๐ when creating the Payment Element instance, you can set wallets.applePay to never to achieve that:
https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-wallets
Hi @bleak forge I am passing in this exact params to payment element as of today ->
const options: any = {
mode,
amount: amountInSmallestCurrency(amount, currency),
currency: currency,
setupFutureUsage:
enableBNPL &&
!['ideal', 'bancontact'].includes(selectedPaymentMethod.value)
? undefined
: StripeSetupFutureUsage.OFF_SESSION,
captureMethod,
...paymentMethodTypesOrConfiguration,
payment_method_options: paymentMethodOptions,
}
createPaymentElement(options)
what should I pass in more exact;y to this ?
I'm not sure I understand. The values you're showing there inside of options are all ones that you would provide when creating the Elements instance, so it seems odd that you're passing them to a function named createPaymentElement
https://docs.stripe.com/js/elements_object/create_without_intent
The additional option you need to provide to suppress Apple Pay is not part of that. It's instead a parameter provided when creating the Payment Element instance. The link I provided in my earlier message links to the parameter, so you can see where it is expected to be provided when creating the Payment Element.
Can you share the code you're currently using to create the Payment Element instance rather than the Elements instance?
@bleak forge this code itself creates the payment-element instance, are we sure that adding this code would stop the payment element from renderring itself the apple pay options?
I'm not sure that's accurate. All the options you're sharing are for creating an Elements instance, not a Payment Element instance, but I can't see what you're doing inside of createPaymentElement so I can't be more certain on that.
@bleak forge
async function createPaymentElement(options) {
const elements = stripeSDK.value.elements(options)
stripeSDKElements.value = elements
let terms
if (props.stripeOptions?.terms) {
terms = props.stripeOptions?.terms
}
stripeSDKPaymentElement.value = elements.create('payment', {
layout: props.stripeOptions?.layout,
terms,
})}
Yup, so all of the options you showed are for creating the Elements instance here:
const elements = stripeSDK.value.elements(options)
You need to adjust the options you're passing to elements.create to include wallets.applePay with it set to never. This chunk here is what needs to be updated:
layout: props.stripeOptions?.layout,
terms,
})}```
@bleak forge sorry but can you pls provide that snippet how will the second block of code be there ?
layout: props.stripeOptions?.layout,
terms,
wallets: {
applePay: 'never',
},
})}```
Thanks a lot @bleak forge
@bleak forge how do I check the renderring of apple pay and gpay since I am based out of India, tried one vpn and was over a compatible mac device but didn't help