-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Releasing v3.28.0. Please check the changelog for the updates.
- Loading branch information
Showing
17 changed files
with
208 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace ChargeBee\ChargeBee\Models; | ||
|
||
use ChargeBee\ChargeBee\Model; | ||
use ChargeBee\ChargeBee\Request; | ||
use ChargeBee\ChargeBee\Util; | ||
|
||
class BusinessEntity extends Model | ||
{ | ||
|
||
protected $allowed = [ | ||
'id', | ||
'name', | ||
'status', | ||
'deleted', | ||
'createdAt', | ||
'resourceVersion', | ||
'updatedAt', | ||
]; | ||
|
||
|
||
|
||
# OPERATIONS | ||
#----------- | ||
|
||
public static function createTransfers($params, $env = null, $headers = array()) | ||
{ | ||
return Request::send(Request::POST, Util::encodeURIPath("business_entities","transfers"), $params, $env, $headers); | ||
} | ||
|
||
public static function getTransfers($params = array(), $env = null, $headers = array()) | ||
{ | ||
return Request::send(Request::GET, Util::encodeURIPath("business_entities","transfers"), $params, $env, $headers); | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace ChargeBee\ChargeBee\Models; | ||
|
||
use ChargeBee\ChargeBee\Model; | ||
use ChargeBee\ChargeBee\Request; | ||
use ChargeBee\ChargeBee\Util; | ||
|
||
class BusinessEntityTransfer extends Model | ||
{ | ||
|
||
protected $allowed = [ | ||
'id', | ||
'resourceType', | ||
'resourceId', | ||
'activeResourceId', | ||
'destinationBusinessEntityId', | ||
'sourceBusinessEntityId', | ||
'reasonCode', | ||
'createdAt', | ||
]; | ||
|
||
|
||
|
||
# OPERATIONS | ||
#----------- | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace ChargeBee\ChargeBee\Models; | ||
|
||
use ChargeBee\ChargeBee\Model; | ||
|
||
class CreditNoteSiteDetailsAtCreation extends Model | ||
{ | ||
protected $allowed = [ | ||
'timezone', | ||
'organizationAddress', | ||
]; | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace ChargeBee\ChargeBee\Models; | ||
|
||
use ChargeBee\ChargeBee\Model; | ||
|
||
class InvoiceSiteDetailsAtCreation extends Model | ||
{ | ||
protected $allowed = [ | ||
'timezone', | ||
'organizationAddress', | ||
]; | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ private static function doRequest($meth, $url, $env, $params = array(), $headers | |
throw new IOException($message, $errno); | ||
} | ||
|
||
$respJson = self::processResponse((string)$clientResponse->getBody(), $clientResponse->getStatusCode()); | ||
$respJson = self::processResponse((string)$clientResponse->getBody(), $clientResponse->getStatusCode(), $clientResponse->getHeaders()); | ||
return new Response($respJson, $clientResponse->getHeaders()); | ||
} | ||
|
||
|
@@ -80,7 +80,7 @@ private static function doRequest($meth, $url, $env, $params = array(), $headers | |
* @throws OperationFailedException | ||
* @throws PaymentException | ||
*/ | ||
public static function processResponse($response, $httpCode) | ||
public static function processResponse($response, $httpCode, $headers) | ||
{ | ||
$respJson = json_decode($response, true); | ||
if (!$respJson) { | ||
|
@@ -92,7 +92,7 @@ public static function processResponse($response, $httpCode) | |
throw new Exception("Sorry, something went wrong when trying to process the request. If this problem persists, contact us at [email protected]. \n type: internal_error, \n http_status_code: 500, \n error_code: internal_error "); | ||
} | ||
if ($httpCode < 200 || $httpCode > 299) { | ||
self::handleAPIRespError($httpCode, $respJson, $response); | ||
self::handleAPIRespError($httpCode, $respJson, $response, $headers); | ||
} | ||
return $respJson; | ||
} | ||
|
@@ -107,7 +107,7 @@ public static function processResponse($response, $httpCode) | |
* @throws OperationFailedException | ||
* @throws PaymentException | ||
*/ | ||
public static function handleAPIRespError($httpCode, $respJson, $response) | ||
public static function handleAPIRespError($httpCode, $respJson, $response, $headers) | ||
{ | ||
if (!isset($respJson['api_error_code'])) { | ||
throw new Exception("No api_error_code attribute in content. Probably not a ChargeBee's error response. The content is \n " . $response); | ||
|
@@ -117,13 +117,13 @@ public static function handleAPIRespError($httpCode, $respJson, $response) | |
$type = $respJson['type']; | ||
} | ||
if ($type == "payment") { | ||
throw new PaymentException($httpCode, $respJson); | ||
throw new PaymentException($httpCode, $respJson, $headers); | ||
} elseif ($type == "operation_failed") { | ||
throw new OperationFailedException($httpCode, $respJson); | ||
throw new OperationFailedException($httpCode, $respJson, $headers); | ||
} elseif ($type == "invalid_request") { | ||
throw new InvalidRequestException($httpCode, $respJson); | ||
throw new InvalidRequestException($httpCode, $respJson, $headers); | ||
} else { | ||
throw new APIError($httpCode, $respJson); | ||
throw new APIError($httpCode, $respJson, $headers); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,7 @@ | |
|
||
final class Version | ||
{ | ||
|
||
const VERSION = '3.27.2'; | ||
const VERSION = '3.28.0'; | ||
} | ||
|
||
?> |
Oops, something went wrong.