mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] account_statement_import_online_paypal : search transaction with a 1 second margin to ensure it is found
This commit is contained in:
@@ -364,14 +364,15 @@ class OnlineBankStatementProviderPayPal(models.Model):
|
|||||||
|
|
||||||
def _paypal_get_transaction(self, token, transaction_id, timestamp):
|
def _paypal_get_transaction(self, token, transaction_id, timestamp):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
transaction_date = timestamp.isoformat() + "Z"
|
transaction_date_ini = (timestamp - relativedelta(seconds=1)).isoformat() + "Z"
|
||||||
|
transaction_date_end = (timestamp + relativedelta(seconds=1)).isoformat() + "Z"
|
||||||
url = (
|
url = (
|
||||||
(self.api_base or PAYPAL_API_BASE)
|
(self.api_base or PAYPAL_API_BASE)
|
||||||
+ "/v1/reporting/transactions"
|
+ "/v1/reporting/transactions"
|
||||||
+ ("?start_date=%s" "&end_date=%s" "&fields=all")
|
+ ("?start_date=%s" "&end_date=%s" "&fields=all")
|
||||||
% (
|
% (
|
||||||
transaction_date,
|
transaction_date_ini,
|
||||||
transaction_date,
|
transaction_date_end,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
data = self._paypal_retrieve(url, token)
|
data = self._paypal_retrieve(url, token)
|
||||||
|
|||||||
Reference in New Issue
Block a user