#Jason Jay-apple-pay

1 messages · Page 1 of 1 (latest)

urban sapphire
#

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?

prime prism
#

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

Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.

urban sapphire
#

Is there somewhere I can reproduce this? Can you share an ID of a Payment Intent or the account ID?

prime prism
#

acct_1JHXNqLfScei9GoC

#

Yes, I'm sure I meet all the conditions presented by ApplePay

urban sapphire
#

And what's the domain you're trying to register for Apple Pay?

prime prism
urban sapphire
#

Ok, looks registered to me. And can you confirm your current locations where you're testing payments?

prime prism
urban sapphire
#

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?

prime prism
#

Requires Safari Responsive Mode to see ApplePay

urban sapphire
#

Hmm, I don't even get any errors in the console

prime prism
#

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.

urban sapphire
#

I don't even get Apple Pay listed

prime prism
urban sapphire
#

Ok, that works now

#

Got the same error, let's see

prime prism
#

This problem has been bothering me for a day

#

😩

urban sapphire
#

Can you share your code where you initialise Stripe.js

#

And your Payment Request Button implementation

prime prism
urban sapphire
#

Can you paste the code? That's impossible to read

prime prism
#

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,
})

urban sapphire
#

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

prime prism
urban sapphire
#

Otherwise it confused the Apple Pay configuration

urban sapphire
#

Does the same issue occur without it?

prime prism
#

yes i have the same problem without using stripeAccount

#

I just added the stripeAccount configuration after trying and failing

urban sapphire
#

Stripe.checkInstance I repackaged Stripe.js
Can you share the source for this?

prime prism
# urban sapphire > 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()

prime prism
urban sapphire
#

Potentially non-starter, but can you remove that and just initialise Stripe.js normally as per our docs?

prime prism
urban sapphire
#

Yeah I don't doubt that. But your 'caching' could be doing something weird

#

Just exhausting all options

prime prism
#

Ok, but I don't quite understand what effect 'caching' can have

#

I try to modify the cache here and try again

urban sapphire
#

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

prime prism
#

So this way doesn't work for me?

prime prism
urban sapphire
#

But you're not using Connect, are you?

#

From what I could see on your account you're not

prime prism
#

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

urban sapphire
#

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

prime prism
#

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?

urban sapphire
#

Yep, very weird. Are you able to collate all this detail and write in so we can help further?

meager cedar
#

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.

meager cedar
#

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.

prime prism