#hitesh1995_code
1 messages ยท Page 1 of 1 (latest)
๐ 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/1306920791920611341
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Here is the code setup to initialize payment sheet.
var configuration = PaymentSheet.Configuration()
configuration.customer = .init(id: stripeCustomerCode, ephemeralKeySecret: ephemeralKeySecret)
configuration.returnURL = "AppName://stripe-redirect"
configuration.merchantDisplayName = AppName
configuration.applePay = .init(merchantId: appleMerchantID, merchantCountryCode: countryCode)
configuration.allowsDelayedPaymentMethods = true
let paymentSheet = PaymentSheet(intentConfiguration: intentConfig, configuration: configuration)
paymentSheet.present(from: self)
Could you please share the code where you are getting the stripeCustomerCode and ephemeralKeySecret?
And could you please share a screenshot of what you're seeing right now.
Customer = cus_RA45wSEfDjb60K
ephemeralKeySecret = ek_test_YWNjdF8xNTZRTHpGYk93TWhJY3BpLDVoZTE1ZjMyWjBuQ3hrTWNtMUJKMHNoaEFXSm56SU4_002ZweUT5b
Are you fetching it from the backend?
yes
After adding card details, payment also gets successful, but for the second time when presenting the payment sheet, it does not presents with previously used card.
๐ taking over for my colleague. Let me catch up.
are you passing the ephemeral key for the second PaymentSheet?
Yes, it is used. you may check my code screenshot I've shared above.
That Customer cus_RA45wSEfDjb60K does not have any saved PaymentMethods, right? so there's nothing to show.
I've completed payment recently with the same customer.
no, you haven't, I'm sorry. Check again. You can see on https://dashboard.stripe.com/test/customers/cus_RA45wSEfDjb60K this Customer object has had no payments or other activity.
Hello @quasi knoll Arat this side. I'm a backend developer and worked with Hitesh.
@steel canopy / @tribal ice did you have any outstanding questions we can help with?
Ywas
Yes give me few min please.
@quasi knoll
Our goal is to allow users to use the same payment method across multiple connected accounts. This eliminates the need for users to re-add their payment method each time they make a payment on a different connected account.
App Flow:
- The customer is making payments to different operators (connected accounts).
- On iOS, the SDK retrieves the list of payment methods associated with the platform account.
- If no payment method exists, the user can add a card through the same UI, and this card gets associated with the platform account.
- Once the user adds the payment method, the iOS app requests our backend to create a PaymentIntent. The backend:
- Clones the platform payment method into the requested connected account.
- Creates a PaymentIntent under that connected account using the cloned payment method, ensuring that all payments are processed within the connected account.
This flow has been working well.
Issue:
After the Stripe 24.0.0 update, the card is no longer saved to the platform account after the payment is successful. This was functioning as expected before the update.
the card is no longer saved to the platform account after the payment is successful.
maybe you changed your code and stopped passingsetup_future_usageso the card is not saved?
setupFutureUsage is set to offSession
If no payment method exists, the user can add a card through the same UI, and this card gets associated with the platform account.
your claim is that the 'change'/problem exists at this point in the flow?
can you share code that's used there and a relevant ID(SetupIntent or PaymentIntent, if applicable) for that part of the flow, that is impacted by the issue you're describing
well, no, that code depends on the value of your own boolean value shouldSavePaymentMethod so perhaps that is false but you expect it to be true, you can debug that
Yes, I've confirmed for the same, and it gets set as offSession.
ok. Can I get an answer to my request above for more information and examples?
we did make some changes to the library for cloned payment methods(https://github.com/stripe/stripe-ios/issues/4195) but I don't know if your issue is related or if it's something else or a bug in your own code.
We don't seem to be making much progress and there's still a lot of missing information for us to understand your exact integration.
It's probably best that you write a detailed description of the problem, sharing complete back and frontend code(as text, not screenshot snippets of small parts) , example Intent IDs, and open a support case with that information
Here is the values for the latest payments i've done;
payment_method_id : pm_1QLNsZG8Thp5LtcOfw3xLQjP
intent_id : pi_3QLNsZG8Thp5LtcO1e9saoFm
payment_method_id : pm_1QLNxrG8Thp5LtcOXF3bvB7T
intent_id : pi_3QLNxsG8Thp5LtcO1ir1ODbP
you're passing setup_future_usage but you don't pass any customer when you create the PaymentIntent, so it doesn't attach the PaymentMethod to anything.
these also seem to be examples from the connected account, it's the "Creates a PaymentIntent under that connected account using the cloned payment method" section @tribal ice described, but your actual problem/question is before that, it's about how you create that PaymentMethod that you then later clone. That's the part that I need to see code and examples for since it's where you say the problem is.
so you need backend code to check?
I need front and back end code and example object IDs.
This is a pi :- pi_3QLLvxG8Thp5LtcO1UUm5XYd of create intent
Request id :- req_7QRkLPKpmSOEpr
hi! I'm taking over this thread.
I don't really see an issue with the PaymentIntent you shared, except that it had status: "requires_capture", but you never captured the funds.
Here is the code for iOS app. makePayment function is being called from particular controller with required parameter values to create payment intent and to be used at relevant places.
If I understand correctly, when you clone the payment method on the connected account, you would like the card to be saved on the customer object so you can reuse it in the future, instead of having to re-clone the card for every payment?
we actually recommend to re-clone the payment method every time you want to make a charge. this is explained in this short video that I recommend watching: https://www.youtube.com/watch?v=X-VKDdk052Q
No we are doing the same way.. Re-cloning payment method every time.. But problem is the card in not saved in platform account.. so the customer have to put card details everytime
can you share a Payment Method ID (pm_xxx) on the platform that wasn't saved?
Yeah @tribal ice Will share you now.
pm_1QLLvxG8Thp5LtcOphZKVADc
this is an ID on the connected account. here's the original Payment Method from the paltform: pm_1QI6NpFbOwMhIcpi4sIXjwZX
and this PM was setup for future usage, so you can reuse it.
Ahh yeah my bad.. i shared wrong payment method..
But did you check if this payment method is actually linked with the platform customer ?
Because when we try second time.. there is no payment method linked with the same customer.
But did you check if this payment method is actually linked with the platform customer ?
pm_1QI6NpFbOwMhIcpi4sIXjwZX belongs to the platform account acct_156QLzFbOwMhIcpi. and this Payment Method can be reused.
Because when we try second time.. there is no payment method linked with the same customer.
I don't understand this sentence. can you share a specific request ID that failed?
As you described above.. that this payment method was setup for future use
So if the same customer is trying to make payment second time, That same payment method should be listed in payment sheet right ? But it is not, that same customer is adding again card details
@steel canopy Could you share the requestId when fetching payment method from platform
it depends. that payment method is stored on the platform account. so you would only see it in the payment sheet if you are using the customer object from the platform account.
Sorry i don't understand that
pm_1QI6NpFbOwMhIcpi4sIXjwZX is stored on the platform account for this customer: cus_RARFaxAKzWykqU. are you using this customer in the Payment Sheet?
okay let me give you another customer information where there are no payment methods even if we are adding it
Customer ID : cus_RA45wSEfDjb60K
Platform Payment method id : pm_1QLNxqFbOwMhIcpiGac8aB8V
We made successfull payment in one of connect account.. Also we had set future use true... But that card is not saved into that customer
that payment method was never attached to the customer you shared. if you look at that customer in your dashboard, you will see no payments and no payment method saved: https://dashboard.stripe.com/test/customers/cus_RA45wSEfDjb60K
So this payment method will be attached ?
I mean in our flow where customer is making payment under connect account.. IOS is showing payment sheet for platform use.. Customer is adding card details.. After adding card details it return payment method.. We clone that payment method to connect account and create intent under the same connect account and payment paid
in second time.. payment sheet shows empty list
Because 1 month ago with older version, Payment method was was automatically attaching to customer using same flow
I recommend explain your issue to Stripe Support directly, they will have more time to investigate.
Please make to explain your issue clearly, by describing your payment flow, including relevant object ID (customer ID, payment Method ID), and adding your code (backend and frontend).
https://support.stripe.com/contact
The thing is we already had raised one issue on github 1 week before about the stripe update 24.0.0 : https://github.com/stripe/stripe-ios/issues/4222
Stripe devs fixed it today morning but it took more then 1 week
So that's why we wanted to know if we are doing something wrong or there is another issue with stripe
Summary I am using same setup as reference link : https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=ios Getting success when making payment with new card (in case no card ha...
Makes sense, but this thread has been running for over 3 hours now. To help with complex issues, the best option is to contact Stripe Support since they will have more time to look into this issue: https://support.stripe.com/contact