code: @Override
    public Card update(Map<String, Object> params, RequestOptions options) throws StripeException {
      String url;
      if (this.getAccount() != null) {
        url =
            String.format(
                "%s%s",
                Stripe.getApiBase(),
                String.format(
                    "/v1/accounts/%s/external_accounts/%s",
                    ApiResource.urlEncodeId(this.getAccount()),
                    ApiResource.urlEncodeId(this.getId())));
      } else if (this.getCustomer() != null) {
        url =
            String.format(
                "%s%s",
                Stripe.getApiBase(),
                String.format(
                    "/v1/customers/%s/sources/%s",
                    ApiResource.urlEncodeId(this.getCustomer()),
                    ApiResource.urlEncodeId(this.getId())));
      } else {
        throw new InvalidRequestException(
            "Unable to construct url because [account, customer] field(s) are all null",
            null,
            null,
            null,
            0,
            null);
      }
      return request(ApiResource.RequestMethod.POST, url, params, Card.class, options);
    }
docs: If you need to update only some card details, like the billing address or expiration date, you
  can do so without having to re-enter the full card details. Stripe also works directly with
  card networks so that your customers can <a
  href="https://stripe.com/docs/saving-cards#automatic-card-updates">continue using your
  service</a> without interruption.
  
  <p>Updates a specified card for a given customer.