flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
956 stars 525 forks source link

Possibility to create account tokens as mentioned in the documentation #1640

Open Tom3652 opened 9 months ago

Tom3652 commented 9 months ago

Is your feature request related to a problem? (please describe)

I need to create account for sellers in my app using this documentation

Describe the solution you'd like

Specifically, i need to call a certain [createToken](https://docs.stripe.com/connect/account-tokens#mobile-tokens) method such as :

import UIKit
import StripePayments

let companyParams = STPConnectAccountCompanyParams()
companyParams.name = company.name
companyParams.address = STPConnectAccountAddress()
companyParams.address.line1 = company.address_line_1
companyParams.address.city = company.address_city
companyParams.address.state = company.address_state
companyParams.address.country = company.address_country
companyParams.address.postalCode = company.address_postal_code

guard let accountParams = STPConnectAccountParams(tosShownAndAccepted: true, company: companyParams) else {
  // The TOS was not accepted
  return
}

STPAPIClient.shared.createToken(withConnectAccount: accountParams) { (accountToken, error) in
    if let error = error {
        // display an error to your user
    }
    else {
        // use account token to create a Connect account server-side
    }
}

In Swift for example. This allows to create Account tokens that are used for custom integration onboarding with Stripe.

Describe alternatives you've considered

I have seen some createToken methods in this package but none of them seem to match with this use case which is the only one i need in my mobile app, since the rest of the payments will be made with Payment links on my website.

Additional context

Thanks for the package !

remonh87 commented 8 months ago

yes you are correct. Stripe needs to implement this in their sdk https://github.com/stripe/stripe-react-native/issues/1472