#hitesh1995_code

1 messages ยท Page 1 of 1 (latest)

wicked islandBOT
#

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

steel canopy
#

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)

languid ridge
#

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.

steel canopy
#

Customer = cus_RA45wSEfDjb60K
ephemeralKeySecret = ek_test_YWNjdF8xNTZRTHpGYk93TWhJY3BpLDVoZTE1ZjMyWjBuQ3hrTWNtMUJKMHNoaEFXSm56SU4_002ZweUT5b

languid ridge
steel canopy
#

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.

wicked islandBOT
plain yarrow
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

plain yarrow
steel canopy
#

Yes, it is used. you may check my code screenshot I've shared above.

quasi knoll
#

That Customer cus_RA45wSEfDjb60K does not have any saved PaymentMethods, right? so there's nothing to show.

steel canopy
#

I've completed payment recently with the same customer.

quasi knoll
tribal ice
#

Hello @quasi knoll Arat this side. I'm a backend developer and worked with Hitesh.

quasi knoll
#

@steel canopy / @tribal ice did you have any outstanding questions we can help with?

tribal ice
#

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:
    1. Clones the platform payment method into the requested connected account.
    2. 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.

quasi knoll
#

the card is no longer saved to the platform account after the payment is successful.
maybe you changed your code and stopped passing setup_future_usage so the card is not saved?

steel canopy
#

setupFutureUsage is set to offSession

quasi knoll
#

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

quasi knoll
steel canopy
#

Yes, I've confirmed for the same, and it gets set as offSession.

quasi knoll
#

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

steel canopy
#

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

wicked islandBOT
quasi knoll
#

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.

steel canopy
#

so you need backend code to check?

quasi knoll
#

I need front and back end code and example object IDs.

tribal ice
#

This is a pi :- pi_3QLLvxG8Thp5LtcO1UUm5XYd of create intent

#

Request id :- req_7QRkLPKpmSOEpr

hushed pine
#

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.

steel canopy
#

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.

hushed pine
#

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?

cold inlet
#

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

hushed pine
#

can you share a Payment Method ID (pm_xxx) on the platform that wasn't saved?

cold inlet
#

Yeah @tribal ice Will share you now.

tribal ice
#

pm_1QLLvxG8Thp5LtcOphZKVADc

hushed pine
#

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.

cold inlet
#

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.

hushed pine
#

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?

cold inlet
#

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

hushed pine
#

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.

cold inlet
#

Sorry i don't understand that

hushed pine
#

pm_1QI6NpFbOwMhIcpi4sIXjwZX is stored on the platform account for this customer: cus_RARFaxAKzWykqU. are you using this customer in the Payment Sheet?

cold inlet
#

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

hushed pine
cold inlet
#

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

hushed pine
#

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

cold inlet
#

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

GitHub

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...

hushed pine
#

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