encode<V> static method
Implementation
static V encode<V>(
PaymentMethodDetailsCard instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.amountAuthorized != null) {
container.encodeInt(
'amount_authorized',
instance.amountAuthorized!,
);
}
if (instance.brand != null) {
container.encodeString(
'brand',
instance.brand!,
);
}
if (instance.captureBefore != null) {
container.encodeDateTime(
'capture_before',
instance.captureBefore!,
);
}
if (instance.checks != null) {
PaymentMethodCardChecks.encode(
instance.checks!,
container.nestedSingleValueContainer('checks').encoder,
);
}
if (instance.country != null) {
container.encodeString(
'country',
instance.country!,
);
}
if (instance.description != null) {
container.encodeString(
'description',
instance.description!,
);
}
container.encodeInt(
'exp_month',
instance.expMonth,
);
container.encodeInt(
'exp_year',
instance.expYear,
);
if (instance.extendedAuthorization != null) {
PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization
.encode(
instance.extendedAuthorization!,
container.nestedSingleValueContainer('extended_authorization').encoder,
);
}
if (instance.fingerprint != null) {
container.encodeString(
'fingerprint',
instance.fingerprint!,
);
}
if (instance.funding != null) {
container.encodeString(
'funding',
instance.funding!,
);
}
if (instance.iin != null) {
container.encodeString(
'iin',
instance.iin!,
);
}
if (instance.incrementalAuthorization != null) {
PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization
.encode(
instance.incrementalAuthorization!,
container
.nestedSingleValueContainer('incremental_authorization')
.encoder,
);
}
if (instance.installments != null) {
PaymentMethodDetailsCardInstallments.encode(
instance.installments!,
container.nestedSingleValueContainer('installments').encoder,
);
}
if (instance.issuer != null) {
container.encodeString(
'issuer',
instance.issuer!,
);
}
if (instance.last4 != null) {
container.encodeString(
'last4',
instance.last4!,
);
}
if (instance.mandate != null) {
container.encodeString(
'mandate',
instance.mandate!,
);
}
if (instance.moto != null) {
container.encodeBool(
'moto',
instance.moto!,
);
}
if (instance.multicapture != null) {
PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture
.encode(
instance.multicapture!,
container.nestedSingleValueContainer('multicapture').encoder,
);
}
if (instance.network != null) {
container.encodeString(
'network',
instance.network!,
);
}
if (instance.networkToken != null) {
PaymentMethodDetailsCardNetworkToken.encode(
instance.networkToken!,
container.nestedSingleValueContainer('network_token').encoder,
);
}
if (instance.overcapture != null) {
PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture
.encode(
instance.overcapture!,
container.nestedSingleValueContainer('overcapture').encoder,
);
}
if (instance.threeDSecure != null) {
PaymentMethodDetailsCardThreeDSecure.encode(
instance.threeDSecure!,
container.nestedSingleValueContainer('three_d_secure').encoder,
);
}
if (instance.wallet != null) {
PaymentMethodDetailsCardWallet.encode(
instance.wallet!,
container.nestedSingleValueContainer('wallet').encoder,
);
}
return container.value;
}