#tony_51013

1 messages · Page 1 of 1 (latest)

cedar whaleBOT
molten igloo
#

How are you integrating Apple Pay?

woeful smelt
#

use strip.js

#

stripe.paymentRequest

molten igloo
#

Ok, but what payment UI? Payment Element? Payment Request Button?

woeful smelt
#

request button

molten igloo
#

Can you share the code you use to initialise Stripe.js and create the Payment Request instance, or a pi_xxx ID you're creating

woeful smelt
#

OK

#

pi_3Oc2j0ILnfDwQNcg0o7muqbU_secret_tozsulaKuRCNgHMnjuO7GVbiP

molten igloo
#

You're a Connect platform, right?

woeful smelt
#

sorry I am not sure: what's connect platform

molten igloo
#

That answers my question 🙂

#

Taking a look at the issue now

#

What's the full domain you're trying to use Apple Pay on?

woeful smelt
molten igloo
#

Can you share the code you use to initialise Stripe.js?

woeful smelt
#

I refer to this document and the code is almost the same.

molten igloo
#

Almost the same? Please share the code, I can't really debug the issue without seeing the actual code you're using

woeful smelt
#

Okay, give me a few minutes

molten igloo
#

Where the code where you initialise Stripe.js?

woeful smelt
#

const stripe = Stripe('pk_test_51M90AeILnfDwQNcgWOETNmzUhonDeP82dLrbyjrF1D5ldwO9hZ3zK0fNjB5ULljySeBP4MPHRRt4b9O1ohFV2q4v0068ZclTOU', {
apiVersion: "2022-11-15",
});

molten igloo
#

Thanks!

woeful smelt
molten igloo
#

Can you run this API call for me server-side with your sk_test_xxx key:

  domain_name: 'nz-release.kapeixi.cn',
});```
woeful smelt
#

choose Apple Pay and click Pay Now button

molten igloo
#

It's asking me to sign in

woeful smelt
#

password: 111111

molten igloo
#

I keep getting 'network connection is lost' error when I try and use Apple Pay

woeful smelt
#

let me see

cedar whaleBOT
woeful smelt
#

Can you share a screenshot of the error page?

molten igloo
woeful smelt
#

refresh this page and try it again

molten igloo
#

Did you run the code I asked you to?

molten igloo
woeful smelt
#

Is there any way I can share my screen with you?

molten igloo
#

I think I know what the issue is, however you're not following instructions as I've advised so I can't really help any further!

woeful smelt
#

I can show you a simple demo page

#

you can check the code

#

payment intent input value :pi_3Oc3LTILnfDwQNcg0VvOdqRo

woeful smelt
#

yes and I got the same error

#

client secret input value:pi_3Oc3LTILnfDwQNcg0VvOdqRo_secret_5ZcvkyYQwjZmN6zl6aTPIxQ8V

molten igloo
#

Hmm, was the call successful?

woeful smelt
#

got a error message :

#

{
"error": {
"message": "Could not create Apple Pay session. Please make sure you have registered this Stripe account. For more information, see https://stripe.com/docs/apple-pay#web.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_C8229qBbgAHB3Z?t=1706090895",
"type": "invalid_request_error"
}
}

Allow customers to securely make payments using Apple Pay on their iPhone, iPad, or Apple Watch.

molten igloo
#

Works for me

#

Where are you located?

woeful smelt
#

I used to use this code and it passed without any changes to the code, but now it doesn't work

#

I am in China

#

my website will be deployed in US

molten igloo
molten igloo
woeful smelt
#

I know what you're talking about. The test Apple ID I used can test Apple Pay, and we can test it normally using Nuvei.

#

Apple Pay only cannot be used on Macs in mainland China, but it can be used on iPhones. I am currently testing Apple Pay on iPhones.

molten igloo
#

Try and run this please:

await stripe.applePayDomains.delete('apwc_1OZT2EILnfDwQNcgLXCcjr4I');
#

That's using our Node SDK, but can be adapted

woeful smelt
#

Do you want me to execute it in the browser console?

molten igloo
#

No, you'll need to run it server-side using your sk_test_xxx key

woeful smelt
#

The JAVA language used by my server-side code

#

<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>22.0.0</version>
</dependency>

#

We are using this version of sdk

lean wedge
#
 ApplePayDomain domain = ApplePayDomain.retrieve("apwc_xxx");

domain.delete();
woeful smelt
#

run this code before create payment intent?

lean wedge
#

no, you just do it as a once-off thing/script to try and debug your current problem

#

it's not something you need to do in operation

woeful smelt
#

What are the parameters

lean wedge
#

which parameters?

woeful smelt
#

ApplePayDomain.retrieve("apwc_xxx");

#

xxx

woeful smelt
#

pwc_1OZT2EILnfDwQNcgLXCcjr4I ?

#

like this?

lean wedge
#

no

#

apwc_1OZT2EILnfDwQNcgLXCcjr4I like mentioned(seems like you removed the first two characters for some reason)

woeful smelt
#

ok

#

the same error message

#

oops I try it again

lean wedge
#

can you try changing the API keys on the page to livemode and visiting the page?

woeful smelt
#

that's the point

#

I cannot use livemode to test this

#

com.stripe.exception.AuthenticationException: No API key provided. Set your API key using Stripe.apiKey = "<API-KEY>". You can generate API keys from the Stripe Dashboard. See https://stripe.com/docs/api/authentication for details or contact support at https://support.stripe.com/email if you have any questions.

#

delete failed

lean wedge
#

that just means you have made some sort of misake in configuring the site and are amissing an API key somewhere

woeful smelt
#

Is there any mistake?

lean wedge
#

maybe stripeApiKey.getSecretKey is null.

woeful smelt
#

This is not possible because this is code that works fine in production and we already use Stripe to complete credit card payments.

#

this code runs well more than 2 years

#

I'll print log

lean wedge
#

cool

woeful smelt
#

Authorization: Bearer sk_test_51M90AeILnfDwQNcgvjkgFqq1GvJkKJ8BvigiBLd56JXI0ROrbgXpNNcxXqiO1cP75bySaUlxgDzNMHL34Vv9vXsi00dPdbuU9C

#

stripeApiKey.getSecretKey is not null

lean wedge
#

ah right because you don't use the globals

#

you pass requestOption for every call, but you didn't pass it to the Delete call.

#

in your setup it would have to be domain.delete(optionsBuilder.build());.

woeful smelt
#

ok I'll try it again

#

ah you have a keen eye

#

wow it works now

#

But I cannot understand what happened

#

And I had registed a new account,and got the same error.So I need run the code agian for this new account ?

lean wedge
#

possibly

woeful smelt
#

but I don't the parameter like :apwc_1OZT2EILnfDwQNcgLXCcjr4I

#

and I want to know why need to do this

lean wedge
#

I had registed a new account
how exactly do you do this? in the Dashboard or in code?

woeful smelt
#

I run the code on my server side

#

I register the new account on stripe page

lean wedge
#

do you have some code you can show me for how your backend registers a domain?

woeful smelt
#

I register domian on dashboard

lean wedge
#

ok

woeful smelt
#

on this page

lean wedge
#

was there a reason you did that?

#

well it's not really easy to get the apwx_xxx ID and you shouldn't really need to keep doing this delete action multiple times, we were just trying to get your current domain fixed

#

so is your current domain working now?

woeful smelt
#

yeah it seems work well

#

I have another question

#

The conditions for Google Pay to be available seem to be very demanding,

lean wedge
#

got it. What's the question?

woeful smelt
#

The Google Pay development documentation says: Google Pay can be used on almost any browser, but when we use stripe.js it can only be used on the Chrome browser

lean wedge
#

sorry, what was the exact question?

woeful smelt
#

I want to be able to use Google Pay on a browser other than Chrome

#

but when I run the code : canMakePayment on other broswer,it always return null

lean wedge
#

ok. Clarifying questions:

which specific browser are you interested in?

The Google Pay development documentation says: Google Pay can be used on almost any browser
do you have a link to exactly where you're seeing this so I can read it in context?

woeful smelt
#

We are using Nuvei to complete Google Pay now,and it can work on other broswers

lean wedge
#

I mean we support that too, but you are using the old PaymentRequestButton product.

#

the PaymentRequestButton can only show one button at a time

woeful smelt
#

When using a non-Chrome browser, Google Pay will jump to the Google Pay web page to complete the payment, just like Paypal.

lean wedge
#

and for example on Safari that one button will always be Apple Pay(since that's something Apple have rules about)

woeful smelt
#

Ok I'll have a try

#

If Apple Pay got the same error in livemode,what can I do

lean wedge
woeful smelt
#

OK

#

thanks for your help