#Jason Jay-apple-pay
1 messages · Page 1 of 1 (latest)
Hey! Apply Pay domain verification/setup is a completely separate process
The flow above is related to creating and confirming a payment
What's the actual question?
I encountered the same problem as this developer (#983213176827035671 message), I always return null when I use paymentRequest.canMakePayment() officially, I have used the same phone for testing Environment I am sure that paymentRequest.canMakePayment() can correctly return {applePay: true}, but it does not seem to pass the verification in the official environment.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Do you meet all the Apple Pay prerequisites? https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html&platform=html-js-testing-apple-pay#html-js-testing
Is there somewhere I can reproduce this? Can you share an ID of a Payment Intent or the account ID?
And what's the domain you're trying to register for Apple Pay?
Ok, looks registered to me. And can you confirm your current locations where you're testing payments?
This is the link of my Stage environment https://stagem.shopcider.com/product/list?collection_id=31, if you want to see the payment, you need to add an item to the shopping cart and complete the user registration to see the payment method page.
我的测试环境是https://devm8.shopcider.cn
My test environment is https://devm8.shopcider.cn
Is there a URL I can visit that will take me straight to a checkout page? I don't want to complete these forms
And can you confirm your current locations where you're testing payments?
Account: jiangsheng1209@gmail.com,
Password: jiangsheng1209,
Visit the link: https://stagem.shopcider.com/payment/purchase?oid=1664696557,
please log in first.
Requires Safari Responsive Mode to see ApplePay
Hmm, I don't even get any errors in the console
I don't mean page error
I mean that paymentRequest.canMakePayment() always returns null, and when I click the button, the console reports IntegrationError: Payment Request is not available in this browser.
I don't even get Apple Pay listed
But Apple Pay is present for me here: https://stripe.com/docs/stripe-js/elements/payment-request-button
Can you share your code where you initialise Stripe.js
And your Payment Request Button implementation
Can you paste the code? That's impossible to read
The initialization code is a bit too much, sorry
stripe initialization:
const stripe = await Stripe.checkInstance(secret, {
apiVersion: '2020-03-02',
stripeAccount: 'acct_1JHXNqLfScei9GoC',
})
paymentRequest:
const paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
amount: 1599,
label: 'Cider',
},
requestPayerName: true,
requestPayerEmail: true,
})
What does checkInstance do?
Why are you passing the stripeAccount parameter? Don't think you're using Connect? https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
I suspect that's the issue. Remove that parameter when you're initialising Stripe.js
It's only necessary if you're using Connect, which you're not
Stripe.checkInstance I repackaged Stripe.js, stripeAccount I saw the solution mentioned here and tried it (#983213176827035671 message)
Otherwise it confused the Apple Pay configuration
Yes, but they're using Connect so it's applicable. you're not
Does the same issue occur without it?
yes i have the same problem without using stripeAccount
I just added the stripeAccount configuration after trying and failing
Stripe.checkInstance I repackaged Stripe.js
Can you share the source for this?
const stipeSDK = 'https://js.stripe.com/v3/'
class Stripe {
stripeSDK: any
stripeInstance: Map<string, any>
constructor () {
this.stripeInstance = new Map()
this.load()
}
public async load ():Promise<any> {
if (process.env.CLIENT !== 'true') return
if (this.stripeSDK) return this.stripeSDK
const { error } = await utils.loadJs(stipeSDK)
pixel.emitStripeSDKDownload(error ? 0 : 1)
this.stripeSDK = window.Stripe
return this.stripeSDK
}
public getInstance (key:string):any {
return this.stripeInstance.get(key)
}
public setInstance (key:string, instance:any) {
this.stripeInstance.set(key, instance)
}
public async creatInstance (key, options:Record<string, any> = {}):Promise<any> {
const stripeSDK = await this.load()
const stripeInstance = stripeSDK(key, {
locale: 'en',
...options,
})
this.setInstance(key, stripeInstance)
return stripeInstance
}
public async checkInstance (key, options?:Record<string, any>):Promise<any> {
if (this.getInstance(key)) return this.getInstance(key)
return this.creatInstance(key, options)
}
}
export default new Stripe()
Just doing Stripe loading and instance caching
Potentially non-starter, but can you remove that and just initialise Stripe.js normally as per our docs?
I am sure that the initialization is successful, otherwise an error message will appear when calling Stripe
Yeah I don't doubt that. But your 'caching' could be doing something weird
Just exhausting all options
Ok, but I don't quite understand what effect 'caching' can have
I try to modify the cache here and try again
It might not have an effect. But it could be that it's using an cached version with incorrect parameters – I don't know
It's probably worth you writing in to my team so we can take a more in-depth look at this issue for you: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
So this way doesn't work for me?
But you're not using Connect, are you?
From what I could see on your account you're not
Ok, thank you
In addition to the possible problems with the cache we just said, what else will paymentRequest.canMakePayment() always return null
I'm sure my wallet is tied to a card that can pay, and all ApplePay compliant environments
Yep, I'm not sure! Seems weird for sure
I'd recommend writing in like I asked, then we can spend some time investigating this thoroughly that way
This is the ApplePay test I did in safari private mode, I can see that the ApplePay cashier is woken up, but it is automatically retracted right away, I'm not sure what's going on here?
Yep, very weird. Are you able to collate all this detail and write in so we can help further?
Hi 👋 stepping in as my teammate needed to step away. I quickly wanted to point out that it is expected behavior for Apple Pay to not function in private windows within Safari.
Oh I see
It's particularly confusing because Private mode causes the Apple Pay button to always be rendered (even if underlying configurations aren't set up properly) but the payment flow doesn't work.
Ok, in such a special case, we still hope to inform our developers in an obvious place in the Stripe documentation
thanks a lot for your answer