pub struct PaymentDTO {
pub identifier: String,
pub user_uid: String,
pub amount: f64,
pub memo: String,
pub metadata: Value,
pub from_address: String,
pub to_address: String,
pub direction: Direction,
pub status: PaymentDTOStatus,
pub transaction: Option<PaymentDTOTransaction>,
pub created_at: String,
pub network: NetworkPassphrase,
}
Expand description
Payment data generated by Pi API
- identifier: String - payment identifier
- user_uid: String - user’s app-specific ID
- amount: f64 - payment amount
- memo: String - a String provided by the developer, shown to the user
- metadata: Value - an object provided by the developer for their own usage, serde_json::Value
- from_address: String - sender address of the blockchain transaction
- to_address: String - recipient address of the blockchain transaction
- direction: Direction - direction of the payment (“user_to_app” | “app_to_user”)
- status: PaymentDTOStatus - Status flags representing the current state of this payment
- developer_approved: bool - Server-Side Approval (automatically approved for A2U payment)
- transaction_verified: bool - blockchain transaction verified
- developer_completed: bool - Server-Side Completion (handled by the create_payment! method)
- cancelled: bool - cancelled by the developer or by Pi Network
- user_cancelled: bool - cancelled by the user
- transaction:
Option<PaymentDTOTransaction>
- Blockchain transaction data. This is None if no transaction has been made yet- txid: String - id of the blockchain transaction
- verified: bool - true if the transaction matches the payment, false otherwise
- _link: String - a link to the operation on the Pi Blockchain API
- created_at: String - payment’s creation timestamp
- network: NetworkPassphrase - a network of the payment (“Pi Network” | “Pi Testnet”)
Fields§
§identifier: String
§user_uid: String
§amount: f64
§memo: String
§metadata: Value
§from_address: String
§to_address: String
§direction: Direction
§status: PaymentDTOStatus
§transaction: Option<PaymentDTOTransaction>
§created_at: String
§network: NetworkPassphrase
Trait Implementations§
Source§impl Clone for PaymentDTO
impl Clone for PaymentDTO
Source§fn clone(&self) -> PaymentDTO
fn clone(&self) -> PaymentDTO
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PaymentDTO
impl Debug for PaymentDTO
Source§impl<'de> Deserialize<'de> for PaymentDTO
impl<'de> Deserialize<'de> for PaymentDTO
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PaymentDTO
impl RefUnwindSafe for PaymentDTO
impl Send for PaymentDTO
impl Sync for PaymentDTO
impl Unpin for PaymentDTO
impl UnwindSafe for PaymentDTO
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
Mutably borrows from an owned value. Read more