#mesudev
1 messages · Page 1 of 1 (latest)
Hi 👋
I don't think we have an API -only way to simulate the completion of that. I think you need to go through the onboarding process using test data
Not even for testing? Would be crazy helpful for our integration tests
Unfortunately that isn't something we have an automation for. However, you can simulate the webhook event that will fire when the KYC process occurs by triggering the account.updated event using the CLI: https://stripe.com/docs/cli/trigger#trigger-event-account_updated
You can even write your own fixtures to configure different versions of this webhook events with different statuses of the requirements property, thereby simulating different stages of the KYC process
So we're providing a return URL that authenticates a user who successfully completed the KYC-procedure when arriving back on the platform.
After a successful authentication, we then send an API request to Stripe's connected account API to check on the details_submitted property. If it is true, we then consider the KYC to be completed. Hence: Can I, using your mentioned strategy, simulate that a subsequent API request to stripe's connected account API returns true for the details_submitted property of a given connected account, even if the onboarding flow remained untouched after being initiated by generating an account link?
That would already be enough for the integration testing. Or can I manually update the details_submitted using the Account API in testing only to simulate this (Of course we would never do that in prod).
Yes you can configure a custom fixture to return an Account in that state when you trigger that event
I would recommend you investigate the requirements hash as well, not necessarily for initial onboarding but at different points as accounts begin to generate transactions, additional KYC is required and that hash will give you good information about those upcoming requirements
Meaning verifying that details_submitted=true does not indicate a completed KYC for a newly initiated connected account ?
It means they have sumitted all the necessary initial information
What I was referring to was a way to track all potential KYC requirements over time
Yes
But do you agree that for the initial onboarding, verifying that details_submitted is true is enough?
And that only at a later moment, more info may be required, and that info "requirement state" should be checked via webhook as indicated here https://stripe.com/docs/connect/connect-onboarding ?
Yes that will work
Okay and manually updating the details_submitted property via https://stripe.com/docs/api/accounts/update seemingly does not work for the details_submitted property, according to your docs?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that property is read-only?
Correct
You can configure a custom fixture to return an Account whose value for details_submitted is true? Could you elaborate on that please?
Wait, sorry. I wasn't thinking about this correctly. You can provide all the necessary details via the API.
Such that in the end, the details_submitted property will have a value of true ?
If you are creating an Account with business_type = individual you provide the complete individual parameter:
https://stripe.com/docs/api/accounts/create#create_account-individual
That should but I would test to be sure
Ah so you don‘t even need to provide sample bank account numbers etc ?
I am testing this currently
Cheers, please let us know
So far I have not returned an Account with details_submitted: true
Because the thing is that we already provide all that info when creating the account directly, so I don’t think you’ll get “true”
Yeah
The KYC completion would need to be simulated completely too, so I guess your fixture solution is also not an option, as we have to be able to test the execution of test transactions in the testing environment with the concerned connected account
In that case you might try manually going through onboarding and saving the objects that are returned as JSON, and then using them as mock API responses during your integration testing
Concluding that manual KYC and then later use of that account for the integration tests is the only real solution..?
Yesyes ok thx!
Would be a huge plus to have that for testing though, any plans on implementing such a thing?
Because otherwise, everytime the onboarding is changed on our platform, we’d have to go through the manual setup again..
To execute tests which are always up-to-date
Yes I understand the difficulty that causes. I can raise this as a feature request