forked from LiveCarta/PayPal-PHP-Server-SDK
Release 0.7.0
Beta Release 0.7.0 including: - Bug fixes - Updated model/function names - Updated models to reflect changes in APIs
This commit is contained in:
@@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace PaypalServerSdkLib\Models;
|
||||
|
||||
use PaypalServerSdkLib\ApiHelper;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
@@ -79,6 +80,16 @@ class Token implements \JsonSerializable
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the Token object to a human-readable string representation.
|
||||
*
|
||||
* @return string The string representation of the Token object.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return ApiHelper::stringify('Token', ['id' => $this->id, 'type' => $this->type]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode this object to JSON
|
||||
*
|
||||
@@ -92,7 +103,7 @@ class Token implements \JsonSerializable
|
||||
{
|
||||
$json = [];
|
||||
$json['id'] = $this->id;
|
||||
$json['type'] = TokenType::checkValue($this->type);
|
||||
$json['type'] = $this->type;
|
||||
|
||||
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user