Exemplo n.º 1
0
 /**
  * @param WC_Order $order
  * @return string
  */
 public function getReturnRedirectUrlForOrder(WC_Order $order)
 {
     $data_helper = Mollie_WC_Plugin::getDataHelper();
     if ($data_helper->hasCancelledMolliePayment($order->id)) {
         Mollie_WC_Plugin::addNotice(__('You have cancelled your payment. Please complete your order with a different payment method.', 'mollie-payments-for-woocommerce'));
         if (method_exists($order, 'get_checkout_payment_url')) {
             /*
              * Return to order payment page
              */
             return $order->get_checkout_payment_url(false);
         }
         /*
          * Return to cart
          */
         return WC()->cart->get_checkout_url();
     }
     /*
      * Return to order received page
      */
     return $this->get_return_url($order);
 }