Struct Payment

Source
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>
👎Deprecated

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 Clone for Payment

Source§

fn clone(&self) -> Payment

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Payment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Payment

Source§

fn default() -> Payment

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Payment

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Payment

Source§

fn eq(&self, other: &Payment) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Payment

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Payment

Source§

impl StructuralPartialEq for Payment

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,