payments-py

module plans

Utility functions for creating and managing payment plans.

Global Variables


function get_fiat_price_config

get_fiat_price_config(amount: int, receiver: str)  PlanPriceConfig

Get a fixed fiat price configuration for a plan.

Args:

Returns: A PlanPriceConfig object configured for fiat payments

Raises:


function get_crypto_price_config

get_crypto_price_config(
    amount: int,
    receiver: str,
    token_address: str = '0x0000000000000000000000000000000000000000'
)  PlanPriceConfig

Get a fixed crypto price configuration for a plan.

Args:

Returns: A PlanPriceConfig object configured for crypto payments

Raises:


function get_erc20_price_config

get_erc20_price_config(
    amount: int,
    token_address: str,
    receiver: str
)  PlanPriceConfig

Get a fixed ERC20 token price configuration for a plan.

Args:

Returns: A PlanPriceConfig object configured for ERC20 token payments


function get_free_price_config

get_free_price_config()  PlanPriceConfig

Get a free price configuration for a plan.

Returns: A PlanPriceConfig object configured for free plans


function get_native_token_price_config

get_native_token_price_config(amount: int, receiver: str)  PlanPriceConfig

Get a fixed native token price configuration for a plan.

Args:

Returns: A PlanPriceConfig object configured for native token payments


function get_expirable_duration_config

get_expirable_duration_config(duration_of_plan: int)  PlanCreditsConfig

Get an expirable duration configuration for a plan.

Args:

Returns: A PlanCreditsConfig object configured for expirable duration


function get_non_expirable_duration_config

get_non_expirable_duration_config()  PlanCreditsConfig

Get a non-expirable duration configuration for a plan.

Returns: A PlanCreditsConfig object configured for non-expirable duration


function get_fixed_credits_config

get_fixed_credits_config(
    credits_granted: int,
    credits_per_request: int = 1
)  PlanCreditsConfig

Get a fixed credits configuration for a plan.

Args:

Returns: A PlanCreditsConfig object configured for fixed credits


function get_dynamic_credits_config

get_dynamic_credits_config(
    credits_granted: int,
    min_credits_per_request: int = 1,
    max_credits_per_request: int = 1
)  PlanCreditsConfig

Get a dynamic credits configuration for a plan.

Args:

Returns: A PlanCreditsConfig object configured for dynamic credits


function set_redemption_type

set_redemption_type(
    credits_config: PlanCreditsConfig,
    redemption_type: PlanRedemptionType
)  PlanCreditsConfig

Set the redemption type for a credits configuration.

Args:

Returns: A new PlanCreditsConfig with the updated redemption type


function set_proof_required

set_proof_required(
    credits_config: PlanCreditsConfig,
    proof_required: bool = True
)  PlanCreditsConfig

Set whether proof is required for a credits configuration.

Args:

Returns: A new PlanCreditsConfig with the updated proof requirement


This file was automatically generated via lazydocs.