pub struct Payment {Show 40 fields
pub id: Option<String>,
pub created_at: Option<DateTime>,
pub updated_at: Option<DateTime>,
pub amount_money: Option<Money>,
pub tip_money: Option<Money>,
pub total_money: Option<Money>,
pub app_fee_money: Option<Money>,
pub approved_money: Option<Money>,
pub processing_fee: Option<Vec<ProcessingFee>>,
pub refunded_money: Option<Money>,
pub status: Option<PaymentStatus>,
pub delay_duration: Option<String>,
pub delay_action: Option<PaymentDelayAction>,
pub delayed_until: Option<DateTime>,
pub source_type: Option<PaymentSourceType>,
pub card_details: Option<CardPaymentDetails>,
pub cash_details: Option<CashPaymentDetails>,
pub bank_account_details: Option<BankAccountPaymentDetails>,
pub external_details: Option<ExternalPaymentDetails>,
pub wallet_details: Option<DigitalWalletDetails>,
pub buy_now_pay_later_details: Option<BuyNowPayLaterDetails>,
pub location_id: Option<String>,
pub order_id: Option<String>,
pub reference_id: Option<String>,
pub customer_id: Option<String>,
pub employee_id: Option<String>,
pub team_member_id: Option<String>,
pub refund_ids: Option<Vec<String>>,
pub risk_evaluation: Option<RiskEvaluation>,
pub buyer_email_address: Option<String>,
pub billing_address: Option<Address>,
pub shipping_address: Option<Address>,
pub note: Option<String>,
pub statement_description_identifier: Option<String>,
pub capabilities: Option<Vec<PaymentCapability>>,
pub receipt_number: Option<String>,
pub receipt_url: Option<String>,
pub device_details: Option<DeviceDetails>,
pub application_details: Option<ApplicationDetails>,
pub version_token: Option<String>,
}
Expand description
Represents a payment processed by the Square API.
Fields§
§id: Option<String>
Read only A unique ID for the payment.
created_at: Option<DateTime>
Read only The timestamp of when the payment was created.
updated_at: Option<DateTime>
Read only The timestamp of when the payment was last updated.
amount_money: Option<Money>
The amount processed for this payment, not including tip_money
.
The 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.
tip_money: Option<Money>
The amount designated as a tip.
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.
total_money: Option<Money>
Read only The total amount for the payment, including amount_money
and tip_money
.
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.
app_fee_money: Option<Money>
The amount the developer is taking as a fee for facilitating the payment on behalf of the seller. 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 Take Payments and Collect Fees.
The amount cannot be more than 90% of the total_money
value.
To set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS
OAuth permission is required. For
more information, see
Permissions.
approved_money: Option<Money>
The initial amount of money approved for this payment.
processing_fee: Option<Vec<ProcessingFee>>
Read only The processing fees and fee adjustments assessed by Square for this payment.
refunded_money: Option<Money>
Read only The total amount of the payment refunded to date.
This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents).
status: Option<PaymentStatus>
Read only The payment’s current status.
delay_duration: Option<String>
Read only The duration of time after the payment’s creation when Square automatically
applies the delay_action
to the payment. This automatic delay_action
applies only to
payments that do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the
delay_duration
time period.
This field is specified as a time duration, in RFC 3339 format.
Notes: This feature is only supported for card payments.
Default:
- Card-present payments: “PT36H” (36 hours) from the creation time.
- Card-not-present payments: “P7D” (7 days) from the creation time.
Example for 2 days, 12 hours, 30 minutes, and 15 seconds: P2DT12H30M15S
delay_action: Option<PaymentDelayAction>
Read only The action to be applied to the payment when the delay_duration
has elapsed.
This field is read-only.
delayed_until: Option<DateTime>
Read only The read-only timestamp of when the delay_action
is automatically applied.
Note that this field is calculated by summing the payment’s delay_duration
and
created_at
fields. The created_at
field is generated by Square and might not exactly
match the time on your local machine.
source_type: Option<PaymentSourceType>
Read only The source type for this payment.
For information about these payment source types, see Take Payments.
card_details: Option<CardPaymentDetails>
Read only Details about a card payment. These details are only populated if the
source_type
is CARD
.
cash_details: Option<CashPaymentDetails>
Details about a cash payment. These details are only populated if the source_type
is
CASH
.
bank_account_details: Option<BankAccountPaymentDetails>
Read only Details about a bank account payment. These details are only populated if the
source_type
is BANK_ACCOUNT
.
external_details: Option<ExternalPaymentDetails>
Read only Details about an external payment. The details are only populated if the
source_type
is EXTERNAL
.
wallet_details: Option<DigitalWalletDetails>
Read only Details about an wallet payment. The details are only populated if the
source_type
is WALLET
.
buy_now_pay_later_details: Option<BuyNowPayLaterDetails>
Read only Details about a Buy Now Pay Later payment. The details are only populated if
the source_type
is BUY_NOW_PAY_LATER
. For more information, see Afterpay
Payments.
location_id: Option<String>
Read only The ID of the location associated with the payment.
order_id: Option<String>
Read only The ID of the [Order] associated with the payment.
reference_id: Option<String>
Read only An optional ID that associates the payment with an entity in another system.
customer_id: Option<String>
Read only The [Customer] ID of the customer associated with the payment.
employee_id: Option<String>
Read only Deprecated: Use Payment.team_member_id
instead.
An optional ID of the employee associated with taking the payment.
team_member_id: Option<String>
Read only An optional ID of the [TeamMember] associated with taking the payment.
refund_ids: Option<Vec<String>>
Read only A list of refund_ids
identifying refunds for the payment.
risk_evaluation: Option<RiskEvaluation>
Read only Provides information about the risk associated with the payment, as determined by Square. This field is present for payments to sellers that have opted in to receive risk evaluations.
buyer_email_address: Option<String>
Read only The buyer’s email address.
billing_address: Option<Address>
Read only The buyer’s billing address.
shipping_address: Option<Address>
Read only The buyer’s shipping address.
note: Option<String>
Read only An optional note to include when creating a payment.
statement_description_identifier: Option<String>
Read only Additional payment information that gets added to the customer’s card statement as part of the statement description.
Note that the statement_description_identifier
might get truncated on the statement
description to fit the required information including the Square identifier (SQ *) and the
name of the seller taking the payment.
capabilities: Option<Vec<PaymentCapability>>
Read only Actions that can be performed on this payment.
receipt_number: Option<String>
Read only The payment’s receipt number. The field is missing if a payment is canceled.
receipt_url: Option<String>
Read only The URL for the payment’s receipt. The field is only populated for COMPLETED payments.
device_details: Option<DeviceDetails>
Read only Details about the device that took the payment.
application_details: Option<ApplicationDetails>
Read only Details about the application that took the payment.
version_token: Option<String>
Used for optimistic concurrency. This opaque token identifies a specific version of the
Payment
object.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Payment
impl<'de> Deserialize<'de> for Payment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Payment
impl StructuralPartialEq for Payment
Auto Trait Implementations§
impl Freeze for Payment
impl RefUnwindSafe for Payment
impl Send for Payment
impl Sync for Payment
impl Unpin for Payment
impl UnwindSafe for Payment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.