Exemplo n.º 1
0
 /**
  * @param Wc_Order $order
  * @param Mollie_API_Object_Payment $payment
  */
 protected function onWebhookPaid(Wc_Order $order, Mollie_API_Object_Payment $payment)
 {
     Mollie_WC_Plugin::debug(__METHOD__ . ' called.');
     // Woocommerce 2.2.0 has the option to store the Payment transaction id.
     $woo_version = get_option('woocommerce_version', 'Unknown');
     if (version_compare($woo_version, '2.2.0', '>=')) {
         $order->payment_complete($payment->id);
     } else {
         $order->payment_complete();
     }
     $order->add_order_note(sprintf(__('Order completed using %s payment (%s).', 'mollie-payments-for-woocommerce'), $this->method_title, $payment->id . ($payment->mode == 'test' ? ' - ' . __('test mode', 'mollie-payments-for-woocommerce') : '')));
 }