encode<V> static method

V encode<V>(
  1. PaymentMethodOptionsSofort instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  PaymentMethodOptionsSofort instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.preferredLanguage != null) {
    PaymentMethodDetailsSofortPreferredLanguage.encode(
      instance.preferredLanguage!,
      container.nestedSingleValueContainer('preferred_language').encoder,
    );
  }
  if (instance.setupFutureUsage != null) {
    CheckoutLinkPaymentMethodOptionsSetupFutureUsage.encode(
      instance.setupFutureUsage!,
      container.nestedSingleValueContainer('setup_future_usage').encoder,
    );
  }
  return container.value;
}