1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Model struct for PaymentRefund type

use serde::{Deserialize, Serialize};

use super::{enums::PaymentRefundStatus, DateTime, Money, ProcessingFee};

/// Represents a refund of a payment made using Square.
///
/// Contains information about the original payment and the amount of money refunded.
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct PaymentRefund {
    /// The unique ID for this refund, generated by Square.
    pub id: String,
    /// The refund's status.
    pub status: Option<PaymentRefundStatus>,
    /// The location ID associated with the payment this refund is attached to.
    pub location_id: Option<String>,
    /// The amount of money refunded. This amount is specified in the smallest denomination of the
    /// applicable currency (for example, US dollar amounts are specified in cents).
    pub amount_money: Option<Money>,
    /// The amount of money the application developer contributed to help cover the refunded amount.
    /// This amount is specified in the smallest denomination of the applicable currency (for
    /// example, US dollar amounts are specified in cents). For more information, see [Working with
    /// Monetary
    /// Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).
    pub app_fee_money: Option<Money>,
    /// Processing fees and fee adjustments assessed by Square for this refund.
    pub processing_fee: Option<Vec<ProcessingFee>>,
    /// The ID of the payment associated with this refund.
    pub payment_id: Option<String>,
    /// The ID of the order associated with the refund.
    pub order_id: Option<String>,
    /// The reason for the refund.
    pub reason: Option<String>,
    /// **Read only** The timestamp of when the refund was created.
    pub created_at: Option<DateTime>,
    /// **Read only** The timestamp of when the refund was last updated.
    pub updated_at: Option<DateTime>,
    /// **Read only** An optional ID of the team member associated with taking the payment.
    pub team_member_id: Option<String>,
}