encode<V> static method
Implementation
static V encode<V>(
SourceTypeKlarna instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.backgroundImageUrl != null) {
container.encodeString(
'background_image_url',
instance.backgroundImageUrl!,
);
}
if (instance.clientToken != null) {
container.encodeString(
'client_token',
instance.clientToken!,
);
}
if (instance.firstName != null) {
container.encodeString(
'first_name',
instance.firstName!,
);
}
if (instance.lastName != null) {
container.encodeString(
'last_name',
instance.lastName!,
);
}
if (instance.locale != null) {
container.encodeString(
'locale',
instance.locale!,
);
}
if (instance.logoUrl != null) {
container.encodeString(
'logo_url',
instance.logoUrl!,
);
}
if (instance.pageTitle != null) {
container.encodeString(
'page_title',
instance.pageTitle!,
);
}
if (instance.payLaterAssetUrlsDescriptive != null) {
container.encodeString(
'pay_later_asset_urls_descriptive',
instance.payLaterAssetUrlsDescriptive!,
);
}
if (instance.payLaterAssetUrlsStandard != null) {
container.encodeString(
'pay_later_asset_urls_standard',
instance.payLaterAssetUrlsStandard!,
);
}
if (instance.payLaterName != null) {
container.encodeString(
'pay_later_name',
instance.payLaterName!,
);
}
if (instance.payLaterRedirectUrl != null) {
container.encodeString(
'pay_later_redirect_url',
instance.payLaterRedirectUrl!,
);
}
if (instance.payNowAssetUrlsDescriptive != null) {
container.encodeString(
'pay_now_asset_urls_descriptive',
instance.payNowAssetUrlsDescriptive!,
);
}
if (instance.payNowAssetUrlsStandard != null) {
container.encodeString(
'pay_now_asset_urls_standard',
instance.payNowAssetUrlsStandard!,
);
}
if (instance.payNowName != null) {
container.encodeString(
'pay_now_name',
instance.payNowName!,
);
}
if (instance.payNowRedirectUrl != null) {
container.encodeString(
'pay_now_redirect_url',
instance.payNowRedirectUrl!,
);
}
if (instance.payOverTimeAssetUrlsDescriptive != null) {
container.encodeString(
'pay_over_time_asset_urls_descriptive',
instance.payOverTimeAssetUrlsDescriptive!,
);
}
if (instance.payOverTimeAssetUrlsStandard != null) {
container.encodeString(
'pay_over_time_asset_urls_standard',
instance.payOverTimeAssetUrlsStandard!,
);
}
if (instance.payOverTimeName != null) {
container.encodeString(
'pay_over_time_name',
instance.payOverTimeName!,
);
}
if (instance.payOverTimeRedirectUrl != null) {
container.encodeString(
'pay_over_time_redirect_url',
instance.payOverTimeRedirectUrl!,
);
}
if (instance.paymentMethodCategories != null) {
container.encodeString(
'payment_method_categories',
instance.paymentMethodCategories!,
);
}
if (instance.purchaseCountry != null) {
container.encodeString(
'purchase_country',
instance.purchaseCountry!,
);
}
if (instance.purchaseType != null) {
container.encodeString(
'purchase_type',
instance.purchaseType!,
);
}
if (instance.redirectUrl != null) {
container.encodeString(
'redirect_url',
instance.redirectUrl!,
);
}
if (instance.shippingDelay != null) {
container.encodeInt(
'shipping_delay',
instance.shippingDelay!,
);
}
if (instance.shippingFirstName != null) {
container.encodeString(
'shipping_first_name',
instance.shippingFirstName!,
);
}
if (instance.shippingLastName != null) {
container.encodeString(
'shipping_last_name',
instance.shippingLastName!,
);
}
return container.value;
}