-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from square/release/21.1.0.20220823
Generated PR for Release: 21.1.0.20220823
- Loading branch information
Showing
9 changed files
with
124 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# Clearpay Details | ||
|
||
Additional details about Clearpay payments. | ||
|
||
## Structure | ||
|
||
`ClearpayDetails` | ||
|
||
## Fields | ||
|
||
| Name | Type | Tags | Description | Getter | Setter | | ||
| --- | --- | --- | --- | --- | --- | | ||
| `emailAddress` | `?string` | Optional | Email address on the buyer's Clearpay account.<br>**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | | ||
|
||
## Example (as JSON) | ||
|
||
```json | ||
{ | ||
"email_address": null | ||
} | ||
``` | ||
|
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,60 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Square\Models; | ||
|
||
use stdClass; | ||
|
||
/** | ||
* Additional details about Clearpay payments. | ||
*/ | ||
class ClearpayDetails implements \JsonSerializable | ||
{ | ||
/** | ||
* @var string|null | ||
*/ | ||
private $emailAddress; | ||
|
||
/** | ||
* Returns Email Address. | ||
* Email address on the buyer's Clearpay account. | ||
*/ | ||
public function getEmailAddress(): ?string | ||
{ | ||
return $this->emailAddress; | ||
} | ||
|
||
/** | ||
* Sets Email Address. | ||
* Email address on the buyer's Clearpay account. | ||
* | ||
* @maps email_address | ||
*/ | ||
public function setEmailAddress(?string $emailAddress): void | ||
{ | ||
$this->emailAddress = $emailAddress; | ||
} | ||
|
||
/** | ||
* Encode this object to JSON | ||
* | ||
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields | ||
* are set. (default: false) | ||
* | ||
* @return array|stdClass | ||
*/ | ||
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) | ||
public function jsonSerialize(bool $asArrayWhenEmpty = false) | ||
{ | ||
$json = []; | ||
if (isset($this->emailAddress)) { | ||
$json['email_address'] = $this->emailAddress; | ||
} | ||
$json = array_filter($json, function ($val) { | ||
return $val !== null; | ||
}); | ||
|
||
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; | ||
} | ||
} |
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