-
Notifications
You must be signed in to change notification settings - Fork 44
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 #849 from mollie/PIPRES-349-append-subscription-ca…
…rrier-id-to-metadata PIPRES-349: Append subscription carrier ID to metadata
- Loading branch information
Showing
36 changed files
with
582 additions
and
277 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
||
header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
header('Cache-Control: post-check=0, pre-check=0', false); | ||
header('Pragma: no-cache'); | ||
|
||
header('Location: ../'); | ||
exit; |
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,11 @@ | ||
<?php | ||
|
||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
||
header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
header('Cache-Control: post-check=0, pre-check=0', false); | ||
header('Pragma: no-cache'); | ||
|
||
header('Location: ../'); | ||
exit; |
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,11 @@ | ||
<?php | ||
|
||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
||
header('Cache-Control: no-store, no-cache, must-revalidate'); | ||
header('Cache-Control: post-check=0, pre-check=0', false); | ||
header('Pragma: no-cache'); | ||
|
||
header('Location: ../'); | ||
exit; |
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,85 @@ | ||
<?php | ||
/** | ||
* Mollie https://www.mollie.nl | ||
* | ||
* @author Mollie B.V. <[email protected]> | ||
* @copyright Mollie B.V. | ||
* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md | ||
* | ||
* @see https://github.com/mollie/PrestaShop | ||
* @codingStandardsIgnoreStart | ||
*/ | ||
|
||
namespace Mollie\Subscription\DTO; | ||
|
||
if (!defined('_PS_VERSION_')) { | ||
exit; | ||
} | ||
|
||
class SubscriptionCarrierDeliveryPriceData | ||
{ | ||
/** @var int */ | ||
private $deliveryAddressId; | ||
/** @var int */ | ||
private $cartId; | ||
/** @var int */ | ||
private $customerId; | ||
/** @var array */ | ||
private $subscriptionProduct; | ||
/** @var int */ | ||
private $subscriptionCarrierId; | ||
|
||
public function __construct( | ||
int $deliveryAddressId, | ||
int $cartId, | ||
int $customerId, | ||
array $subscriptionProduct, | ||
int $subscriptionCarrierId | ||
) { | ||
$this->deliveryAddressId = $deliveryAddressId; | ||
$this->cartId = $cartId; | ||
$this->customerId = $customerId; | ||
$this->subscriptionProduct = $subscriptionProduct; | ||
$this->subscriptionCarrierId = $subscriptionCarrierId; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getDeliveryAddressId(): int | ||
{ | ||
return $this->deliveryAddressId; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCartId(): int | ||
{ | ||
return $this->cartId; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCustomerId(): int | ||
{ | ||
return $this->customerId; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getSubscriptionProduct(): array | ||
{ | ||
return $this->subscriptionProduct; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getSubscriptionCarrierId(): int | ||
{ | ||
return $this->subscriptionCarrierId; | ||
} | ||
} |
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,63 @@ | ||
<?php | ||
/** | ||
* Mollie https://www.mollie.nl | ||
* | ||
* @author Mollie B.V. <[email protected]> | ||
* @copyright Mollie B.V. | ||
* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md | ||
* | ||
* @see https://github.com/mollie/PrestaShop | ||
* @codingStandardsIgnoreStart | ||
*/ | ||
|
||
namespace Mollie\Subscription\Exception; | ||
|
||
if (!defined('_PS_VERSION_')) { | ||
exit; | ||
} | ||
|
||
class CouldNotCreateSubscriptionData extends MollieSubscriptionException | ||
{ | ||
public static function failedToFindMollieCustomer(string $email): self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Failed to find Mollie customer. Email: (%s)', | ||
), | ||
ExceptionCode::ORDER_FAILED_TO_FIND_MOLLIE_CUSTOMER | ||
); | ||
} | ||
|
||
public static function failedToRetrieveSubscriptionInterval(\Throwable $exception, int $productAttributeId): self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Failed to retrieve subscription interval. Product attribute ID: (%s)', | ||
$productAttributeId | ||
), | ||
ExceptionCode::ORDER_FAILED_TO_RETRIEVE_SUBSCRIPTION_INTERVAL, | ||
$exception | ||
); | ||
} | ||
|
||
public static function failedToProvideCarrierDeliveryPrice(\Throwable $exception): self | ||
{ | ||
return new self( | ||
'Failed to provide carrier delivery price.', | ||
ExceptionCode::ORDER_FAILED_TO_PROVIDE_CARRIER_DELIVERY_PRICE, | ||
$exception | ||
); | ||
} | ||
|
||
public static function failedToFindCurrency(int $currencyId): self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Failed to find currency. Currency ID: (%s)', | ||
$currencyId | ||
), | ||
ExceptionCode::ORDER_FAILED_TO_FIND_CURRENCY | ||
); | ||
} | ||
} |
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.