escrow_api/state/payment.rs
1use super::EscrowAccount;
2use steel::*;
3
4#[repr(C)]
5#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
6pub struct Payment {
7 pub payment_uid: [u8; 32], // 32 bytes - payment unique identifier from payment engine
8 pub escrow: Pubkey, // 32 bytes
9 pub buyer: Pubkey, // 32 bytes
10 pub seller: Pubkey, // 32 bytes
11 pub mint: Pubkey, // 32 bytes
12 pub amount: u64, // 8 bytes
13 pub created_at: i64, // 8 bytes
14 pub expires_at: i64, // 8 bytes
15 pub closed_at: i64, // 8 bytes - when payment can be closed (0 = not scheduled)
16 pub reference: Pubkey, // 32 bytes - solana pay protocol reference
17 pub order_num: [u8; 32], // 32 bytes - order number from off-chain order system
18 pub oracle_authority: Pubkey, // 32 bytes - oracle authority (Pubkey::default() for "None")
19 pub arbitration_deadline: i64, // 8 bytes - when arbitration auto-resolves (0 = not set)
20 pub oracle_confirmed: u8, // 1 byte - oracle confirmation flag
21 pub state: u8, // 1 byte
22 pub is_fulfilled: u8, // 1 byte - buyer confirmation flag
23 pub appeal_count: u8, // 1 byte - number of appeals (max 1)
24 // Removed: id (8 bytes) - payment_uid is now the identifier
25 // Removed: bank (32 bytes) - derivable from PDA seeds
26 // Total: 32+32+32+8+8+8+8+32+32+32+32+8+1+1+1+1 = 268 bytes, need 4 bytes padding for 272-byte alignment
27 pub _padding: [u8; 4], // 4 bytes padding for 272-byte alignment
28}
29
30account!(EscrowAccount, Payment);