#skrall5

1 messages · Page 1 of 1 (latest)

proper totemBOT
serene nymph
#

đź‘‹ hi there

#

Which navigation do you use from your initial screen?

cerulean wind
#

Hello, currently we’re using NavigationLink and NavigationView for going between screens

serene nymph
#

Yeah I remember people having issue with NavigationLink and ApplePay before. Just to confirm, are you using ApplePay directly instead of PaymentSheet?

serene nymph
#

And if you try PaymentSheet would you see the same issue?

#

How is the ApplePay sheet? Would appreciate a screenshot or a screen recording

serene nymph
#

Hey, looks like you are not active. Please write to Support mention this thread, and include

  1. A minimal project which can reproduce the issue
  2. Any credentials needs to reach the payment page, and instructions to do so
  3. A screenshot or screenrecording (better!) on your side.

We would be happy to look closer into it!

serene nymph
#

Hi @cerulean wind

proper totemBOT
cerulean wind
#

Hey, thanks for reopening!

#

This is an example ofthe code I have for displaying: if let applePayContext = STPApplePayContext(paymentRequest: paymentRequest, delegate: self) {
// Present Apple Pay payment sheet
variableName = 1 applePayContext.presentApplePay(on: self)
} else {
// There is a problem with your Apple Pay configuration
}

serene nymph
cerulean wind
cerulean wind
#

The first screen is the one the app opens up to and I just switched buttons to call the whole Apple Pay function instead of their original purpose for the demonstration

brittle hare
#

Hi there. Orakaro had to step out

#

Let me get a colleague with more ios experience to step in.

cerulean wind
#

No worries

brittle hare
#

Will just be 1 moment

#

Hang on

terse flicker
#

Hello đź‘‹

#

I believe you already have a support case with our team

#

I see we responded to your issue yesterday with a suspected bug in your code

cerulean wind
#

We had a support case before but we’ve encountered another issue after fixing that problem

#

So our original problem was what we had now, but somehow when I’m the process of sending over the code, that other bug was added

#

With that bug the resulting Apple Pay message was “Payment Failed”whereas this one is “payment not completed”

terse flicker
#

Can you share the PaymentIntent you're working with in the video?

cerulean wind
#

The failed case or the successful case?

terse flicker
#

Both

cerulean wind
#

Is it ok if I recreate it again and share those payment intents instead? Not sure where on the dashboard those other ones are

terse flicker
#

sure

cerulean wind
#

Right, I just wasn’t sure which ones were the ones I’d demonstrated with

#

Looking over the most recent logs I only see one payment intent created for my most recent recreation of the issue

#

That would be ""pi_3NvmEUIlTgpKFZsm1kZTZJ6k""

#

Do you want the logs for the function calls?

#

I have those if they would help

terse flicker
#

additionally, I see you're running the test in livemode
Do you have any addtional logging in your app?

#

ah yes

#

please

#

The PaymentIntent ID you shared, seems to have succeded

cerulean wind
#

succeeding case: presenting
2023-09-29 12:20:13.511379-0700 LaundryBud[3524:1174422] LOG ANALYTICS: ["product_usage": ["STPApplePayContext"], "analytics_ua": "analytics.stripeios-1.0", "os_version": "16.6.1", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "token_type": "apple_pay", "apple_pay_enabled": 1, "bindings_version": "23.11.2", "pay_var": "legacy", "device_type": "iPhone13,2", "app_version": "1.2.0", "install": "S", "app_name": "LaundryBud", "event": "stripeios.token_creation", "network_type": "Wi-Fi", "additional_info": [], "ocr_type": "none"]
2023-09-29 12:20:14.039886-0700 LaundryBud[3524:1174422] LOG ANALYTICS: ["source_type": "card", "os_version": "16.6.1", "event": "stripeios.payment_method_creation", "bindings_version": "23.11.2", "product_usage": ["STPApplePayContext"], "additional_info": [], "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "analytics_ua": "analytics.stripeios-1.0", "app_name": "LaundryBud", "ocr_type": "none", "device_type": "iPhone13,2", "install": "S", "network_type": "Wi-Fi", "pay_var": "legacy", "apple_pay_enabled": 1, "app_version": "1.2.0"]
starting
made it to url
made it inside checkout
2023-09-29 12:20:15.105119-0700 LaundryBud[3524:1174422] LOG ANALYTICS: ["device_type": "iPhone13,2", "event": "stripeios.payment_intent_confirmation", "network_type": "Wi-Fi", "ocr_type": "none", "app_version": "1.2.0", "apple_pay_enabled": 1, "analytics_ua": "analytics.stripeios-1.0", "pay_var": "legacy", "product_usage": ["STPApplePayContext"], "os_version": "16.6.1", "app_name": "LaundryBud", "bindings_version": "23.11.2", "additional_info": [], "install": "S", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "source_type": "unknown"]
other func
payment success!

#

failing case: presenting
2023-09-29 12:20:29.564484-0700 LaundryBud[3524:1174422] LOG ANALYTICS: ["app_name": "LaundryBud", "app_version": "1.2.0", "network_type": "Wi-Fi", "token_type": "apple_pay", "event": "stripeios.token_creation", "device_type": "iPhone13,2", "pay_var": "legacy", "os_version": "16.6.1", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "apple_pay_enabled": 1, "ocr_type": "none", "install": "S", "additional_info": [], "bindings_version": "23.11.2", "analytics_ua": "analytics.stripeios-1.0", "product_usage": ["STPApplePayContext"]]
2023-09-29 12:20:29.963777-0700 LaundryBud[3524:1174422] LOG ANALYTICS: ["os_version": "16.6.1", "app_version": "1.2.0", "app_name": "LaundryBud", "network_type": "Wi-Fi", "install": "S", "bindings_version": "23.11.2", "source_type": "card", "event": "stripeios.payment_method_creation", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "product_usage": ["STPApplePayContext"], "device_type": "iPhone13,2", "ocr_type": "none", "analytics_ua": "analytics.stripeios-1.0", "pay_var": "legacy", "additional_info": [], "apple_pay_enabled": 1]
2023-09-29 12:21:45.370161-0700 LaundryBud[3524:1175493] [tcp] tcp_input [C7.1.1.1:3] flags=[R.] seq=3030625523, ack=2501048951, win=111 state=LAST_ACK rcv_nxt=3030625523, snd_una=2501048951
2023-09-29 12:21:45.372759-0700 LaundryBud[3524:1175493] [tcp] tcp_input [C7.1.1.1:3] flags=[R] seq=3030625523, ack=0, win=0 state=CLOSED rcv_nxt=3030625523, snd_una=2501048951
2023-09-29 12:21:45.380109-0700 LaundryBud[3524:1175493] [tcp] tcp_input [C7.1.1.1:3] flags=[R] seq=3030625523, ack=0, win=0 state=CLOSED rcv_nxt=3030625523, snd_una=2501048951

#

"presenting is printed when it starts presenting, and "starting" is printed at the start of the func applePayContext(_ context: STPApplePayContext, didCreatePaymentMethod paymentMethod: StripeAPI.PaymentMethod, paymentInformation: PKPayment, completion: @escaping STPIntentClientSecretCompletionBlock) function

terse flicker
#

Can you share the complete code you're working with here?

cerulean wind
#

Sure

#

Screen8 (the first screen) instantiates this variable:
var applePayController = CheckoutViewController()
and then does this on button press:
applePayController.handleApplePayButtonTapped()

#

Screen12(the second screen) instantiates this variable:

#

var applePayController = CheckoutViewController()

#

And then does this on button press:
applePayController.handleApplePayButtonTapped()

terse flicker
#

and you mentioned that this only happens in live mode, correct?

cerulean wind
#

I believe that's the case, let me try a test mode run right now just to verify

terse flicker
#

👍 it seems like token creation is timing out but not sure how to confirm that, thinking..

cerulean wind
#

I just tested multiple times and it seems the issue is happening in test mode too

#

Same situation, first screen works, second screen timeouts

terse flicker
#

Oh actually, looking at your API log

It looks like the token gets created and payment methods are created successfully but it never invokes didCreatePaymentMethod callback

Like the pattern I observe in your account's API log is following:

For successful payment,
1/ Token gets created: https://dashboard.stripe.com/logs?starting_after=1696015214-req_LtQ5GsmuseNF6c
2/ Payment method gets created: https://dashboard.stripe.com/logs?starting_after=1696015214-req_LtQ5GsmuseNF6c
3/ PaymentIntent gets created: https://dashboard.stripe.com/logs?starting_after=1696015214-req_Un9b6wRwV3UtzV
4/ PaymentIntent gets confirmed: https://dashboard.stripe.com/logs?starting_after=1696015214-req_E4cKWyILMfMNRV

Then you attempt to do it from the other screen,
1/ Token gets created: https://dashboard.stripe.com/logs?starting_after=1696015229-req_L2elItS0Lzw33y
2/ Payment method gets created: https://dashboard.stripe.com/logs?starting_after=1696015230-req_fAxnUzBKL5vaVV
Then nothing...

#

didCreatePaymentMethod callback not getting invoked, results in no PaymentIntent getting created

cerulean wind
#

That's the same issue I was thinking

#

Because on a failed payment "starting" never gets printed

terse flicker
#

Apple Pay API waits for a PaymentIntent to be confirmed but times out

#

If I remember correctly, it waits for about 30 seconds or so

#

hmm didCreatePaymentMethod not getting invoked might be due to some delegate context getting mixed up or lost

cerulean wind
#

How would I test or verify that the delegate context getting messed up?

terse flicker
#

Good question, not sure.. thinking..

terse flicker
#

There are no additional logs aside from what you shared in the case where Apple Pay just times out right?

cerulean wind
#

The only other log is a firebase analytics one if I recall correctly

#

I'll run it again to make sure

terse flicker
#

I'd also recommend checking your server-side logs just in case

#

Maybe your API call to your server is failing

cerulean wind
#

Well the server is called in the applePayContext function

terse flicker
#

Ah true nvm

#

was just about to say

cerulean wind
#

All good

#

I'll check for any other local logs rn

#

So this is the full log after pressing the button on the second screen

presenting
2023-09-29 13:15:44.151898-0700 LaundryBud[3605:1205781] 9.6.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
2023-09-29 13:15:51.900023-0700 LaundryBud[3605:1205115] LOG ANALYTICS: ["apple_pay_enabled": 1, "additional_info": [], "install": "S", "analytics_ua": "analytics.stripeios-1.0", "app_name": "LaundryBud", "token_type": "apple_pay", "os_version": "16.6.1", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "event": "stripeios.token_creation", "pay_var": "legacy", "bindings_version": "23.11.2", "app_version": "1.2.0", "product_usage": ["STPApplePayContext"], "device_type": "iPhone13,2", "network_type": "Wi-Fi", "ocr_type": "none"]
2023-09-29 13:15:52.466535-0700 LaundryBud[3605:1205115] LOG ANALYTICS: ["install": "S", "device_type": "iPhone13,2", "bindings_version": "23.11.2", "source_type": "card", "network_type": "Wi-Fi", "additional_info": [], "event": "stripeios.payment_method_creation", "app_version": "1.2.0", "pay_var": "legacy", "app_name": "LaundryBud", "publishable_key": "pk_live_51MoiD3IlTgpKFZsmV9oeXxNhtRetfNv5YttRv3IN41DBYXgIp3oFZRPS92w2kPw5Vsdr9k8wf3YFzId32CTxgbhP00Tko7WpfJ", "os_version": "16.6.1", "apple_pay_enabled": 1, "ocr_type": "none", "product_usage": ["STPApplePayContext"], "analytics_ua": "analytics.stripeios-1.0"]

#

And then usually a couple of minutes later logs like this will start showing up

2023-09-29 13:16:34.552313-0700 LaundryBud[3605:1205748] [MADService] Client XPC connection invalidated
2023-09-29 13:17:07.771021-0700 LaundryBud[3605:1206297] [tcp] tcp_input [C10.1.1.1:3] flags=[R.] seq=1527973610, ack=131807642, win=114 state=LAST_ACK rcv_nxt=1527973610, snd_una=131807642
2023-09-29 13:17:07.773245-0700 LaundryBud[3605:1206297] [tcp] tcp_input [C10.1.1.1:3] flags=[R] seq=1527973610, ack=0, win=0 state=CLOSED rcv_nxt=1527973610, snd_una=131807642

terse flicker
#

Gotcha. Hmm, just a theory but could you try duplicating CheckoutViewController class?
Let's say name it AnotherCheckoutViewController, same code as the other file.

I am curious to see what happens if you don't re-use the same ViewController for both flows

cerulean wind
#

Same result

terse flicker
#

ugh okay, I think I ran out of ideas on this. Sorry!

I'd recommend that you write in via the support ticket with the latest version of your code, we'd need to take a deeper look which won't be possible on discord.
https://support.stripe.com/?contact=true

#

We'll need to take a look at the code and reproduce

cerulean wind
#

All good, I'll contact support and see where it goes from there.

#

Thanks for your help and time

terse flicker
#

NP! 🙂 Happy to help