Skip to content

Module yapapi.rest.payment

Classes

Allocation

class Allocation(
    _api:ya_payment.api.requestor_api.RequestorApi,
    id:str,
    amount:decimal.Decimal,
    expires:Union[datetime.datetime, NoneType]
)

Payment reservation for task processing.

Ancestors (in MRO)

  • yapapi.rest.payment._Link

Methods

delete
def delete(
    self
)
details
def details(
    self
) -> yapapi.rest.payment.AllocationDetails

AllocationDetails

class AllocationDetails(
    spent_amount:decimal.Decimal,
    remaining_amount:decimal.Decimal
)

AllocationDetails(spent_amount:decimal.Decimal, remaining_amount:decimal.Decimal)

Invoice

class Invoice(
    _api:ya_payment.api.requestor_api.RequestorApi,
    _base:ya_payment.models.invoice.Invoice
)

NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech

Do not edit the class manually.

Ancestors (in MRO)

  • ya_payment.models.invoice.Invoice

Class variables

attribute_map
openapi_types

Instance variables

activity_ids

Gets the activity_ids of this Invoice. # noqa: E501

:return: The activity_ids of this Invoice. # noqa: E501 :rtype: list[str]

agreement_id

Gets the agreement_id of this Invoice. # noqa: E501

:return: The agreement_id of this Invoice. # noqa: E501 :rtype: str

amount

Gets the amount of this Invoice. # noqa: E501

:return: The amount of this Invoice. # noqa: E501 :rtype: str

invoice_id

Gets the invoice_id of this Invoice. # noqa: E501

:return: The invoice_id of this Invoice. # noqa: E501 :rtype: str

issuer_id

Gets the issuer_id of this Invoice. # noqa: E501

:return: The issuer_id of this Invoice. # noqa: E501 :rtype: str

last_debit_note_id

Gets the last_debit_note_id of this Invoice. # noqa: E501

:return: The last_debit_note_id of this Invoice. # noqa: E501 :rtype: str

payee_addr

Gets the payee_addr of this Invoice. # noqa: E501

:return: The payee_addr of this Invoice. # noqa: E501 :rtype: str

payer_addr

Gets the payer_addr of this Invoice. # noqa: E501

:return: The payer_addr of this Invoice. # noqa: E501 :rtype: str

payment_due_date

Gets the payment_due_date of this Invoice. # noqa: E501

:return: The payment_due_date of this Invoice. # noqa: E501 :rtype: datetime

recipient_id

Gets the recipient_id of this Invoice. # noqa: E501

:return: The recipient_id of this Invoice. # noqa: E501 :rtype: str

status

Gets the status of this Invoice. # noqa: E501

:return: The status of this Invoice. # noqa: E501 :rtype: InvoiceStatus

timestamp

Gets the timestamp of this Invoice. # noqa: E501

:return: The timestamp of this Invoice. # noqa: E501 :rtype: datetime

Methods

accept
def accept(
    self,
    *,
    amount:Union[decimal.Decimal, str],
    allocation:'Allocation'
)
to_dict
def to_dict(
    self
)

Returns the model properties as a dict

to_str
def to_str(
    self
)

Returns the string representation of the model

InvoiceStatus

class InvoiceStatus(
    local_vars_configuration=None
)

NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech

Do not edit the class manually.

Class variables

ACCEPTED
CANCELLED
FAILED
ISSUED
RECEIVED
REJECTED
SETTLED
allowable_values

Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.

attribute_map
openapi_types

Methods

to_dict
def to_dict(
    self
)

Returns the model properties as a dict

to_str
def to_str(
    self
)

Returns the string representation of the model

Payment

class Payment(
    api_client:ya_payment.api_client.ApiClient
)

Methods

allocation
def allocation(
    self,
    allocation_id:str
) -> yapapi.rest.payment.Allocation
allocations
def allocations(
    self
) -> AsyncIterator[yapapi.rest.payment.Allocation]

Lists all active allocations.

Example:

Listing all active allocations

from yapapi import rest

async def list_allocations(payment_api: rest.Payment):
    async for allocation in payment_api.allocations():
        print(f'''allocation: {allocation.id}
            amount={allocation.amount},
            expires={allocation.expires}''')
incoming_invoices
def incoming_invoices(
    self
) -> AsyncIterator[yapapi.rest.payment.Invoice]
invoice
def invoice(
    self,
    invoice_id:str
) -> yapapi.rest.payment.Invoice
invoices
def invoices(
    self
) -> AsyncIterator[yapapi.rest.payment.Invoice]
new_allocation
def new_allocation(
    self,
    amount:decimal.Decimal,
    *,
    expires:Union[datetime.datetime, NoneType]=None,
    make_deposit:bool=False
) -> yapapi.rest.resource.ResourceCtx

Creates new allocation.

  • amount: Allocation amount.
  • expires: expiration timestamp. by default 30 minutes from now.
  • make_deposit: (unimplemented).