RazorpayOrder constructor
- @JsonSerializable(includeIfNull: false)
const
RazorpayOrder(
{ - required String id,
- required String entity,
- required dynamic amount,
- required int amount_paid,
- required int amount_due,
- required String currency,
- required String status,
- required int created_at,
- String? offer_id,
- String? method,
- RazorpayOrderBankDetailsCreateRequestBody? bank_account,
- IMap? notes,
- bool? partial_payment,
- int? first_payment_min_amount,
- String? description,
- RazorpayAuthorizationToken? token,
- Map<String, String>? payments,
- Map<String, String>? offers,
- List<RazorpayTransfer>? transfers,
- bool? rto_review,
- List<LineItems>? line_items,
- dynamic line_items_total,
- int? shipping_fee,
- int? cod_fee,
- CustomerDetails? customer_details,
- List<Promotion>? promotions,
- DeviceDetails? device_details,
- String? phonepe_switch_context,
})
Implementation
@JsonSerializable(includeIfNull: false)
const factory RazorpayOrder({
required String id,
required String entity,
required dynamic amount, // number | string
required int amount_paid,
required int amount_due,
required String currency,
required String
status, // 'created' | 'attempted' | 'paid', required int attempts, required int created_at, String? receipt,
required int created_at,
String? offer_id,
String? method, // 'netbanking' | 'upi' | 'card' | 'emandate' | 'nach'
RazorpayOrderBankDetailsCreateRequestBody?
bank_account, // Response might contain this if created with it
IMap<dynamic>? notes,
bool? partial_payment,
int? first_payment_min_amount,
String? description, // Often added by system if not provided
RazorpayAuthorizationToken? token, // Response token structure
Map<String, String>? payments, // { [key:string] : string }
Map<String, String>? offers, // { [key:string] : string }
// Transfers structure in response
List<RazorpayTransfer>?
transfers, // Transfers.RazorpayTransfer[] | {entity: string; count: string; items: Transfers.RazorpayTransfer[] }
// Use dynamic or create a union type/check type at runtime
// RTO related fields in response (might not always be present)
bool? rto_review,
List<LineItems>? line_items,
dynamic line_items_total,
int? shipping_fee,
int? cod_fee,
CustomerDetails? customer_details,
List<Promotion>? promotions,
DeviceDetails? device_details,
String? phonepe_switch_context,
}) = _RazorpayOrder;