braintree / braintree_php

Braintree PHP library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
546 stars 224 forks source link

XML Generator DateTimeImmutable support #278

Closed mprokocki closed 3 years ago

mprokocki commented 4 years ago

General information

Issue description

Braintree\Xml\Generator::_createElementsFromArray line 89 throwing exception when one of attributes e.g. firstBillingDate in subscription gateway is DateTimeImmutable instance.

hollabaq86 commented 4 years ago

👋 @mprokocki thanks for reaching out. firstBillingDate should be DateTime class, do you encounter the same issue if you set firstBillingDate to a DateTime class?

mprokocki commented 4 years ago

If firstBillingDate is DateTime class everything is alright, just wondering why you are not supporting DateTimeImmutable also??

crookedneighbor commented 4 years ago

@mprokocki if you'd like to open a PR, we'd be happy to review it. Will just need to make sure it does not cause any breaking changes (or it'll have to wait till the next major version bump)

hollabaq86 commented 3 years ago

👋 Version 6.0.0 includes updates to support the DateTimeImmutable class 🎉 I'm going to go ahead and close this issue, but please let us know if you continue to encounter problems around these changes.