encode<V> static method

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

Implementation

static V encode<V>(
  PaymentIntentPaymentMethodOptionsLink instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.captureMethod != null) {
    container.encodeString(
      'capture_method',
      'manual',
    );
  }
  if (instance.persistentToken != null) {
    container.encodeString(
      'persistent_token',
      instance.persistentToken!,
    );
  }
  if (instance.setupFutureUsage != null) {
    CheckoutLinkPaymentMethodOptionsSetupFutureUsage.encode(
      instance.setupFutureUsage!,
      container.nestedSingleValueContainer('setup_future_usage').encoder,
    );
  }
  return container.value;
}