Exemplo n.º 1
0
def page(cursor=None,
         limit=None,
         after=None,
         before=None,
         types=None,
         payment_ids=None,
         user=None):
    """# Retrieve paged darfpayment.Logs
    Receive a list of up to 100 darfpayment.Log objects previously created in the Stark Bank API and the cursor to the next page.
    Use this function instead of query if you want to manually page your requests.
    ## Parameters (optional):
    - cursor [string, default None]: cursor returned on the previous page function call
    - limit [integer, default 100]: maximum number of objects to be retrieved. It must be an integer between 1 and 100. ex: 50
    - after [datetime.date or string, default None] date filter for objects created only after specified date. ex: datetime.date(2020, 3, 10)
    - before [datetime.date or string, default None] date filter for objects created only before specified date. ex: datetime.date(2020, 3, 10)
    - types [list of strings, default None]: filter retrieved objects by types. ex: "success" or "failed"
    - payment_ids [list of strings, default None]: list of TaxPayment ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
    - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkbank.user was set before function call
    ## Return:
    - list of darfpayment.Log objects with updated attributes
    - cursor to retrieve the next page of darfpayment.Log objects
    """
    return rest.get_page(
        resource=_resource,
        cursor=cursor,
        limit=limit,
        after=check_date(after),
        before=check_date(before),
        types=types,
        payment_ids=payment_ids,
        user=user,
    )
Exemplo n.º 2
0
def query(limit=None,
          after=None,
          before=None,
          event_ids=None,
          webhook_ids=None,
          user=None):
    """# Retrieve event.Attempts
    Receive a generator of event.Attempt objects previously created in the Stark Bank API
    ## Parameters (optional):
    - limit [integer, default None]: maximum number of objects to be retrieved. Unlimited if None. ex: 35
    - after [datetime.date or string, default None] date filter for objects created only after specified date. ex: datetime.date(2020, 3, 10)
    - before [datetime.date or string, default None] date filter for objects created only before specified date. ex: datetime.date(2020, 3, 10)
    - event_ids [list of strings, default None]: list of Event ids to filter attempts. ex: ["5656565656565656", "4545454545454545"]
    - webhook_ids [list of strings, default None]: list of Webhook ids to filter attempts. ex: ["5656565656565656", "4545454545454545"]
    - user [Organization/Project object, default None]: Organization or Project object. Not necessary if starkbank.user was set before function call
    ## Return:
    - generator of event.Attempt objects with updated attributes
    """
    return rest.get_stream(
        resource=_resource,
        limit=limit,
        after=check_date(after),
        before=check_date(before),
        event_ids=event_ids,
        webhook_ids=webhook_ids,
        user=user,
    )
Exemplo n.º 3
0
def query(limit=None,
          after=None,
          before=None,
          types=None,
          payment_ids=None,
          user=None):
    """# Retrieve darfpayment.Log's
    Receive a generator of darfpayment.Log objects previously created in the Stark Bank API
    ## Parameters (optional):
    - limit [integer, default None]: maximum number of objects to be retrieved. Unlimited if None. ex: 35
    - after [datetime.date or string, default None] date filter for objects created only after specified date. ex: datetime.date(2020, 3, 10)
    - before [datetime.date or string, default None] date filter for objects created only before specified date. ex: datetime.date(2020, 3, 10)
    - types [list of strings, default None]: filter retrieved objects by event types. ex: "processing" or "success"
    - payment_ids [list of strings, default None]: list of DarfPayment ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
    - user [Project object, default None]: Project object. Not necessary if starkbank.user was set before function call
    ## Return:
    - list of darfpayment.Log objects with updated attributes
    """
    return rest.get_stream(
        resource=_resource,
        limit=limit,
        after=check_date(after),
        before=check_date(before),
        types=types,
        payment_ids=payment_ids,
        user=user,
    )
Exemplo n.º 4
0
    def __init__(self, description, revenue_code, tax_id, competence, nominal_amount, fine_amount, interest_amount,
                 due, reference_number=None, scheduled=None, tags=None, id=None, status=None, amount=None, fee=None,
                 transaction_ids=None, updated=None, created=None):
        Resource.__init__(self, id=id)

        self.revenue_code = revenue_code
        self.tax_id = tax_id
        self.competence = check_date(competence)
        self.reference_number = reference_number
        self.fine_amount = fine_amount
        self.interest_amount = interest_amount
        self.due = check_date(due)
        self.description = description
        self.tags = tags
        self.scheduled = check_date(scheduled)
        self.status = status
        self.amount = amount
        self.nominal_amount = nominal_amount
        self.fee = fee
        self.transaction_ids = transaction_ids
        self.updated = check_datetime(updated)
        self.created = check_datetime(created)