I'm testing Stripe Connect to allow users to pay other users. I'm testing it with the Stripe Java library (in Kotlin).
As the documentation suggest I need the users that will receive money to create a Stripe account with the Account.create API, and then to link the account with the AccountLink.create API.
When the user go through the Stripe onboarding flow (the Stripe url received by the AccountLink.create API) they are required to input a lot of data in many steps.
This steps are:
I would like to only keep steps 1, 2, 3, 5 (without address and phone number), 7 and 10 during the initial onboarding, and remove the other steps, to decrease friction.
I saw other websites using Stripe Connect, and I know for a fact that it is possible.
This is the code I'm using:
Account.create request:
suspend fun stripeCreateNewAccount(
email: String,
localID: String,
productDescription: String,
onSuccess: suspend (Account?) -> Unit,
) {
try {
Stripe.apiKey = Constants.STRIPE_TOKEN_TEST
val metadata: MutableMap<String, String> = HashMap()
metadata["id"] = localID
val createAccountParams = AccountCreateParams.Builder()
.setType(AccountCreateParams.Type.STANDARD)
.setEmail(email.lowercase().trim())
.setMetadata(metadata)
.setBusinessType(AccountCreateParams.BusinessType.INDIVIDUAL)
.setBusinessProfile(
AccountCreateParams.BusinessProfile.builder()
.setUrl(url)
.setName("Testing Stripe connect")
.setProductDescription(productDescription)
.build()
)
.setCompany(
AccountCreateParams.Company.Builder()
.setName("Test Company Name")
.build()
)
.setIndividual(
AccountCreateParams.Individual.Builder()
.setFirstName("John")
.setLastName("Smith")
.setEmail(email.lowercase().trim())
.build()
)
.setBusinessProfile(
AccountCreateParams.BusinessProfile.builder()
.setUrl("${Constants.BASE_URL}/list/$localID" )
.setProductDescription(productDescription)
.build()
)
.build()
onSuccess(Account.create(createAccountParams))
} catch (e: Exception) {
e.printStackTrace()
onSuccess(null)
}
}
and this is the AccountLink.create request:
suspend fun stripeLinkExistingAccount(
idAccountToLink: String,
onCompleted: suspend (String?) -> Unit,
) {
try {
Stripe.apiKey = Constants.STRIPE_TOKEN_TEST
val params = AccountLinkCreateParams
.builder()
.setAccount(idAccountToLink)
.setRefreshUrl("${Constants.BASE_URL}/profile")
.setReturnUrl("${Constants.BASE_URL}/profile")
.setType(AccountLinkCreateParams.Type.ACCOUNT_ONBOARDING)
.build()
AccountLink.create(params)?.let { accountLink ->
onCompleted(accountLink.url) // The Stripe onboarding url
} ?: run {
// Something went wrong
onCompleted(null)
}
} catch (e: Exception) {
e.printStackTrace()
onCompleted(null)
}
}
Unfortunately, this is not something you can control. You are creating a Standard account which means the person signs up directly with Stripe and opens a "full account" with them. Stripe will need to collect all the bits of information they require for identity verification, but they will also collect additional details they need or want to offer (like the Climate screen). You can't skip this.
One potential alternative would be to switch to Express accounts instead for example where you control more of the onboarding. But it comes with different risks and restrictions as covered in the docs here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With