Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistency between documentation and code #1200

Closed
Zhen-hao opened this issue Apr 27, 2021 · 1 comment
Closed

inconsistency between documentation and code #1200

Zhen-hao opened this issue Apr 27, 2021 · 1 comment
Assignees

Comments

@Zhen-hao
Copy link

Zhen-hao commented Apr 27, 2021

#1120 doesn't contain TosAcceptance.ServiceAgreement. This update doesn't make much sense.

This code

Stripe.apiKey = "sk_test_51EfO7sI5KCcQAey8HyYVbLRClWaBzXP1AbEJtUeYITXGhczL3hxfL2e5jW5KHsmk08vc4lTw5Q4wDjwegj0AVJsP00furr62BE";

AccountCreateParams params =
  AccountCreateParams.builder()
    .setCountry("SG")
    .setType(AccountCreateParams.Type.CUSTOM)
    .setCapabilities(
      AccountCreateParams.Capabilities.builder()
        .setTransfers(
          AccountCreateParams.Capabilities.Transfers.builder()
            .setRequested(true)
            .build())
        .build())
    .setTosAcceptance(
      AccountCreateParams.TosAcceptance.builder()
        .setServiceAgreement(AccountCreateParams.TosAcceptance.ServiceAgreement.RECIPIENT)
        .build())
    .build();

Account account = Account.create(params);

from https://stripe.com/docs/connect/service-agreement-types#choosing-type-with-api is not reproducible.

@remi-stripe remi-stripe self-assigned this Apr 27, 2021
@remi-stripe
Copy link
Contributor

@Zhen-hao Sorry for the confusion here. The update was correct and added support for this parameter. The issue is that it's a string not an enum in our API so there's no "constants" for it and you're expected to do this instead:

AccountCreateParams params =
  AccountCreateParams.builder()
    .setCountry("SG")
    .setType(AccountCreateParams.Type.CUSTOM)
    .setCapabilities(
      AccountCreateParams.Capabilities.builder()
        .setTransfers(
          AccountCreateParams.Capabilities.Transfers.builder()
            .setRequested(true)
            .build())
        .build())
    .setTosAcceptance(
      AccountCreateParams.TosAcceptance.builder()
        .setServiceAgreement("recipient")
        .build())
    .build();

Account account = Account.create(params);

I'll flag internally to get the docs fixed since they are incorrect but I hope you're unblocked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants