#ortegagroup_code

1 messages ยท Page 1 of 1 (latest)

edgy onyxBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1286061685781565566

๐Ÿ“ Have more to share? Add more 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.

hazy wind
#

Hello

#

Can you explain a bit more what exactly is happening? It would also help if you have a screen recording that you could share as well.

cosmic frigate
#

hell bismarck

#

I'll send you a screen recording right now of how it works for both Apple Pay and for inserting a card.

hazy wind
#

Great, thanks

cosmic frigate
#

The payment is not processed and the screen remains blank.

hazy wind
#

Okay let's start with Apple Pay

#

First, it looks like there is an alert with an error

#

What does that say?

#

And have you added a log within your applePayContext function to make sure it makes it to your completion block?

cosmic frigate
#

I'm using SwiftUI architecture, without ViewController. Is it the same?

hazy wind
#

I'm not an iOS dev but ViewController should not matter afaik

#

Are you calling StripeAPI.deviceSupportsApplePay()?

#

Ah wait that is just for the device you are testing with.

#

That error indicates an issue with your Apple Pay Certificate I think

cosmic frigate
hazy wind
#

Did you create an Apple Pay Cert?

cosmic frigate
#

Yes

hazy wind
#

And you added the Apple Pay capability with the correct Apple Merchant ID?

cosmic frigate
#

Yes

edgy onyxBOT
hazy wind
#

I'd recommend recreating your cert and double checking all of that setup

cosmic frigate
#

That's fine

hazy wind
#

For the second issue, when adding a Card through Payment Sheet, it looks like the Payment Sheet dismissed just fine.

#

What is your code doing after Payment Sheet completes?

cosmic frigate
#

It remains blank

hazy wind
#

Ah

#

You just are doing: if case .completed = result { // A PaymentIntent can't be reused after a successful payment. Prepare a new one for the demo. self.paymentSheet = nil preparePaymentSheet() }

#

So yeah

#

You don't do anything

#

Which is why the screen is blank

#

That all seems expected...

#

you need to write code to handle what happens at that point

cosmic frigate
#

Do I add a dismiss.callAsFunction or a boolean that closes the sheet and navigates the user out of the checkout process at that point?

hazy wind
#

You don't have to do anything to close the sheet. Once it closes your paymentResult block is called.

#

Then generally you would navigate your customer to a confirmation screen or something that indicates to them their purchase was successful

cosmic frigate
#

Excellent, it helped me a lot and I also verified that the certificate configured in Stripe was an old one.

#

Thank you very much, after so many attempts one does not see those details.

hazy wind
#

๐Ÿ‘

cosmic frigate
#

Give me a few minutes to verify that this is the error.

#

I have another question, I have the backend hosted on render.com but if I retrieve the customerId to be able to correctly display the paymentSheet, why doesn't it load? I see the render logs and it shows me the console.log that should be displayed when the /checkout endpoint is called but it doesn't load and takes too long. What is the reason if the backend correctly receives the call?

#

This is the Xcode log I put that calls the function that communicates with the backend

ivory sage
#

๐Ÿ‘‹ stepping in for my teammate, give me a few minutes

cosmic frigate
#

๐Ÿ‘

ivory sage
#

What does your frontend code look like for this?

cosmic frigate
#

.onAppear {
updateAmount()

            let total = totalAmount(subtotal: subtotal, taxes: salesTax)

// model.preparePaymentSheetWithCheckoutFlow(totalAmount: Int(total), location: orderCompleted.Store)
model.preparePaymentSheetWithCheckoutFlow(totalAmount: Int(total))

        }

This code is for when the view appears where the function that communicates with the backend is called

ivory sage
#

Got it. Give me a few minutes, I'm getting help from a teammate

gritty bone
#

Hello again! Can you add way more logging to your code to see how far it gets in the process and where exactly it's getting stuck?

cosmic frigate
#

What happens is that it takes a while for the button to choose the payment method and the actual button to pay to appear. Finally, the user (me) has to close the application and reopen it for it to load correctly.

#

Followed by that when the payment is successful the success sheet is displayed and closed automatically.

gritty bone
#

So to clarify, it does work, but it takes too long and takes extra steps?

cosmic frigate
#

Exactly, but in the Xcode console it tells me that the customerId was sent to the backend and the backend responds that it received it, so I don't understand what slows down the process if the communication is carried out effectively.

gritty bone
#

That's why I recommended adding more logging, so you can see exactly where it's getting stuck.

#

In order to move forward you need to narrow down the exact line of code where it's getting stuck, then figure out why that's happening.

cosmic frigate
#

Oh okey.

#

Can I ask something else?

gritty bone
#

Yes.

cosmic frigate
#

I was able to resolve the payment issue, it is late or not processed. It's good

#

But for example, when the keyboard is displayed to insert a new card as a payment method, when you complete the form and close it, the screen goes blank.

gritty bone
#

Okay. What's your question?

cosmic frigate
#

Why?

#

Why does the screen go blank if I have to enter card details?

#

Sorry

cosmic frigate
gritty bone
#

I can't tell from here. You need to add more logs to your code to figure out exactly what happens leading up to that, and why the expected code after that doesn't get called.

cosmic frigate
#

That's fine

#

Thank you very much

gritty bone
#

Happy to help!

cosmic frigate
#

One questions, are you iOS developer?

gritty bone
#

I've built iOS apps in the past, but I don't know Swift UI very well.

#

I'm much better at UIKit and Objective-C. ๐Ÿ˜…

cosmic frigate
#

Oh good

#

Thank you very much rubeus!