#ortegagroup_api

1 messages ยท Page 1 of 1 (latest)

near craterBOT
#

๐Ÿ‘‹ 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/1279087657233809412

๐Ÿ“ 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.

rugged fossilBOT
azure marlin
#

Hello
Functionally, PaymentSheet does not have a dependency on webhook endpoints

#

the sheet to select the user's payment method cannot be displayed, the client_secret, ephemeralKey, publishableKey and customerId arrive correctly to the client.
What do you mean by that exactly? Can you elaborate?

celest bramble
#

I don't understand why it doesn't work.

azure marlin
#

Are you following any guides

celest bramble
#

I'm replicating the same code from Stripe's own documentation for SwiftUI language and still no success.

#

In order not to give you so much text, I will send you the link to the example that is in a stripe git repository

azure marlin
celest bramble
#

Yes, the Xcode console error is as follows:

Error Domain=com.stripe.lib Code=50 "There was an unexpected error -- try again in a few seconds" UserInfo={com.stripe.lib:StripeRequestIDKey=req_Pqrwfhg72jCjl6, com.stripe.lib:StripeErrorCodeKey=resource_missing, com.stripe.lib:ErrorMessageKey=No such payment_intent: 'pi_3PtOWOAZJHGoU7Pr0JPbkyEy', com.stripe.lib:StripeErrorTypeKey=invalid_request_error, NSLocalizedDescription=There was an unexpected error -- try again in a few seconds, com.stripe.lib:hintKey=No matching PaymentIntent could be found. Ensure you are creating a PaymentIntent server side and using the same publishable key on both client and server. You can find more information at https://stripe.com/docs/api/payment_intents/create, com.stripe.lib:ErrorParameterKey=intent}

#

I understand that a payment method is missing, but the payment sheet is for the user to choose the payment method, I don't understand.

azure marlin
#

You're using wrong API keys in your code

celest bramble
azure marlin
#

You're trying to access it using API keys that belong to acct_1Pe15fHKD95FdBqC

celest bramble
#

Where do I see that API key? Sorry.

azure marlin
#

Not sure what you mean by that? Do you mean in your code or on Stripe?

celest bramble
#

My code, this acct_1Pe15fHKD95FdBqC where can I find it?

azure marlin
#

You can't find the account ID in your code but you must be setting pk_test_xxx in your iOS app somewhere. That key belongs to acct_1Pe15fHKD95FdBqC

#

You should use pk_test_xxx that belongs to acct_1PlxwpAZJHGoU7Pr instead

#

If you're using the same code as the guide then your publishableKey comes from your server. So you'd want to make sure you're returning the right key

celest bramble
#

Okay, can you give me a few minutes to fix that?

azure marlin
#

sure

celest bramble
#

I already checked in the backend that the publishable key I was sending as a response is different from the one in my Stripe control panel. Now I compile and test, please don't leave me lol

azure marlin
#

NP! ๐Ÿ™‚ Take your time

celest bramble
#

Your are very smart!! lol

#

Yes it works!

azure marlin
#

Awesome

celest bramble
#

I have a one question

azure marlin
#

Sure

celest bramble
#

I entered a test credit card 4242, and I selected save payment method for future payments, but when I exit the application and compile again, that payment is not saved. How can I implement this?

azure marlin
#

Does your API create a new customer each time you try to initiate a new payment?

You'd need to make sure you're re-using the same customer

celest bramble
#

That happens, it creates a new customer when paying again.

#

Should I modify the endpoint?

azure marlin
#

Yup

celest bramble
#

Or create a new endpoint for this case

azure marlin
#

Upto you

#

on how you want to handle it

#

but you'd only see saved payment methods if you're re-using the customer

celest bramble
#

Only with ephemeralKey?

azure marlin
#

ephemeralKey should belong to the customer you're reusing, yes

celest bramble
#

Is there documentation to view it and know how to implement it correctly? If so, could you provide it to me?

#

Thank you very much!

azure marlin
#

Hmm we don't have any specific docs for that unfortunately

In your API, instead of doing
const customer = await stripe.customers.create()

You'd want to change it to for example, a retrieve call where you fetch an existing customer instead

celest bramble
#

I implemented something but it was in the frustrating process of so many attempts that I commented on it on the server, I attached it in an image so you can take a look if it is well implemented.

azure marlin
#

yup that makes sense

#

you'd just need to make sure customerId is a valid cus_xxx ID

#

otherwise you'd see API errors

celest bramble
#

Excellent, I really appreciate the help Hanzo. I was already getting frustrated.

azure marlin
#

NP! Happy to help

celest bramble
#

You can leave it open in the chat because I will be working on finalizing those details and I may need help again.

near craterBOT
celest bramble
#

Hanzo are you there?

thorn gust
#

Hi there ๐Ÿ‘‹ taking over, as my colleague needs to step away

How can we help?

celest bramble
#

I have this view in my iOS app, but I want to display the cards that the user saves in stripe. Is this possible?

thorn gust
#

Which Stripe SDK are you using?

celest bramble
#

iOS for SwiftUI

thorn gust
#

Let me see if I can get you a mobile engineer. Someone will circle back in a few

azure marlin
#

Hello again

#

@celest bramble I believe CustomerSheet should help with what you're looking for

celest bramble
#

Excellent, don't you recommend what I'm doing?

#

I say this because customerSheet requires a setupIntent.

azure marlin
#

Not sure I follow. Are you trying to show saved payment methods outside the PaymentSheet flow correct?

#

If so, SetupIntent is expected

#

as CustomerSheet allows you to store payment methods too

celest bramble
#

Yes

#

In the PaymentSheet and outside the PaymentSheet since you can configure a payment method without making a purchase.

azure marlin
#

PaymentSheet takes care of Storing the payment method automatically and does not require a SetupIntent..

Outside PaymentSheet, you can use CustomerSheet

#

Totally upto you on how you want to model it in your API as long as the CustomerSheet adapter is getting the right values it needs

celest bramble
#

Excellent

#

Thank you very much

azure marlin
#

Happy to help ๐Ÿ™‚