WooOrderRefund constructor
WooOrderRefund({
- int? id,
- DateTime? dateCreated,
- DateTime? dateCreatedGmt,
- String? amount,
- String? reason,
- int? refundedBy,
- bool? refundedPayment,
- List<
WooMetaData> ? metaData, - List<
WooLineItem> ? lineItems, - List<
WooTaxLine> ? taxLines, - List<
WooShippingLine> ? shippingLines, - List<
WooOrderFeeLine> ? feeLines, - bool? apiRefund,
- bool? apiRestock,
Creates a new WooOrderRefund instance
Required Parameters
amount- Total refund amount as a stringreason- Reason for the refund
Optional Parameters
id- Unique identifier for the refund (read-only)dateCreated- Date when refund was created (read-only)dateCreatedGmt- Date when refund was created in GMT (read-only)refundedBy- User ID who created the refund (read-only)refundedPayment- Whether payment was refunded via API (read-only)metaData- Custom refund metadatalineItems- Line items being refundedtaxLines- Tax lines for the refund (read-only)shippingLines- Shipping lines for the refundfeeLines- Fee lines for the refundapiRefund- Whether to use payment gateway API (write-only)apiRestock- Whether to restock refunded items (write-only)
Example Usage
// Create a full refund
final refund = WooOrderRefund(
amount: '99.99',
reason: 'Customer requested full refund',
apiRefund: true,
apiRestock: true,
);
// Create a partial refund
final partialRefund = WooOrderRefund(
amount: '25.00',
reason: 'Partial refund for damaged item',
lineItems: [
WooLineItem(
id: 1,
quantity: 1,
total: 25.00,
),
],
);
Implementation
WooOrderRefund({
this.id,
this.dateCreated,
this.dateCreatedGmt,
this.amount,
this.reason,
this.refundedBy,
this.refundedPayment,
this.metaData,
this.lineItems,
this.taxLines,
this.shippingLines,
this.feeLines,
this.apiRefund,
this.apiRestock,
});