woocommerce Dragonpay付款网关

时间:2018-06-29 08:51:23

标签: wordpress woocommerce payment-gateway hook-woocommerce woocommerce-rest-api

dragonpay如何以及在何处访问我的网站/插件,以便Dragonpay可以更新woocommerce中的订单状态?这是插件中的回调方法

class payment_gateway extends WC_Payment_Gateway {
  function callback(){
     global $woocommerce;
     $order_id = $_GET['txnid'];
     $status = $_GET['status'];
     $order = new WC_Order( $order_id );
     if ($status == 'S') {
         $order->add_order_note('Dragonpay Payment Status: SUCCESSFUL');                             
         $order->payment_complete();
         wp_redirect($order->get_checkout_order_received_url());
         exit;
        }
   }

}

0 个答案:

没有答案