/** * Called after a successful checkout, sends mail, etc. */ protected function handleCompleteCheckout() { // shop owner notification address $notificationAddress = $this->settings->getEmailNotificationAdr(); if ($notificationAddress == '') { throw new \RuntimeException($this->translator->translate('doCheckout.fail')); } $buyerEmail = $this->checkout->getBuyerEmail(); $confirmation = $this->createCheckoutConfirmation(); // send notification email to shop owner $this->sendNotificationMail($confirmation, $buyerEmail, $notificationAddress); // send confirmation email to buyer $this->sendConfirmationMail($confirmation, $buyerEmail, $notificationAddress); }
/** * @return AbstractGateway */ protected function createPayment() { $gateway = $this->checkout->getPaymentMethod(); return Payment::create($gateway, $this->settings, $this->checkout, $this->cart, $this->translator); }
public function process() { $this->checkout->loadFromGlobals(); $this->checkout->save(); return new ShopModeResponse(); }
/** * @param HtmlTagBuilder $wrapper * @param ShopSettings $settings * @param CheckoutFrom $checkout * @param CartWithShipping $cart * @param Translator $i18n */ protected function showCheckout($wrapper, $settings, $checkout, $cart, $i18n) { // load from store $checkout->loadFromStore(); $checkoutWrapper = $this->createCheckoutWrapper()->appendHtml($checkout->toHtml()); // render cart $wrapper->append($this->renderCart($settings, $cart, $i18n, false)); $wrapper->append($checkoutWrapper); }