-
Notifications
You must be signed in to change notification settings - Fork 15
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 #5 from Paazl/1.0.6
1.0.6
- Loading branch information
Showing
26 changed files
with
794 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
/** | ||
* Copyright © 2019 Paazl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Paazl\CheckoutWidget\Api\Data\Quote; | ||
|
||
/** | ||
* Interface QuoteReferenceInterface | ||
* | ||
* @package Paazl\CheckoutWidget\Api\Data\Quote | ||
*/ | ||
interface QuoteReferenceInterface | ||
{ | ||
|
||
/**#@+ | ||
* Indexes of fields | ||
* | ||
* @var string | ||
*/ | ||
const ENTITY_ID = 'entity_id'; | ||
const QUOTE_ID = 'quote_id'; | ||
const EXT_SHIPPING_INFO = 'ext_shipping_info'; | ||
const TOKEN = 'token'; | ||
const TOKEN_EXPIRES_AT = 'token_expires_at'; | ||
/**#@-*/ | ||
|
||
/** | ||
* @return int|null | ||
*/ | ||
public function getQuoteId(); | ||
|
||
/** | ||
* @param int $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setQuoteId(int $value); | ||
|
||
/** | ||
* @param string $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setExtShippingInfo($value); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getExtShippingInfo(); | ||
|
||
/** | ||
* @param string $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setToken($value); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getToken(); | ||
|
||
/** | ||
* @param string $value | ||
* | ||
* @return $this | ||
*/ | ||
public function setTokenExpiresAt($value); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTokenExpiresAt(); | ||
} |
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,35 @@ | ||
<?php | ||
/** | ||
* Copyright © 2019 Paazl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Paazl\CheckoutWidget\Api; | ||
|
||
use Magento\Framework\Exception\CouldNotSaveException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Paazl\CheckoutWidget\Api\Data\Quote\QuoteReferenceInterface; | ||
|
||
/** | ||
* Interface QuoteReferenceRepositoryInterface | ||
* @package Paazl\CheckoutWidget\Api | ||
*/ | ||
interface QuoteReferenceRepositoryInterface | ||
{ | ||
|
||
/** | ||
* @param $quoteId | ||
* | ||
* @return QuoteReferenceInterface | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getByQuoteId($quoteId); | ||
|
||
/** | ||
* @param QuoteReferenceInterface $reference | ||
* | ||
* @return QuoteReferenceInterface | ||
* @throws CouldNotSaveException | ||
*/ | ||
public function save(QuoteReferenceInterface $reference); | ||
} |
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,52 @@ | ||
<?php | ||
/** | ||
* Copyright © 2019 Paazl. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Paazl\CheckoutWidget\Model\Checkout; | ||
|
||
use Magento\Checkout\Model\ConfigProviderInterface; | ||
use Magento\Framework\Locale\ResolverInterface; | ||
|
||
/** | ||
* Class LanguageProvider | ||
* @package Paazl\CheckoutWidget\Model\Checkout | ||
*/ | ||
class LanguageProvider implements ConfigProviderInterface | ||
{ | ||
|
||
/** | ||
* @var ResolverInterface | ||
*/ | ||
private $resolver; | ||
|
||
/** | ||
* LanguageProvider constructor. | ||
* | ||
* @param ResolverInterface $resolver | ||
*/ | ||
public function __construct( | ||
ResolverInterface $resolver | ||
) { | ||
$this->resolver = $resolver; | ||
} | ||
|
||
/** | ||
* Retrieve assoc array of checkout configuration | ||
* | ||
* @return array | ||
*/ | ||
public function getConfig() | ||
{ | ||
$languageCode = 'en'; | ||
if ($this->resolver->getLocale()) { | ||
$locale = $this->resolver->getLocale(); | ||
$languageCode = explode('_', $locale)[0]; | ||
} | ||
|
||
return [ | ||
'language' => $languageCode, | ||
]; | ||
} | ||
} |
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.