#a.r.1

1 messages ยท Page 1 of 1 (latest)

rough whaleBOT
dawn hound
#

Yeah I can't find a request with that ID either

#

Can you share the request id for creating your session on the backend? Also would help to see client side and server side code snippets for this

harsh nymph
#

Request id: req_kaUcaK4tiBei3T

#

I can get backend code later, but it works outside of SDK (Frontend is using the same endpoint to create a session)

#

Talking about iOS, I'm just creating sheet with secret I received from BE.

#

FinancialConnectionsSheet(financialConnectionsSessionClientSecret: secret)

dawn hound
#

Got it so the backend is already working with web code?

#

Then can you share more of your ios code

harsh nymph
#

I have just one single import : import StripeFinancialConnections, not sure if it could matters

#

import StripeFinancialConnections
import XYZFoundation

class XYZFinancialConnectionsSheet {
static func presentSheet(with secret: String) {
let sheet = FinancialConnectionsSheet(financialConnectionsSessionClientSecret: secret)
if let controller = controllerStackBehavior.topViewController {
sheet.present(from: controller) { result in
print(result)
}
}
}
}

#

All code I use to present sheet. Secret is clientSecret from created session.

dawn hound
#

Can you share the part where you actually call your backend?

#

And how the secret variable is set

harsh nymph
#

let clientSecret = try await viewModel.createFinancialConnectionSession()
if let clientSecret {
WTFinancialConnectionsSheet.presentSheet(with: clientSecret)
}

#

viewModel.createFinancialConnectionSession is just a simple graphql mutation with just single field in response - secret.

#

I debugged this, I see secret received and format is correct.

#

This is how session is created on BE:

#

params := &stripe.FinancialConnectionsSessionParams{
AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{
Type: stripe.String(
string(stripe.FinancialConnectionsSessionAccountHolderTypeAccount)),
Account: stripe.String(accountID),
},
Filters: &stripe.FinancialConnectionsSessionFiltersParams{
Countries: []*string{stripe.String(models.CountryUS)},
},
Permissions: []*string{
stripe.String(string(stripe.FinancialConnectionsSessionPermissionPaymentMethod)),
stripe.String(string(stripe.FinancialConnectionsSessionPermissionBalances)),
},
}

#

Account params:

#

params := &stripe.AccountParams{
// set account type to be custom
Type: stripe.String(string(stripe.AccountTypeCustom)),
// set payout schedule to daily, it can also be configured in dashboard
Settings: &stripe.AccountSettingsParams{
Payouts: &stripe.AccountSettingsPayoutsParams{
DebitNegativeBalances: stripe.Bool(true),
Schedule: &stripe.AccountSettingsPayoutsScheduleParams{
Interval: stripe.String(
string(stripe.AccountSettingsPayoutsScheduleIntervalDaily)),
},
},
},
// set capabilities
Capabilities: &stripe.AccountCapabilitiesParams{
CardPayments: &stripe.AccountCapabilitiesCardPaymentsParams{
Requested: stripe.Bool(true),
},
Transfers: &stripe.AccountCapabilitiesTransfersParams{
Requested: stripe.Bool(true),
},
TaxReportingUS1099K: &stripe.
AccountCapabilitiesTaxReportingUS1099KParams{
Requested: stripe.Bool(true),
},
},
}

#

I was thinking maybe I missed some of spm packages, but now I'm importing this list and still getting error.

dawn hound
#

Ok I gotcha. And to confirm the backend code already works with your web integration?

harsh nymph
#

yes

dawn hound
#

This is a very common way this error presents itself

#

So I would be extremely sure on this

harsh nymph
#

I don't see any spaces or something

#

I see apiClient.stripeAccount is nil here, not sure if it could be related.

#

I don't see anything wrong with key format

dawn hound
#

Sorry for the delay

#

Wait where is stripeAccount nil exactly?

#

Key format looks ok

rough whaleBOT
dawn hound
#

As long as you log it on the server and it matches

harsh nymph
#

init in HostController

#

should I see anything in logs for this presenting error at all? I guess I don't see anything related to financial connections apart from creating session on BE

#

any chance this secret was badly configured/ missing permissions?

dawn hound
#

No I think it's a client side issue. Have you tried re-running the request to get a new client secret

#

Likely you'll get same error

harsh nymph
#

Yes, tried this, same error

dawn hound
#

Getting a colleague with more ios knowledge to look

#

I think it's a client side issue. What version of the stripe ios sdk are you using

harsh nymph
#

Any chance it is something related to beta state of the Sdk?

random apex
#

Hi ๐Ÿ‘‹

I'm stepping in as @dawn hound needs to go soon. To be clear, I AM NOT the iOS expert ๐Ÿ˜…

#

What SDK are you referring to?

harsh nymph
#

23.13.0

random apex
#

When you say the beta state?

harsh nymph
#

I guess Financial Connections iOS SDK is in beta?

random apex
#

Got it, that could be at play here.

#

There is a lot of back and forth here so can you please summarize what flow you are trying to do and exactly where the breakdown is?

harsh nymph
#

Mostly what I said in initial message

#

I'm trying to use Financial Connection iOS SDK to update account we have on file in the app. After receiving client key from backend, I receive a following error when try to present FinancialConnectionsSheet. Error is : This is not a valid Financial Connections Session client_secret.

random apex
#

Okay let's break that down further

  1. you want to update an existing us_bank_account payment method for a Customer?
  2. Are you collecting new bank information?
  3. Do you want to create a new us_bank_account Payment Method?
harsh nymph
#
  1. correct
#
  1. no, I guess this is what this sheet from SDK should do for me
#
  1. not right now, but this option is good to have
random apex
#
  1. So yes, you are collecting new Account and Routing numbers using the FinancialConnectionSheet?
harsh nymph
#

I got an error, so I don't collect anything

#

The whole conversation is about this issue, I would be happy to use this sheet, but I cannot

random apex
#

I know you just had this conversation but I'm helping multiple people in parallel so it helps if I can get a quick summary.

Can you share an example client_secret ?

harsh nymph
#

fcsess_client_secret_6ZA1zzhQTtBun022sHhdifgW

random apex
#

Okay I think there is some account confusion occurring here.

#

But the requests coming from your iOS app are for acct_1AuRvhCKg9WpKK5Y

harsh nymph
#

how is it possible? are you sure you checking matching session and request?

random apex
#

These are the requests I am seeing. Can you take the time to verify that both the Secret Key in your back-end and the Publishable Key in your front-end match those for one specific Stripe Account?

harsh nymph
#

If it could help, I use Payment Sheet in my app for customer purchases and don't have any problems there.

#

Still not sure how could it be different account, if I just use secret key I received from backend? I don't use any other authorization besides secret key and Publishable Key. Checking backend for matching, will keep you posted.

random apex
#

Is it possible that the code you used to create the Financial Connection Session is using a different Secret Key (which would make requests on a different account)?

harsh nymph
#

I'll double check the code to create the Financial Connection Session on backend and come back to you

random apex
#

Great, thanks for looking into it

harsh nymph
#

Ok, I got secret key from BE and publishable key from IOS, they are obviously different, but how can I check if it is affecting my use case?

random apex
#

Well the Secret Key and Publishable Keys should be different, they are different keys. What matters here is whether both keys correspond to the same Stripe Account