Api
TransferLogic ¶
audit_accounting_report ¶
Audits an accounting report against the Payment Gateway database.
:param account_id: The account id to audit :param accounting_report_document: The accounting report file in CSV format extracted from Payment provider :param start_date: The start date to filter the transfers
Note: This currently works for Adyen accounting reports only
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
create_internal_transfer ¶
create_internal_transfer(
session,
/,
*,
source,
destination,
amount,
effective_date,
description,
reference,
)
Create a double-entry internal transfer.
This will create a pair of internal transfers with opposite amounts, one negative for the source and one postitive for the destination.
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
create_internal_transfer_entry ¶
create_internal_transfer_entry(
session,
/,
*,
transfer_history_id,
amount,
effective_date,
description,
reference,
)
Create a single-entry internal transfer.
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
create_transfer_history ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_account_transfer_balance_within_period ¶
get_account_transfer_balance_within_period(
session,
/,
transfer_history_id,
*,
period_start_date,
period_end_date,
)
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_all_transfers ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_balance ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_bank_transfer_balance_within_period ¶
get_bank_transfer_balance_within_period(
session,
/,
transfer_history_id,
*,
period_start_date,
period_end_date,
)
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_card_transfers_by_card_ids ¶
Retrieves a list of CardTransfer objects associated with a specific card ID, optionally filtering for those without a transfer history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
Session
|
The session to use for the database operations. |
required |
card_ids
|
Iterable[CardId]
|
The ID of the card for which to retrieve associated CardTransfer objects. |
required |
without_transfer_history_only
|
bool
|
If True, the method will return only those CardTransfer objects that have no associated transfer history. Defaults to False. |
False
|
- list[CardTransfer]: A list of CardTransfer objects matching the provided criteria. This list may be empty if no matching objects are found.
Note: - The returned CardTransfer objects are ordered by their effective date in descending order, meaning the most recent payments are returned first.
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_internal_transfer_balance_within_period ¶
get_internal_transfer_balance_within_period(
session,
/,
transfer_history_id,
*,
period_start_date,
period_end_date,
)
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_transfer_by_ref ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_transfer_histories ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_transfer_history_id_by_private_ref ¶
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_transfers_by_effective_date ¶
get_transfers_by_effective_date(
session,
/,
transfer_history_ids,
*,
start_effective_date,
end_effective_date=None,
)
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
get_transfers_by_event_date ¶
get_transfers_by_event_date(
session,
/,
transfer_history_ids,
*,
start_effective_date,
end_effective_date,
transfer_types=None,
)
Use when dealing with card transfers and
you are not only interested in the date at which the card transfer was originated, but want to fetch the individual events associated to it. A Card payment can be theoretically opened for 30 days on mastercard (on Adyen is even more, we have cases of years, a bug on their side). During this period, each event can performa a balance change, therefore the date at which you made a balance change can be different of that of when the card transfer was originated. In Spain, for healthy benefits we have a real time approach for card transfers, therefore the flag filter_by_event_dates allows to retrieve events that happened during a given period, not just card transfers for which we only have the date at which it was started. NON card transfers are more simple and don't need to be treated differently for real time cases vs non-real time.
This method returns each type of transfer ordered by created_at, then it orders by effective_at
Source code in components/payment_gateway/subcomponents/transfers/protected/api.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |