Skip to content

Commit

Permalink
Merge major-release branch into main for Magento2 repositories (#275)
Browse files Browse the repository at this point in the history
* Move the Payment booster view logic (#243)

* Move the Payment booster view logic

* Move the Payment booster view logic - bug fixes

* Make place order logic more flexible and configurable.

* Make place order logic more flexible and configurable.

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Move the Payment booster view logic

* Make Payment Title handler configurable. Fix multi-shipping checkout bold payment method render error.

* Move the Payment booster view logic - update Life element options

* Move the Payment booster view logic

---------

Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>
Co-authored-by: Nickolas Malovanets <nickolas.malovanets@boldcommerce.com>
Co-authored-by: Victor Petryk <victor.petryk@boldcommerce.com>

* PPCP (PayPal Button) - Different Address in Checkout & PayPal Wallet Causes Issues. (#248)

* PIGI iframe should be styled through an API within the Magento admin (#247)

* PIGI iframe should be styled through an API within the Magento admin

* PIGI iframe should be styled through an API within the Magento admin - typo fixes

---------

Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>

* bumps version to new beta

* PIGI iframe should be styled through an API within the Magento admin (#258)

Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>

* As a customer on the fastlane payment booster flow, I am able to pay with all available payment methods (#259)

Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>

* INTER-3981: As a system, the module should use the new checkout URL by default (#265)

Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>

* PIGI iframe should be styled through an API within the Magento admin

---------

Co-authored-by: pavel-bystritskyi <166638645+pavel-bystritskyi@users.noreply.github.com>
Co-authored-by: Pavel Bystritsky <p.bystritskyi@gmail.com>
Co-authored-by: Victor Petryk <victor.petryk@boldcommerce.com>
Co-authored-by: CalinR <calin.reimer@gmail.com>
Co-authored-by: Pavel Bystritsky <pavel.bystritskyi@boldcommerce.com>
  • Loading branch information
6 people authored Jun 19, 2024
1 parent 76660ed commit 61ec122
Show file tree
Hide file tree
Showing 71 changed files with 807 additions and 1,884 deletions.
8 changes: 4 additions & 4 deletions Api/Data/DiscountDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ interface DiscountDataInterface
*
* @return float
*/
public function getAmount();
public function getAmount(): float;

/**
* Get Base Amount
*
* @return float
*/
public function getBaseAmount();
public function getBaseAmount(): float;

/**
* Get Original Amount
*
* @return float
*/
public function getOriginalAmount();
public function getOriginalAmount(): float;

/**
* Get Base Original Amount
*
* @return float
*/
public function getBaseOriginalAmount();
public function getBaseOriginalAmount(): float;
}
2 changes: 1 addition & 1 deletion Api/Data/Order/Payment/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface RequestInterface
/**
* Add payment object to the request.
*
* @param \Magento\Sales\Api\Data\OrderPaymentInterface$payment
* @param \Magento\Sales\Api\Data\OrderPaymentInterface $payment
* @return void
*/
public function setPayment(OrderPaymentInterface $payment): void;
Expand Down
6 changes: 3 additions & 3 deletions Api/Data/RuleDiscountInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ interface RuleDiscountInterface
*
* @return \Bold\Checkout\Api\Data\DiscountDataInterface
*/
public function getDiscountData();
public function getDiscountData(): DiscountDataInterface;

/**
* Get Rule Label
*
* @return string
*/
public function getRuleLabel();
public function getRuleLabel(): string;

/**
* Get Rule ID
*
* @return int
*/
public function getRuleID();
public function getRuleID(): int;
}
10 changes: 5 additions & 5 deletions Api/Http/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ClientInterface
*
* @param int $websiteId
* @param string $url
* @return Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @throws \Exception
*/
public function get(int $websiteId, string $url): ResultInterface;
Expand All @@ -26,7 +26,7 @@ public function get(int $websiteId, string $url): ResultInterface;
* @param int $websiteId
* @param string $url
* @param array|null $data
* @return Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @throws \Exception
*/
public function post(int $websiteId, string $url, array $data): ResultInterface;
Expand All @@ -37,7 +37,7 @@ public function post(int $websiteId, string $url, array $data): ResultInterface;
* @param int $websiteId
* @param string $url
* @param array|null $data
* @return Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @throws \Exception
*/
public function put(int $websiteId, string $url, array $data): ResultInterface;
Expand All @@ -48,7 +48,7 @@ public function put(int $websiteId, string $url, array $data): ResultInterface;
* @param int $websiteId
* @param string $url
* @param array|null $data
* @return Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @throws \Exception
*/
public function patch(int $websiteId, string $url, array $data): ResultInterface;
Expand All @@ -59,7 +59,7 @@ public function patch(int $websiteId, string $url, array $data): ResultInterface
* @param int $websiteId
* @param string $url
* @param array $data
* @return Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
* @throws \Exception
*/
public function delete(int $websiteId, string $url, array $data): ResultInterface;
Expand Down
2 changes: 1 addition & 1 deletion Api/Order/HydrateOrderFromQuoteInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface HydrateOrderFromQuoteInterface
*
* @param CartInterface $quote
* @param string $publicOrderId
* @return ResultInterface
* @return \Bold\Checkout\Api\Data\Http\Client\ResultInterface
*/
public function hydrate(CartInterface $quote, string $publicOrderId): ResultInterface;
}
4 changes: 2 additions & 2 deletions Api/PlaceOrderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ interface PlaceOrderInterface
public function place(string $shopId, OrderDataInterface $order): ResultInterface;

/**
* @param string $shopId
* @param string $publicOrderId
* @param string $quoteMaskId
* @return ResultInterface
* @return \Bold\Checkout\Api\Data\PlaceOrder\ResultInterface
*/
public function authorizeAndPlace(string $publicOrderId, string $quoteMaskId): ResultInterface;
}
29 changes: 2 additions & 27 deletions Block/System/Config/Form/Field/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,13 @@

namespace Bold\Checkout\Block\System\Config\Form\Field;

use Bold\Checkout\Model\ModuleInfo\InstalledModulesProvider;
use Magento\Framework\View\Element\Html\Select;
use Magento\Backend\Block\Template\Context;

/**
* HTML select element block with location options.
*/
class Location extends Select
{
/**
* @var InstalledModulesProvider
*/
protected $installedModulesProvider;

/**
* @param Context $context
* @param InstalledModulesProvider $installedModuleProvider
*/
public function __construct(
Context $context,
InstalledModulesProvider $installedModulesProvider
)
{
parent::__construct($context);
$this->installedModulesProvider = $installedModulesProvider;
}

/**
* Set "name" for <select> element
*
Expand Down Expand Up @@ -58,9 +38,9 @@ protected function _toHtml()
*
* @return array
*/
private function getSourceOptions(): array
public function getSourceOptions(): array
{
$options = [
return [
['label' => 'At the top of the page', 'value' => 'main_content_beginning'],
['label' => 'Above the customer info section', 'value' => 'customer_info'],
['label' => 'Below the shipping address section', 'value' => 'shipping'],
Expand All @@ -75,10 +55,5 @@ private function getSourceOptions(): array
['label' => 'On the thank you page, below the order details', 'value' => 'order_details'],
['label' => 'At the bottom of the page', 'value' => 'main_content_end'],
];
if ($this->installedModulesProvider->isPayPalFlowInstalled()) {
$options[] = ['label' => '(PayPal Checkout Flow only) On the additional information page', 'value' => 'paypal_additional_information'];
}

return $options;
}
}
1 change: 0 additions & 1 deletion Controller/Adminhtml/Clear/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Bold\Checkout\Model\ClearModuleConfiguration;
use Bold\Checkout\Model\ClearModuleIntegration;
use Bold\CheckoutFlowPaypal\Model\PaypalFlow;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\App\Action\HttpPostActionInterface;
Expand Down
26 changes: 2 additions & 24 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Config implements ConfigInterface
private const PATH_SECRET = 'checkout/bold_checkout_base/shared_secret';
private const PATH_ENABLED = 'checkout/bold_checkout_base/enabled';
private const PATH_TYPE = 'checkout/bold_checkout_base/type';
private const PATH_PAYMENT_TITLE = 'checkout/bold_checkout_base/payment_title';
public const PATH_PAYMENT_TITLE = 'checkout/bold_checkout_base/payment_title';
private const PATH_PARALLEL_CHECKOUT_BUTTON_TITLE = 'checkout/bold_checkout_base/parallel_checkout_button_title';
private const PATH_ENABLED_FOR = 'checkout/bold_checkout_advanced/enabled_for';
private const PATH_IP_WHITELIST = 'checkout/bold_checkout_advanced/ip_whitelist';
Expand All @@ -33,7 +33,7 @@ class Config implements ConfigInterface
private const PATH_INTEGRATION_API_URL = 'checkout/bold_checkout_advanced/api_url';
private const PATH_INTEGRATION_CHECKOUT_URL = 'checkout/bold_checkout_advanced/checkout_url';
private const PATH_INTEGRATION_IDENTITY_URL = 'checkout/bold_checkout_base/integration_identity_url';
private const PATH_LIFE_ELEMENTS = 'checkout/bold_checkout_life_elements/life_elements';
private const PATH_LIFE_ELEMENTS = 'checkout/bold_checkout_custom_elements/life_elements';
private const PATH_VALIDATE_COUPON_CODES = 'checkout/bold_checkout_advanced/validate_coupon_codes';
private const PATH_UPDATE_CHECK = 'checkout/bold_checkout_advanced/updates_check';

Expand Down Expand Up @@ -325,28 +325,6 @@ public function isCheckoutTypeParallel(int $websiteId): bool
) === ConfigInterface::VALUE_TYPE_PARALLEL;
}

/**
* @inheritDoc
*/
public function isCheckoutTypeSelfHosted(int $websiteId): bool
{
return (int)$this->configManagement->getValue(
self::PATH_TYPE,
$websiteId
) === ConfigInterface::VALUE_TYPE_SELF;
}

/**
* @inheritDoc
*/
public function isCheckoutTypeSelfHostedReact(int $websiteId): bool
{
return (int)$this->configManagement->getValue(
self::PATH_TYPE,
$websiteId
) === ConfigInterface::VALUE_TYPE_SELF_REACT;
}

/**
* @inheritDoc
*/
Expand Down
2 changes: 0 additions & 2 deletions Model/Config/Source/CheckoutTypeSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public function toOptionArray(): array
return [
['value' => ConfigInterface::VALUE_TYPE_STANDARD, 'label' => __('Bold-Hosted (Standard)')],
['value' => ConfigInterface::VALUE_TYPE_PARALLEL, 'label' => __('Dual')],
['value' => ConfigInterface::VALUE_TYPE_SELF, 'label' => __('Payment Booster')],
['value' => ConfigInterface::VALUE_TYPE_SELF_REACT, 'label' => __('Self-Hosted')],
];
}
}
18 changes: 0 additions & 18 deletions Model/ConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ interface ConfigInterface
public const VALUE_ENABLED_FOR_PERCENTAGE = 3;
public const VALUE_TYPE_STANDARD = 0;
public const VALUE_TYPE_PARALLEL = 1;
public const VALUE_TYPE_SELF = 2;
public const VALUE_TYPE_SELF_REACT = 3;
public const PATH_SHOP_ID = 'checkout/bold_checkout_base/shop_id';

/**
Expand Down Expand Up @@ -170,22 +168,6 @@ public function isCheckoutTypeStandard(int $websiteId): bool;
*/
public function isCheckoutTypeParallel(int $websiteId): bool;

/**
* Check if Bold Checkout type is self-hosted (Magento storefront).
*
* @param int $websiteId
* @return bool
*/
public function isCheckoutTypeSelfHosted(int $websiteId): bool;

/**
* Check if Bold Checkout type is self-hosted (React application).
*
* @param int $websiteId
* @return bool
*/
public function isCheckoutTypeSelfHostedReact(int $websiteId): bool;

/**
* Get Bold Payment storefront title.
*
Expand Down
2 changes: 1 addition & 1 deletion Model/Customer/EmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function validate(string $shopId, string $email): ResultInterface
* Build error result data model.
*
* @param Phrase $message
* @return Bold\Checkout\Api\Data\CustomerEmailValidator\ResultInterface
* @return ResultInterface
*/
public function getErrorResult(Phrase $message): ResultInterface
{
Expand Down
12 changes: 6 additions & 6 deletions Model/Data/DiscountData.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ class DiscountData extends AbstractExtensibleModel implements DiscountDataInterf
/**
* @inheritDoc
*/
public function getAmount()
public function getAmount(): float
{
return $this->getData(self::AMOUNT);
}

/**
* @inheritDoc
*/
public function getBaseAmount()
public function getBaseAmount(): float
{
return $this->getData(self::BASE_AMOUNT);
}

/**
* @inheritDoc
*/
public function getOriginalAmount()
public function getOriginalAmount(): float
{
return $this->getData(self::ORIGINAL_AMOUNT);
}

/**
* @inheritDoc
*/
public function getBaseOriginalAmount()
public function getBaseOriginalAmount(): float
{
return $this->getData(self::BASE_ORIGINAL_AMOUNT);
}
Expand All @@ -55,7 +55,7 @@ public function getBaseOriginalAmount()
*
* @return ExtensionAttributesInterface|null
*/
public function getExtensionAttributes()
public function getExtensionAttributes(): ?ExtensionAttributesInterface
{
return $this->_getExtensionAttributes();
}
Expand All @@ -68,7 +68,7 @@ public function getExtensionAttributes()
*/
public function setExtensionAttributes(
ExtensionAttributesInterface $extensionAttributes
) {
): DiscountData {
return $this->_setExtensionAttributes($extensionAttributes);
}
}
Loading

0 comments on commit 61ec122

Please sign in to comment.