encode<V> static method

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

Implementation

static V encode<V>(
  PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.customMandateUrl != null) {
    container.encodeString(
      'custom_mandate_url',
      instance.customMandateUrl!,
    );
  }
  if (instance.intervalDescription != null) {
    container.encodeString(
      'interval_description',
      instance.intervalDescription!,
    );
  }
  if (instance.paymentSchedule != null) {
    CheckoutAcssDebitMandateOptionsPaymentSchedule.encode(
      instance.paymentSchedule!,
      container.nestedSingleValueContainer('payment_schedule').encoder,
    );
  }
  if (instance.transactionType != null) {
    CheckoutAcssDebitMandateOptionsTransactionType.encode(
      instance.transactionType!,
      container.nestedSingleValueContainer('transaction_type').encoder,
    );
  }
  return container.value;
}