dinkbit / conekta-cashier

Laravel + Conekta = Painless subscription billing. http://laravel.com
MIT License
34 stars 22 forks source link

$trialEnd variable has to be a Carbon Object. Return Conekta subscription response on create #21

Closed erickcg closed 7 years ago

erickcg commented 7 years ago

$trialEnd is supposed to be a \Carbon\Carbon instance, but sometimes it is requested as \Datetime and the function toIso8601String is not valid that way.

Also on the other commits, the crate function for subscription now returns the response from conekta, so we don't have to wait for a external webhook management.

joecohens commented 7 years ago

Thanks for the PR! It would be better to use $date->format(DateTime::ATOM) instead changing to Carbon since Carbon extends DateTime https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php#L53

erickcg commented 7 years ago

@joecohens, Well, then you would have to change line 482: $this->trialEnd->toIso8601String() and 221: $customer->updateSubscription(['trial_end' => $trialEnd->toIso8601String()] Because toIso8601String() is not available to \Datetime.

joecohens commented 7 years ago

Thanks 🍻 ! Closed by https://github.com/dinkbit/conekta-cashier/pull/31