-
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 #25 from vippsas/publication-1.2.1
Publication v.1.2.1
- Loading branch information
Showing
70 changed files
with
4,582 additions
and
486 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,83 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api\Data; | ||
|
||
/** | ||
* Interface QuoteInterface | ||
* @api | ||
*/ | ||
interface QuoteAttemptInterface | ||
{ | ||
/** | ||
* @const string | ||
*/ | ||
const ENTITY_ID = 'entity_id'; | ||
|
||
/** | ||
* @const string Vipps Quote Id. | ||
*/ | ||
const PARENT_ID = 'parent_id'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const MESSAGE = 'message'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const CREATED_AT = 'created_at'; | ||
|
||
/** | ||
* @param int $parentId | ||
* @return self | ||
*/ | ||
public function setParentId(int $parentId); | ||
|
||
/** | ||
* @param string $message | ||
* @return string | ||
*/ | ||
public function setMessage(string $message); | ||
|
||
/** | ||
* @param string $createdAt | ||
* @return string | ||
*/ | ||
public function setCreatedAt(string $createdAt); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getParentId(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getEntityId(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getMessage(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCreatedAt(); | ||
} |
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,133 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api\Data; | ||
|
||
use Vipps\Payment\Model\Quote; | ||
|
||
/** | ||
* Interface QuoteInterface | ||
* @api | ||
*/ | ||
interface QuoteInterface extends QuoteStatusInterface | ||
{ | ||
/** | ||
* @const string | ||
*/ | ||
const ENTITY_ID = 'entity_id'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const QUOTE_ID = 'quote_id'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const RESERVED_ORDER_ID = 'reserved_order_id'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const CREATED_AT = 'created_at'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const UPDATED_AT = 'updated_at'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const ATTEMPTS = 'attempts'; | ||
|
||
/** | ||
* @const string | ||
*/ | ||
const STORE_ID = 'store_id'; | ||
|
||
/** | ||
* @param int $quoteId | ||
* @return self | ||
*/ | ||
public function setQuoteId(int $quoteId); | ||
|
||
/** | ||
* @param string|null $reservedOrderId | ||
* @return self | ||
*/ | ||
public function setReservedOrderId($reservedOrderId); | ||
|
||
/** | ||
* @param string $createdAt | ||
* @return self | ||
*/ | ||
public function setCreatedAt(string $createdAt); | ||
|
||
/** | ||
* @param string $updatedAt | ||
* @return self | ||
*/ | ||
public function setUpdatedAt(string $updatedAt); | ||
|
||
/** | ||
* @param int $attempts | ||
* @return self | ||
*/ | ||
public function setAttempts(int $attempts); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getQuoteId(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getReservedOrderId(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCreatedAt(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUpdatedAt(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getAttempts(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getEntityId(); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getStoreId(); | ||
|
||
/** | ||
* @param int $storeId | ||
* @return self | ||
*/ | ||
public function setStoreId(int $storeId); | ||
} |
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,49 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api\Data; | ||
|
||
/** | ||
* Interface QuoteInterface | ||
* @api | ||
*/ | ||
interface QuoteStatusInterface | ||
{ | ||
/** | ||
* @const string(10) | ||
*/ | ||
const FIELD_STATUS = 'status'; | ||
|
||
const STATUS_NEW = 'new'; | ||
const STATUS_EXPIRED = 'expired'; | ||
const STATUS_PLACED = 'placed'; | ||
const STATUS_PROCESSING = 'processing'; | ||
const STATUS_PLACE_FAILED = 'place_failed'; | ||
const STATUS_CANCELED = 'canceled'; | ||
const STATUS_CANCEL_FAILED = 'cancel_failed'; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getStatus(); | ||
|
||
/** | ||
* @param string $status | ||
* @return self | ||
*/ | ||
public function setStatus(string $status); | ||
} |
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 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api\Quote; | ||
|
||
use Magento\Framework\Exception\CouldNotSaveException; | ||
use Vipps\Payment\Api\Data\QuoteAttemptInterface; | ||
|
||
/** | ||
* Interface AttemptRepositoryInterface | ||
* @api | ||
*/ | ||
interface AttemptRepositoryInterface | ||
{ | ||
/** | ||
* @param QuoteAttemptInterface $attempt | ||
* @return QuoteAttemptInterface | ||
* @throws CouldNotSaveException | ||
*/ | ||
public function save(QuoteAttemptInterface $attempt); | ||
} |
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,40 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api\Quote; | ||
|
||
use Magento\Quote\Api\Data\CartInterface; | ||
use Vipps\Payment\Api\Data\QuoteInterface; | ||
use Vipps\Payment\Gateway\Transaction\Transaction; | ||
|
||
/** | ||
* Cancels Vipps payment everywhere. | ||
* @api | ||
*/ | ||
interface CancelFacadeInterface | ||
{ | ||
/** | ||
* Cancel Vipps payment transaction both, Magento and Vipps. | ||
* | ||
* @param QuoteInterface $vippsQuote | ||
* @param CartInterface|null $quote | ||
*/ | ||
public function cancel( | ||
QuoteInterface $vippsQuote, | ||
CartInterface $quote | ||
); | ||
} |
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,50 @@ | ||
<?php | ||
/** | ||
* Copyright 2018 Vipps | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | ||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | ||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
* IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
namespace Vipps\Payment\Api; | ||
|
||
use Magento\Quote\Api\Data\CartInterface; | ||
use Vipps\Payment\Api\Data\QuoteInterface; | ||
use Vipps\Payment\Model\Quote; | ||
|
||
/** | ||
* Interface QuoteManagementInterface | ||
* @api | ||
*/ | ||
interface QuoteManagementInterface | ||
{ | ||
/** | ||
* @param CartInterface $cart | ||
* @return QuoteInterface | ||
*/ | ||
public function create(CartInterface $cart); | ||
|
||
/** | ||
* @param CartInterface $cart | ||
* @return Quote | ||
* @throws \Magento\Framework\Exception\CouldNotSaveException | ||
*/ | ||
public function getByQuote(CartInterface $cart); | ||
|
||
/** | ||
* Loads Vipps monitoring as extension attribute. | ||
* | ||
* @param CartInterface $quote | ||
* @throws \Magento\Framework\Exception\CouldNotSaveException | ||
*/ | ||
public function loadExtensionAttribute(CartInterface $quote); | ||
} |
Oops, something went wrong.