encode<V> static method

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

Implementation

static V encode<V>(
  CheckoutSessionTotalDetails instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  container.encodeInt(
    'amount_discount',
    instance.amountDiscount,
  );
  if (instance.amountShipping != null) {
    container.encodeInt(
      'amount_shipping',
      instance.amountShipping!,
    );
  }
  container.encodeInt(
    'amount_tax',
    instance.amountTax,
  );
  if (instance.breakdown != null) {
    PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown.encode(
      instance.breakdown!,
      container.nestedSingleValueContainer('breakdown').encoder,
    );
  }
  return container.value;
}