Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get payment creation date #2647

Open
RomanMoshchytskiy opened this issue May 31, 2024 · 2 comments
Open

Unable to get payment creation date #2647

RomanMoshchytskiy opened this issue May 31, 2024 · 2 comments
Assignees
Labels
Not applicable Indicates that issue could not be handled within this repo or publicly

Comments

@RomanMoshchytskiy
Copy link

Describe the bug
In our custom code, we try to get the payment created date, but we encounter this TypeError:

TypeError: Adyen\Payment\Model\Order\Payment::getCreatedAt(): Return value must be of type DateTime, string returned in /vendor/adyen/module-payment/Model/Order/Payment.php:122

Magento version
2.4.5-p7

Plugin version
9.5.0

@RomanMoshchytskiy RomanMoshchytskiy added the Bug report Indicates that issue has been marked as a possible bug label May 31, 2024
@RokPopov
Copy link
Contributor

RokPopov commented Jun 5, 2024

Hi @RomanMoshchytskiy,

Thank you for raising this issue with us. Investigating on this, our plugin is setting the createdAt field in adyen_order_payment table here, and the type being passed to the DB is DateTime. Checking the value stored in the database while testing this flow, I can indeed confirm it to be a DateTime. I would suggest checking whether there are any customizations on your end that are interfering with how our plugin is storing this field in the database.

Kind regards,
Rok

@RokPopov RokPopov self-assigned this Jun 5, 2024
@RokPopov RokPopov added Not applicable Indicates that issue could not be handled within this repo or publicly and removed Bug report Indicates that issue has been marked as a possible bug labels Jun 5, 2024
@RomanMoshchytskiy
Copy link
Author

@RokPopov Yes, it is stored as a DateTime in the database, but when it was fetched from the database, it was returned as a string.

Here is the \Adyen\Payment\Model\Order\Payment object taken from the database
image

As you can see the dates here are in string format.

So, at least for \Adyen\Payment\Model\Order\Payment::getCreatedAt() the return type of the function must be string.

@RomanMoshchytskiy RomanMoshchytskiy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not applicable Indicates that issue could not be handled within this repo or publicly
Projects
None yet
Development

No branches or pull requests

2 participants