encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodDetailsCardWalletVisaCheckout instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.billingAddress != null) {
    Address.encode(
      instance.billingAddress!,
      container.nestedSingleValueContainer('billing_address').encoder,
    );
  }
  if (instance.email != null) {
    container.encodeString(
      'email',
      instance.email!,
    );
  }
  if (instance.name != null) {
    container.encodeString(
      'name',
      instance.name!,
    );
  }
  if (instance.shippingAddress != null) {
    Address.encode(
      instance.shippingAddress!,
      container.nestedSingleValueContainer('shipping_address').encoder,
    );
  }
  return container.value;
}