Initialize the contract with fee wallet, token address, and platform fee rate
fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
fee_wallet: soroban_sdk::Address,
token_address: soroban_sdk::Address,
platform_fee_rate: u32,
) -> Result<(), soroban_sdk::Error>
Split payment between platform and merchant with percentage-based fee
fn split_payment(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
payment_id: soroban_sdk::String,
merchant: soroban_sdk::Address,
total_amount: i128,
) -> Result<(), soroban_sdk::Error>
Split payment with fixed fee amounts (no percentage calculation)
fn split_payment_fixed(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
payment_id: soroban_sdk::String,
merchant: soroban_sdk::Address,
merchant_amount: i128,
platform_fee_amount: i128,
) -> Result<(), soroban_sdk::Error>
Get payment details by ID
fn get_payment(
env: soroban_sdk::Env,
payment_id: soroban_sdk::String,
) -> Option
Get total number of payments processed
fn get_payment_count(env: soroban_sdk::Env) -> u64
Update fee wallet (admin only)
fn update_fee_wallet(
env: soroban_sdk::Env,
new_fee_wallet: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Update platform fee rate (admin only)
fn update_platform_fee_rate(
env: soroban_sdk::Env,
new_rate: u32,
) -> Result<(), soroban_sdk::Error>
Get current fee wallet
fn get_fee_wallet(env: soroban_sdk::Env) -> soroban_sdk::Address
Get current platform fee rate
fn get_platform_fee_rate(env: soroban_sdk::Env) -> u32
Get current token address
fn get_token_address(env: soroban_sdk::Env) -> soroban_sdk::Address