Struct TransactionCreate

Source
pub struct TransactionCreate {
Show 22 fields pub id: TransactionID, pub status: TransactionStatus, pub customer_id: CustomerID, pub address_id: AddressID, pub business_id: BusinessID, pub custom_data: Option<Value>, pub currency_code: CurrencyCode, pub origin: TransactionOrigin, pub subscription_id: SubscriptionID, pub invoice_id: InvoiceId, pub invoice_number: Option<String>, pub collection_mode: CollectionMode, pub discount_id: DiscountID, pub billing_details: BillingDetails, pub billing_period: Option<TimePeriod>, pub items: Vec<SubscriptionChargeItem>, pub details: TransactionDetails, pub payments: Vec<TransactionPaymentAttempt>, pub checkout: TransactionCheckout, pub created_at: DateTime<FixedOffset>, pub updated_at: DateTime<FixedOffset>, pub billed_at: Option<DateTime<FixedOffset>>,
}
Expand description

Represents a transaction entity when creating transactions.

Fields§

§id: TransactionID

Unique Paddle ID for this transaction entity, prefixed with txn_.

§status: TransactionStatus

Status of this transaction. You may set a transaction to billed or canceled, other statuses are set automatically by Paddle. Automatically-collected transactions may return completed if payment is captured successfully, or past_due if payment failed.

§customer_id: CustomerID

Paddle ID of the customer that this transaction is for, prefixed with ctm_. If omitted, transaction status is draft.

§address_id: AddressID

Paddle ID of the address that this transaction is for, prefixed with add_. Requires customer_id. If omitted, transaction status is draft.

§business_id: BusinessID

Paddle ID of the business that this transaction is for, prefixed with biz_. Requires customer_id.

§custom_data: Option<Value>

Your own structured key-value data.

§currency_code: CurrencyCode

Supported three-letter ISO 4217 currency code. Must be USD, EUR, or GBP if collection_mode is manual.

§origin: TransactionOrigin

Describes how this transaction was created.

§subscription_id: SubscriptionID

Paddle ID of the subscription that this transaction is for, prefixed with sub_.

§invoice_id: InvoiceId

Paddle ID of the invoice that this transaction is related to, prefixed with inv_. Used for compatibility with the Paddle Invoice API, which is now deprecated. This field is scheduled to be removed in the next version of the Paddle API.

§invoice_number: Option<String>

Invoice number for this transaction. Automatically generated by Paddle when you mark a transaction as billed where collection_mode is manual.

§collection_mode: CollectionMode

How payment is collected. automatic for checkout, manual for invoices.

§discount_id: DiscountID

Paddle ID of the discount applied to this transaction, prefixed with dsc_.

§billing_details: BillingDetails

Details for invoicing. Required if collection_mode is manual.

§billing_period: Option<TimePeriod>

Time period that this transaction is for. Set automatically by Paddle for subscription renewals to describe the period that charges are for.

§items: Vec<SubscriptionChargeItem>

List of items to charge for. You can charge for items that you’ve added to your catalog by passing the Paddle ID of an existing price entity, or you can charge for non-catalog items by passing a price object.

Non-catalog items can be for existing products, or you can pass a product object as part of your price to charge for a non-catalog product.

§details: TransactionDetails

Calculated totals for a transaction, including proration, discounts, tax, and currency conversion. Considered the source of truth for totals on a transaction.

§payments: Vec<TransactionPaymentAttempt>

List of payment attempts for this transaction, including successful payments. Sorted by created_at in descending order, so most recent attempts are returned first.

§checkout: TransactionCheckout

Paddle Checkout details for this transaction. You may pass a URL when creating or updating an automatically-collected transaction, or when creating or updating a manually-collected transaction where billing_details.enable_checkout is true.

§created_at: DateTime<FixedOffset>

RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.

§updated_at: DateTime<FixedOffset>

RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.

§billed_at: Option<DateTime<FixedOffset>>

RFC 3339 datetime string of when this transaction was marked as billed. null for transactions that aren’t billed or completed. Set automatically by Paddle.

Trait Implementations§

Source§

impl Clone for TransactionCreate

Source§

fn clone(&self) -> TransactionCreate

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TransactionCreate

Source§

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

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

impl<'de> Deserialize<'de> for TransactionCreate

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 Serialize for TransactionCreate

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

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<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> Same for T

Source§

type Output = T

Should always be Self
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<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,