Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 /**
  * @return AbstractGateway
  */
 protected function createPayment()
 {
     $gateway = $this->checkout->getPaymentMethod();
     return Payment::create($gateway, $this->settings, $this->checkout, $this->cart, $this->translator);
 }
Exemplo n.º 3
0
 public function process()
 {
     $this->checkout->loadFromGlobals();
     $this->checkout->save();
     return new ShopModeResponse();
 }
Exemplo n.º 4
0
 /**
  * @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);
 }