#sunnylbk
1 messages · Page 1 of 1 (latest)
Here is the code snippet I am using, private RequestOptions connectAccountRequestOptions(String stripeAccountId) { return RequestOptions.builder() .setApiKey(stripeApiKey) .setStripeAccount(stripeAccountId) .build(); }
And below to create customer, try { var stripeAccountId = client.org.getConnectedAccount().getAccountId(); return Customer.create(stripeCustomerRequest.toMap(), connectAccountRequestOptions(stripeAccountId)); } catch (final StripeException e) { errorlogger.logStripeError(e.getMessage(), e); throw new StripeApiCallException(format("Unable to create Stripe Customer with email [%s]", client.getPrimaryContactEmail()), e); }
Hi, taking a look at the request id you've shared.
It looks like you're passing in 'source' with an invalid value, https://stripe.com/docs/api/customers/create?lang=java#create_customer-source. Can you omit this parameter and try making that request again?
You passed: source: "client",
but it's expecting a source id:
When using payment sources created via the Token or Sources APIs, passing source will create a new source object, make it the new customer default source, and delete the old customer default if one exists. If you want to add additional sources instead of replacing the existing default, use the card creation API. Whenever you attach a card to a customer, Stripe will automatically validate the card.