30 private $customerSession;
35 private $storeManager;
40 private $instantPurchase;
45 private $paymentTokenFormatter;
50 private $customerAddressesFormatter;
55 private $shippingMethodFormatter;
69 InstantPurchaseModel $instantPurchase,
74 $this->customerSession = $customerSession;
76 $this->instantPurchase = $instantPurchase;
77 $this->paymentTokenFormatter = $paymentTokenFormatter;
78 $this->customerAddressesFormatter = $customerAddressesFormatter;
79 $this->shippingMethodFormatter = $shippingMethodFormatter;
87 if (!$this->customerSession->isLoggedIn()) {
88 return [
'available' =>
false];
91 $store = $this->storeManager->getStore();
92 $customer = $this->customerSession->getCustomer();
93 $instantPurchaseOption = $this->instantPurchase->getOption(
$store,
$customer);
95 'available' => $instantPurchaseOption->isAvailable()
97 if (!$instantPurchaseOption->isAvailable()) {
108 'summary' => $this->paymentTokenFormatter->format(
$paymentToken),
110 'shippingAddress' => [
114 'billingAddress' => [
116 'summary' => $this->customerAddressesFormatter->format(
$billingAddress),
118 'shippingMethod' => [
__construct(Session $customerSession, StoreManagerInterface $storeManager, InstantPurchaseModel $instantPurchase, PaymentTokenFormatter $paymentTokenFormatter, CustomerAddressesFormatter $customerAddressesFormatter, ShippingMethodFormatter $shippingMethodFormatter)