示例#1
0
 /**
  * Run command
  *
  * @param OrderPaymentInterface $payment
  * @param string|float|int $amount
  * @param OrderInterface $order
  * @return string
  */
 public function execute(OrderPaymentInterface $payment, $amount, OrderInterface $order)
 {
     $state = Order::STATE_PROCESSING;
     $status = false;
     $formattedAmount = $order->getBaseCurrency()->formatTxt($amount);
     if ($payment->getIsTransactionPending()) {
         $message = __('The order amount of %1 is pending approval on the payment gateway.', $formattedAmount);
         $state = Order::STATE_PAYMENT_REVIEW;
         if ($payment->getIsFraudDetected()) {
             $status = Order::STATUS_FRAUD;
         }
     } else {
         $message = __('Ordered amount of %1', $formattedAmount);
     }
     $this->setOrderStateAndStatus($order, $status, $state);
     return $message;
 }
 /**
  * Run command
  *
  * @param OrderPaymentInterface $payment
  * @param string|float|int $amount
  * @param OrderInterface $order
  * @return string
  */
 public function execute(OrderPaymentInterface $payment, $amount, OrderInterface $order)
 {
     $state = SalesOrder::STATE_PROCESSING;
     $status = false;
     $formattedAmount = $order->getBaseCurrency()->formatTxt($amount);
     if ($payment->getIsTransactionPending()) {
         $message = __('An amount of %1 will be captured after being approved at the payment gateway.', $formattedAmount);
         $state = SalesOrder::STATE_PAYMENT_REVIEW;
         if ($payment->getIsFraudDetected()) {
             $status = SalesOrder::STATUS_FRAUD;
         }
     } else {
         // normal online capture: invoice is marked as "paid"
         $message = __('Captured amount of %1 online', $formattedAmount);
     }
     $this->setOrderStateAndStatus($order, $status, $state);
     return $message;
 }
 /**
  * Run command
  *
  * @param OrderPaymentInterface $payment
  * @param string|float|int $amount
  * @param OrderInterface $order
  * @return string
  */
 public function execute(OrderPaymentInterface $payment, $amount, OrderInterface $order)
 {
     /**
      * @var $payment Payment
      */
     $state = Order::STATE_PROCESSING;
     $status = false;
     $formattedAmount = $order->getBaseCurrency()->formatTxt($amount);
     if ($payment->getIsTransactionPending()) {
         $message = __('An amount of %1 will be captured after being approved at the payment gateway.', $formattedAmount);
         $state = Order::STATE_PAYMENT_REVIEW;
     } else {
         $message = __('Registered notification about captured amount of %1.', $formattedAmount);
     }
     if ($payment->getIsFraudDetected()) {
         $state = Order::STATE_PAYMENT_REVIEW;
         $message = __('Order is suspended as its capture amount %1 is suspected to be fraudulent.', $formattedAmount);
         $status = Order::STATUS_FRAUD;
     }
     $this->setOrderStateAndStatus($order, $status, $state);
     return $message;
 }
 /**
  * @param OrderPaymentInterface $payment
  * @param string|float $amount
  * @param OrderInterface $order
  * @return \Magento\Framework\Phrase
  */
 public function execute(OrderPaymentInterface $payment, $amount, OrderInterface $order)
 {
     $state = Order::STATE_PROCESSING;
     $status = false;
     $formattedAmount = $order->getBaseCurrency()->formatTxt($amount);
     if ($payment->getIsTransactionPending()) {
         $state = Order::STATE_PAYMENT_REVIEW;
         $message = __('We will authorize %1 after the payment is approved at the payment gateway.', $formattedAmount);
     } else {
         if ($payment->getIsFraudDetected()) {
             $state = Order::STATE_PROCESSING;
             $message = __('Order is suspended as its authorizing amount %1 is suspected to be fraudulent.', $formattedAmount);
         } else {
             $message = __('Authorized amount of %1', $formattedAmount);
         }
     }
     if ($payment->getIsFraudDetected()) {
         $status = Order::STATUS_FRAUD;
     }
     $this->setOrderStateAndStatus($order, $status, $state);
     return $message;
 }