0

I'm trying to create a new Stripe Customer with the Java Stripe SDK. Unfortunately the .setAddress() function inside the CustomerCreateParams.Builder() is not working.

I'm trying to figure out how to create the Address Object, but everytime the following error occurred.

   The method setAddress(CustomerCreateParams.Address) is ambiguous for the type CustomerCreateParams.BuilderJava(67108966)

Does someone have a solution for this problem?

1 Answer 1

0

Works fine for me, maybe edit your question with more context and full code and versions of the stripe-java library and other environment information?

CustomerCreateParams params = CustomerCreateParams.builder()
        .setAddress(CustomerCreateParams.Address.builder()
                .setLine1("123 Street")
                .setCity("San Francisco")
                .setPostalCode("94103")
                .setCountry("US")
                .build())
        .setEmail("[email protected]")
        .build();
Customer cus = Customer.create(params);
System.out.println(cus.getAddress().getLine1());

Not the answer you're looking for? Browse other questions tagged or ask your own question.