Source code for worldline.acquiring.sdk.v1.domain.api_technical_reversal_request
# -*- coding: utf-8 -*-
#
# This file was automatically generated.
#
from datetime import datetime
from typing import Optional
from worldline.acquiring.sdk.domain.data_object import DataObject
[docs]
class ApiTechnicalReversalRequest(DataObject):
__operation_id: Optional[str] = None
__reason: Optional[str] = None
__transaction_timestamp: Optional[datetime] = None
@property
def operation_id(self) -> Optional[str]:
"""
| A globally unique identifier of the operation, generated by you.
| We advise you to submit a UUID or an identifier composed of an arbitrary string and a UUID/URL-safe Base64 UUID (RFC 4648 ยง5).
| It's used to detect duplicate requests or to reference an operation in technical reversals.
Type: str
"""
return self.__operation_id
@operation_id.setter
def operation_id(self, value: Optional[str]) -> None:
self.__operation_id = value
@property
def reason(self) -> Optional[str]:
"""
| Reason for reversal
Type: str
"""
return self.__reason
@reason.setter
def reason(self, value: Optional[str]) -> None:
self.__reason = value
@property
def transaction_timestamp(self) -> Optional[datetime]:
"""
| Timestamp of transaction in ISO 8601 format (YYYY-MM-DDThh:mm:ss+TZD)
| It can be expressed in merchant time zone (ex: 2023-10-10T08:00+02:00) or in UTC (ex: 2023-10-10T08:00Z)
Type: datetime
"""
return self.__transaction_timestamp
@transaction_timestamp.setter
def transaction_timestamp(self, value: Optional[datetime]) -> None:
self.__transaction_timestamp = value
[docs]
def to_dictionary(self) -> dict:
dictionary = super(ApiTechnicalReversalRequest, self).to_dictionary()
if self.operation_id is not None:
dictionary['operationId'] = self.operation_id
if self.reason is not None:
dictionary['reason'] = self.reason
if self.transaction_timestamp is not None:
dictionary['transactionTimestamp'] = DataObject.format_datetime(self.transaction_timestamp)
return dictionary
[docs]
def from_dictionary(self, dictionary: dict) -> 'ApiTechnicalReversalRequest':
super(ApiTechnicalReversalRequest, self).from_dictionary(dictionary)
if 'operationId' in dictionary:
self.operation_id = dictionary['operationId']
if 'reason' in dictionary:
self.reason = dictionary['reason']
if 'transactionTimestamp' in dictionary:
self.transaction_timestamp = DataObject.parse_datetime(dictionary['transactionTimestamp'])
return self