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

fix(invoices): se corrige un error que causaba que fallara el método status #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Resources/Invoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ public function download_cancellation_receipt_pdf( $id ) {
*/
public function update_status( $id ) {
try {
return json_decode( $this->execute_JSON_put_request( $this->get_request_url( $id . "/status" ), null ) );
return json_decode( $this->execute_JSON_put_request( $this->get_request_url( $id . "/status" ), []) );
} catch ( Facturapi_Exception $e ) {
throw new Facturapi_Exception( 'Unable to update status: ' . $e );
throw new Facturapi_Exception( 'Unable to update status: ' . $e->getMessage());
}
}

Expand All @@ -187,7 +187,7 @@ public function update_draft( $id, $body ) {
try {
return json_decode( $this->execute_JSON_put_request( $this->get_request_url( $id ), $body ) );
} catch ( Facturapi_Exception $e ) {
throw new Facturapi_Exception( 'Unable to edit draft: ' . $e );
throw new Facturapi_Exception( 'Unable to edit draft: ' . $e->getMessage());
}
}

Expand All @@ -203,7 +203,7 @@ public function stamp_draft( $id, $query ) {
try {
return json_decode( $this->execute_JSON_post_request( $this->get_request_url( $id . "/stamp", $query ), null ) );
} catch ( Facturapi_Exception $e ) {
throw new Facturapi_Exception( 'Unable to stamp draft: ' . $e );
throw new Facturapi_Exception( 'Unable to stamp draft: ' . $e->getMessage());
}
}

Expand All @@ -217,7 +217,7 @@ public function copy_to_draft( $id ) {
try {
return json_decode( $this->execute_JSON_post_request( $this->get_request_url( $id . "/copy" ), null ) );
} catch ( Facturapi_Exception $e ) {
throw new Facturapi_Exception( 'Unable to copy draft: ' . $e );
throw new Facturapi_Exception( 'Unable to copy draft: ' . $e->getMessage());
}
}
}
8 changes: 4 additions & 4 deletions src/Resources/Organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public function getSeriesGroup($id)
try {
return json_decode($this->execute_get_request($this->get_request_url($id) . "/series-group"));
} catch (Facturapi_Exception $e) {
throw new Facturapi_Exception('Unable to find series: ' . $e);
throw new Facturapi_Exception('Unable to find series: ' .$e->getMessage());
}
}

Expand All @@ -345,7 +345,7 @@ public function createSeriesGroup($id, $params)
try {
return json_decode($this->execute_JSON_post_request($this->get_request_url($id) . "/series-group", $params));
} catch (Facturapi_Exception $e) {
throw new Facturapi_Exception('Unable to create series: ' . $e);
throw new Facturapi_Exception('Unable to create series: ' .$e->getMessage());
}
}

Expand All @@ -368,7 +368,7 @@ public function updateSeriesGroup($id, $series_name, $params)
try {
return json_decode($this->execute_JSON_put_request($this->get_request_url($id) . "/series-group" . "/" . $series_name, $params));
} catch (Facturapi_Exception $e) {
throw new Facturapi_Exception('Unable to create series: ' . $e);
throw new Facturapi_Exception('Unable to create series: ' .$e->getMessage());
}
}

Expand All @@ -391,7 +391,7 @@ public function deleteSeriesGroup($id, $series_name)
try {
return json_decode($this->execute_delete_request($this->get_request_url($id) . "/series-group" . "/" . $series_name, null));
} catch (Facturapi_Exception $e) {
throw new Facturapi_Exception('Unable to create series: ' . $e);
throw new Facturapi_Exception('Unable to create series: ' .$e->getMessage());
}
}

Expand Down