RazorpayPayment constructor
- @JsonSerializable(includeIfNull: false)
const
RazorpayPayment(
{ - required String id,
- required String entity,
- required dynamic amount,
- required String currency,
- required PaymentStatus status,
- required String order_id,
- required bool international,
- required String method,
- required int created_at,
- required int amount_refunded,
- required int fee,
- required int tax,
- RefundStatus? refund_status,
- String? description,
- String? card_id,
- String? bank,
- String? wallet,
- String? vpa,
- IMap<String>? notes,
- String? error_code,
- String? error_description,
- String? error_source,
- String? error_step,
- String? error_reason,
- RazorpayCard? card,
- PaymentEmi? emi,
- PaymentOffers? offers,
- String? token_id,
- RazorpayToken? token,
})
Implementation
@JsonSerializable(includeIfNull: false)
const factory RazorpayPayment({
required String id,
required String entity, // 'payment'
required dynamic amount, // number | string
required String currency,
required PaymentStatus status,
required String order_id,
required bool international,
required String method, // 'card' | 'netbanking' | 'wallet' | 'emi' | 'upi'
required int created_at,
required int amount_refunded,
required int fee,
required int tax,
RefundStatus?
refund_status, // 'null' | 'partial' | 'full' - Use nullable enum
String? description,
String? card_id, // Nullable
String? bank, // Bank code or name? d.ts says code.
String? wallet, // Nullable
String? vpa, // Nullable
IMap<String>? notes, // Changed type to IMap<String>?
String? error_code, // Nullable
String? error_description, // Nullable
String? error_source, // Nullable
String? error_step, // Nullable
String? error_reason, // Nullable
// Optional expanded fields
RazorpayCard? card, // Nullable if not expanded
PaymentEmi? emi, // Nullable if not expanded
PaymentOffers? offers, // Nullable if not expanded
String? token_id, // Nullable
RazorpayToken? token, // Nullable expanded token info
// Removed upi field, seems implicit in vpa/method
}) = _RazorpayPayment;