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
42
43
44
45
46
47
48
49
//! Model struct for PaymentRefund type
use crate::models::enums::DestinationType;
use serde::{Deserialize, Serialize};
use super::{DateTime, DestinationDetails, Money, ProcessingFee, enums::PaymentRefundStatus};
/// 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>,
/// Read only Flag indicating whether or not the refund is linked to an existing payment in Square.
pub unlinked: Option<bool>,
/// The destination type for this refund.
pub destination_type: Option<DestinationType>,
/// **Read only** Contains information about the refund destination. This field is populated only if
/// destination_id is defined in the RefundPayment request.
pub destination_details: Option<DestinationDetails>,
/// 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>,
}