square_api_client/models/
payment_refund.rs

1//! Model struct for PaymentRefund type
2
3use serde::{Deserialize, Serialize};
4
5use super::{enums::PaymentRefundStatus, DateTime, Money, ProcessingFee};
6
7/// Represents a refund of a payment made using Square.
8///
9/// Contains information about the original payment and the amount of money refunded.
10#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
11pub struct PaymentRefund {
12    /// The unique ID for this refund, generated by Square.
13    pub id: String,
14    /// The refund's status.
15    pub status: Option<PaymentRefundStatus>,
16    /// The location ID associated with the payment this refund is attached to.
17    pub location_id: Option<String>,
18    /// The amount of money refunded. This amount is specified in the smallest denomination of the
19    /// applicable currency (for example, US dollar amounts are specified in cents).
20    pub amount_money: Option<Money>,
21    /// The amount of money the application developer contributed to help cover the refunded amount.
22    /// This amount is specified in the smallest denomination of the applicable currency (for
23    /// example, US dollar amounts are specified in cents). For more information, see [Working with
24    /// Monetary
25    /// Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
26    pub app_fee_money: Option<Money>,
27    /// Processing fees and fee adjustments assessed by Square for this refund.
28    pub processing_fee: Option<Vec<ProcessingFee>>,
29    /// The ID of the payment associated with this refund.
30    pub payment_id: Option<String>,
31    /// The ID of the order associated with the refund.
32    pub order_id: Option<String>,
33    /// The reason for the refund.
34    pub reason: Option<String>,
35    /// **Read only** The timestamp of when the refund was created.
36    pub created_at: Option<DateTime>,
37    /// **Read only** The timestamp of when the refund was last updated.
38    pub updated_at: Option<DateTime>,
39    /// **Read only** An optional ID of the team member associated with taking the payment.
40    pub team_member_id: Option<String>,
41}