crucialwebstudio / chargify-sdk-php

Chargify SDK for PHP
Apache License 2.0
26 stars 44 forks source link

cancelImmediately results in error 500 #20

Closed tomw1808 closed 6 years ago

tomw1808 commented 7 years ago

When I'm trying to cancel a subscription immediately, it results in an error 500 from chargify.

Reproduce:

$chargify = new Chargify($arrConfig); $subscription = $chargify->subscription(); $subscription->cancelImmediately(1234);

Possible cause:

An empty array is sent along as rawData.

Proposed Fix:

Service\Chargify\Subscription.php Line 437:

    $rawData = null;
    if($this->_params != []) {
        $rawData = $this->getRawData(array('subscription' => $this->_params));
    }
AntoineLemaire commented 6 years ago

I up this issue. @tomw1808's fix is working well

@crucialwebstudio, could you have a look?

Thanks

dan-bowen commented 6 years ago

Thanks for reporting and fixing this issue.

I have tagged a new release v0.1.4 with the changes to fix this issue.