square_api_client/models/gift_card_activity_refund.rs
1//! Model struct for GiftCardActivityRefund type
2
3use serde::{Deserialize, Serialize};
4
5use super::Money;
6
7/// Represents details about a `REFUND` [gift card activity type](GiftCardActivityType).
8#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
9pub struct GiftCardActivityRefund {
10 /// The amount added to the gift card for the refund. This value is a positive integer.
11 ///
12 /// This field is required when creating a `REFUND` activity. The amount can represent a full or
13 /// partial refund.
14 pub amount_money: Option<Money>,
15 /// **Read only** The ID of the refunded payment. Square populates this field if the refund is
16 /// for a payment processed by Square and one of the following conditions is true:
17 /// - The Refunds API is used to refund a gift card payment to the same gift card.
18 /// - A seller initiated the refund from Square Point of Sale or the Seller Dashboard. The
19 /// payment source can be the same gift card or a cross-tender payment from a credit card or a
20 /// different gift card.
21 pub payment_id: Option<String>,
22 /// The ID of the refunded `REDEEM` gift card activity. Square populates this field if the
23 /// `payment_id` in the corresponding
24 /// [RefundPayment](https://developer.squareup.com/reference/square/refunds-api/refund-payment)
25 /// request represents a redemption made by the same gift card. Note that you must use
26 /// `RefundPayment` to refund a gift card payment to the same gift card if the payment was
27 /// processed by Square.
28 ///
29 /// For applications that use a custom payment processing system, this field is required when
30 /// creating a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same
31 /// gift card.
32 pub redeem_activity_id: Option<String>,
33 /// A client-specified ID that associates the gift card activity with an entity in another
34 /// system.
35 pub reference_id: Option<String>,
36}