RazorpayPayment constructor

  1. @JsonSerializable(includeIfNull: false)
const RazorpayPayment({
  1. required String id,
  2. required String entity,
  3. required dynamic amount,
  4. required String currency,
  5. required PaymentStatus status,
  6. required String order_id,
  7. required bool international,
  8. required String method,
  9. required int created_at,
  10. required int amount_refunded,
  11. required int fee,
  12. required int tax,
  13. RefundStatus? refund_status,
  14. String? description,
  15. String? card_id,
  16. String? bank,
  17. String? wallet,
  18. String? vpa,
  19. IMap<String>? notes,
  20. String? error_code,
  21. String? error_description,
  22. String? error_source,
  23. String? error_step,
  24. String? error_reason,
  25. RazorpayCard? card,
  26. PaymentEmi? emi,
  27. PaymentOffers? offers,
  28. String? token_id,
  29. 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;