Closed feelinc closed 6 years ago
This commit seems to be incompatible with v2.2 of bitpay/php-client, which is specified in this project's composer file. I needed to revert the timestamp fix to make the extension work in checkout with bitpay/php-client ~2.2 and Magento 2.2.1.
I was using "magento/product-community-edition": "2.2.1" and "bitpay/php-client": "^3.0" when implement the fix.
Andrew, what's the error you are getting? I don't see any differences between PHP client v2.2 and v3 wrt getInvoiceTime ()
Good point, I didn't check if there were any changes in v3. The error I'm seeing is:
PHP Fatal error: Uncaught Error: Call to a member function getTimestamp() on integer in .../app/code/Bitpay/Core/Model/Method/Bitcoin.php:106
Ah, here we are, see: https://github.com/bitpay/php-bitpay-client/blob/3.0.x/src/Bitpay/Invoice.php vs https://github.com/bitpay/php-bitpay-client/blob/2.2.x/src/Bitpay/Invoice.php
setInvoiceTime method. 3.0 converts the value to a datetime object, 2.2 doesn't change the type, and an integer gets passed in.
I've updated PHP lib v2 (v2.2.15) to include the datetime code from PHP lib v3.
The code should now work. @andrewmoon can you double check?
Fix getting timestamp from invoice DateTime object and show billing address form/sellection at checkout