#papiwablo
1 messages ยท Page 1 of 1 (latest)
hello! how can I help?
i need help adding a debt card in iOS for a user's connect account
my back end guy is passing me some sort of connectID
what is the process on the front end, for iOS once I have the connectID to save a debit card
can it accept input from the
let paymentMethodParams = self.cardTextField.paymentMethodParams
and is there a doc or reference for the handler?
๐ @keen bay could you elaborate on what exactly the Doc you are following? And an example of the connectID? Is it a Connected Account Id?
honestly im looking for anything promising
i want sellers on the platform to save a debit card
this debit card will be used to push their funds into their bank accounts
I get that, but the link about is mostly about the part "collect payments" rather than payout
While you seem to want the logic to register the debit card for your connected account for their payout
then why is the labelled with "then pay out"
makes it a tad confusing
there ya go
yes
i have a connected account id
i can get that passed from the back end
Okie, how do you collect the debit card?
well right now i can collection info with the
lazy var cardTextField: STPPaymentCardTextField = {
let cardTextField = STPPaymentCardTextField()
return cardTextField
}()
using
StripePaymentsUI
Okie so before getting into detail, I would like to quick check the type of the account. Is it Custom or Express? Or you can provide an example account id here
Custom Account
Okie, let look at this Doc: https://stripe.com/docs/connect/payouts-bank-accounts?bank-account-collection-integration=prebuilt-web-form&bank-account-collection-method=manual-entry&platform=ios
It has 2 options: "Pre-built web form" and "Direct API"
ok
so how do i add the external account information ive collected on the iOS client side
bank / account should be sent directly to you guys and never exist on our back end
Let's ignore "Pre-build web form" and go to "Direct API"
It has the "Financial Connection" option and the Manual option. Financial Connection has iOS integration code, but I am confirming if it support collecting debit cards or only Bank account
I see, will that be an US debit card?
yes
Hey, okie I confirmed that Financial Connection is only for bank accounts. So you were correct that you will need to collect the debit card yourself. And I am seeing you are using STPPaymentCardTextField, correct?
that is correct
When you see its paymentMethodParams, it should be https://stripe.dev/stripe-ios/docs/Classes/STPPaymentMethodParams.html, if you look at its card, do you see the token in https://stripe.dev/stripe-ios/docs/Classes/STPPaymentMethodCardParams.html#/c:@M@StripePayments@objc(cs)STPPaymentMethodCardParams(py)token ?
Our purpose is to take the token in format tok_xxx , passing back to backend then backend can use it to create the debit card for payout in https://stripe.com/docs/api/external_account_cards/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this way nothing on the front end stores any sensitive information on the backend
yes that is correct
do i just use STPAccountParams for this?
and then pass that into the paymentHandler.confirmSetupIntent
Ah SetupIntent could be better, in case you are already following it. This flow, right? https://stripe.com/docs/payments/save-and-reuse-cards-only
yes
thats my suspicion
is that setupintent works for regular paying customs and is also what is used for the sellers who want to add a debt card to transfer funds out
wait a minute
Umm the problem with SetupIntent is, after it's confirmed, it's PaymentMethod's card doesn't have the token we want
So later on, your backend look at it and still don't have the token https://stripe.com/docs/api/payment_methods/object#payment_method_object-card
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
give me a min
correct the back end passes me tokens for setup intent
so i usually couple that token with the payment params
and it saves a card
If you put a breakpoint and examine the paymentMethodParams, do you see the token I mentioned above?
this
Hey I think I have found a better flow for you: https://stripe.com/docs/payments/accept-a-payment-charges
This way you only collect the token
In step 4, instead of using Token to create a Charge, you simply pass it back to your backend and they can continue to add the token as the Payout destination
you're kind of on the right track
i can successfully, save cards, charges cards
what i need to be able to understand is how to associate a saved card to a connect account
when saving cards
you gottta understand stripe saves the card to the account
i can pass the cardparams + setupIntent client secret
stripe then tokenizes that card, and then the back end can just look it up
again, how do i do this process as it pertains to a connectID
let paymentHandler = STPPaymentHandler.shared()
paymentHandler.confirmSetupIntent(setupIntentParams, with: self) { status, setupIntent, error in
switch (status) {
case .failed:
print("STRIPE: SAVE METHOD FAILED")
//put an alert and dismiss on the alert
completion()
break
case .canceled:
print("STRIPE: SAVE METHOD CANCELLED")
completion()
break
case .succeeded:
print("STRIPE: SAVE METHOD SUCCESS")
//put a happy check mark animation here!
completion()
break
@unknown default:
fatalError()
break
}
}
}
this is how you normally save a card
Yes I get that, but I believe the step in backend will connect/link the token to the connected account, ie
stripe.Account.create_external_account(
"acct_xxx", # your custom connected account id
external_account="tok_yyy", # your collected token in frontend
)
Now as of frontend, you can simply collect the tok_yyy value using STPPaymentCardTextField, but instead of using the SetupIntent flow you are doing, use this instead: https://stripe.com/docs/payments/accept-a-payment-charges
the issue would be that a setup intent needs a stripe customer
again trying to associate teh same method with a connectID
i shouldnt have to pass back info to the back end
If you use the flow about, you don't need a customer
You simply create a token, that's it. Then you pass it back to backend to use the token
Your backend takes care of linking the token to the Custom Connect Account
oof
thats rough
reall really rough
if im being real
this feels hella beta for debit card
this flow is awkward
Sorry for not having a better answer :/
I think once you have the token it's mostly done, tho