RazorpaySubscription constructor
- @JsonSerializable(includeIfNull: false)
const
RazorpaySubscription(
{ - required String id,
- required String entity,
- required String plan_id,
- required SubscriptionStatus status,
- required int total_count,
- required int quantity,
- required int paid_count,
- required bool has_scheduled_changes,
- required String remaining_count,
- @JsonKey(toJson: _boolToInt, fromJson: _intToBool) bool? customer_notify,
- String? offer_id,
- int? expire_by,
- List<RazorpaySubscriptionAddonsItem>? addons,
- IMap? notes,
- int? current_start,
- int? current_end,
- int? ended_at,
- int? change_scheduled_at,
- String? customer_id,
- String? payment_method,
})
Implementation
@JsonSerializable(includeIfNull: false)
const factory RazorpaySubscription({
required String id,
required String entity,
required String plan_id,
required SubscriptionStatus status,
required int total_count,
required int quantity,
required int paid_count,
required bool
has_scheduled_changes, // d.ts shows quantity as optional in base, but required here? Assume required., required int start_at, // Non-nullable in response, required int charge_at, // Unix timestamp, required int end_at, // Unix timestamp (calculated end), required int auth_attempts, required int paid_count, required int created_at, // Unix timestamp, required String short_url, required bool has_scheduled_changes, required String source, // e.g., 'api', 'dashboard', required String
required String
remaining_count, // String in d.ts? Assume int based on context. Revert if needed.
@JsonKey(toJson: _boolToInt, fromJson: _intToBool) bool? customer_notify,
String? offer_id,
int? expire_by, // Still nullable? Or defaults? Assuming nullable.
List<RazorpaySubscriptionAddonsItem>?
addons, // Reflects addons at creation?
IMap<dynamic>? notes,
// ScheduleChangeAt? schedule_change_at, // Usually not part of the main response
// Response specific fields
int? current_start, // Nullable Unix timestamp
int? current_end, // Nullable Unix timestamp
int? ended_at, // Nullable Unix timestamp
int? change_scheduled_at, // Nullable Unix timestamp
String? customer_id, // Nullable string
String? payment_method, // Nullable string
}) = _RazorpaySubscription;