diff --git a/Helper/SendGeoLocation.php b/Helper/SendGeoLocation.php new file mode 100755 index 0000000000000000000000000000000000000000..7cdeb699c3bd2d09ac05b07b5bf21d7babc12dc9 --- /dev/null +++ b/Helper/SendGeoLocation.php @@ -0,0 +1,45 @@ +<?php +namespace NicolasBejean\Customer\Helper; + +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\Context; + +/** + * Class SendGeoLocation + * + * @category PHP + * @package NicolasBejean\Customer\Helper + * @author Nicolas Béjean <nicolas@bejean.eu> + * @license https://lab.frogg.it/bejean-developpement/magento-2/modules/customer/-/blob/master/LICENCE GPL3 Licence + * @link https://www.bejean.eu + */ +class SendGeoLocation extends AbstractHelper +{ + /** + * SendGeoLocation constructor. + * @param Context $context + */ + public function __construct( + Context $context + ) { + parent::__construct($context); + } + + public function sendDataToApi(CustomerInterface $customer, AddressInterface $address) + { + $createdAt = $customer->getCreatedAt(); + $updatedAt = $customer->getUpdatedAt(); + + $websiteId = $customer->getWebsiteId(); + $storeId = $customer->getStoreId(); + + $customerId = $customer->getId(); + $groupId = $customer->getGroupId(); + + $country = $address->getCountryId(); + $city = $address->getCity(); + $postCode = $address->getPostcode(); + } +}