create static method
Invoice
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "invoice",
- String? id,
- String? external_id,
- String? user_id,
- String? status,
- String? merchant_name,
- String? merchant_profile_picture_url,
- num? amount,
- String? expiry_date,
- String? invoice_url,
- List<
AvailableBanks> ? available_banks, - List<
AvailableRetailOutlets> ? available_retail_outlets, - List<
AvailableEwallets> ? available_ewallets, - List<
AvailableQrCodes> ? available_qr_codes, - List<
Object> ? available_direct_debits, - List<
Object> ? available_paylaters, - bool? should_exclude_credit_card,
- bool? should_send_email,
- String? created,
- String? updated,
- String? currency,
- CustomerNotificationPreference? customer_notification_preference,
override
return original data json
Implementation
static Invoice create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "invoice",
String? id,
String? external_id,
String? user_id,
String? status,
String? merchant_name,
String? merchant_profile_picture_url,
num? amount,
String? expiry_date,
String? invoice_url,
List<AvailableBanks>? available_banks,
List<AvailableRetailOutlets>? available_retail_outlets,
List<AvailableEwallets>? available_ewallets,
List<AvailableQrCodes>? available_qr_codes,
List<Object>? available_direct_debits,
List<Object>? available_paylaters,
bool? should_exclude_credit_card,
bool? should_send_email,
String? created,
String? updated,
String? currency,
CustomerNotificationPreference? customer_notification_preference,
}) {
// Invoice invoice = Invoice({
final Map invoice_data_create_json = {
"@type": special_type,
"id": id,
"external_id": external_id,
"user_id": user_id,
"status": status,
"merchant_name": merchant_name,
"merchant_profile_picture_url": merchant_profile_picture_url,
"amount": amount,
"expiry_date": expiry_date,
"invoice_url": invoice_url,
"available_banks":
(available_banks != null) ? available_banks.toJson() : null,
"available_retail_outlets": (available_retail_outlets != null)
? available_retail_outlets.toJson()
: null,
"available_ewallets":
(available_ewallets != null) ? available_ewallets.toJson() : null,
"available_qr_codes":
(available_qr_codes != null) ? available_qr_codes.toJson() : null,
"available_direct_debits": available_direct_debits,
"available_paylaters": available_paylaters,
"should_exclude_credit_card": should_exclude_credit_card,
"should_send_email": should_send_email,
"created": created,
"updated": updated,
"currency": currency,
"customer_notification_preference":
(customer_notification_preference != null)
? customer_notification_preference.toJson()
: null,
};
invoice_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (invoice_data_create_json.containsKey(key) == false) {
invoice_data_create_json[key] = value;
}
});
}
return Invoice(invoice_data_create_json);
}