RazorpayOrderBaseRequestBody constructor

  1. @JsonSerializable(includeIfNull: false)
const RazorpayOrderBaseRequestBody({
  1. required dynamic amount,
  2. required String currency,
  3. String? receipt,
  4. String? offer_id,
  5. String? method,
  6. RazorpayOrderBankDetailsCreateRequestBody? bank_account,
  7. IMap? notes,
  8. bool? partial_payment,
  9. int? first_payment_min_amount,
  10. RazorpayCapturePayment? payment,
  11. bool? rto_review,
  12. List<LineItems>? line_items,
  13. dynamic line_items_total,
  14. int? shipping_fee,
  15. int? cod_fee,
  16. CustomerDetails? customer_details,
  17. List<Promotion>? promotions,
  18. DeviceDetails? device_details,
  19. String? phonepe_switch_context,
})

Implementation

@JsonSerializable(includeIfNull: false)
const factory RazorpayOrderBaseRequestBody({
  required dynamic amount, // number | string
  required String currency,
  String? receipt,
  String? offer_id,
  String? method, // 'netbanking' | 'upi' | 'card' | 'emandate' | 'nach'
  RazorpayOrderBankDetailsCreateRequestBody? bank_account,
  IMap<dynamic>? notes,
  bool? partial_payment,
  int? first_payment_min_amount,
  RazorpayCapturePayment? payment,
  bool? rto_review,
  List<LineItems>? line_items,
  dynamic line_items_total, // number | string
  int? shipping_fee,
  int? cod_fee,
  CustomerDetails? customer_details,
  List<Promotion>? promotions,
  DeviceDetails? device_details,
  String? phonepe_switch_context,

  // Fields specifically for Transfer Orders (handled in separate model)
  // List<RazorpayOrderCreateTransferRequestBody>? transfers,

  // Fields specifically for Authorization Orders (handled in separate model)
  // bool? payment_capture,
  // String? customer_id,
  // dynamic token, // Union of Token types
}) = _RazorpayOrderBaseRequestBody;