This repository has been archived by the owner on Mar 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change/PHPLIB-187/add-geolocation-to-card (#174)
* [bugfix] (PHPLIB-309) Rename Cards holder to cardHolder. * [change] (PHPLIB-209) Fix tests add update version and CHANGELOG.md * [change] (PHPLIB-309) Update test. * [change] (PHPLIB-309) Update unit test. * [refactor] (PHPLIB-187) Geolocation: Move geolocation to trait. * [refactor] (PHPLIB-187) Geolocation: Add geolocation to card class. * [change] (PHPLIB-187) Fix styles. * [change] (PHPLIB-187) Update CHANGELOG.md * [change] (PHPLIB-187) Remove dead "code" * [change] (PHPLIB-187) Fix examples: Fix ids due to api changes. * [change] (PHPLIB-187) Fix examples: Fix ids due to api changes. Co-authored-by: sixer1182 <[email protected]>
- Loading branch information
Simon Gabriel
and
sixer1182
authored
May 12, 2020
1 parent
2367c5a
commit a5ef5e9
Showing
19 changed files
with
116 additions
and
47 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
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,59 @@ | ||
<?php | ||
/** | ||
* This trait adds geolocation to class. | ||
* | ||
* Copyright (C) 2020 heidelpay GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link https://docs.heidelpay.com/ | ||
* | ||
* @author Simon Gabriel <[email protected]> | ||
* | ||
* @package heidelpayPHP\Traits | ||
*/ | ||
namespace heidelpayPHP\Traits; | ||
|
||
use heidelpayPHP\Resources\EmbeddedResources\GeoLocation; | ||
|
||
trait HasGeoLocation | ||
{ | ||
/** @var GeoLocation $geoLocation */ | ||
private $geoLocation; | ||
|
||
//<editor-fold desc="Setters/Getters"> | ||
|
||
/** | ||
* @return GeoLocation | ||
*/ | ||
public function getGeoLocation(): GeoLocation | ||
{ | ||
if (empty($this->geoLocation)) { | ||
$this->geoLocation = new GeoLocation(); | ||
} | ||
return $this->geoLocation; | ||
} | ||
|
||
/** | ||
* @param GeoLocation $geoLocation | ||
* | ||
* @return $this | ||
*/ | ||
public function setGeoLocation(GeoLocation $geoLocation): self | ||
{ | ||
$this->geoLocation = $geoLocation; | ||
return $this; | ||
} | ||
|
||
//</editor-fold> | ||
} |
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
Oops, something went wrong.