在Woocommerce中创建离线退款

时间:2018-07-03 07:44:01

标签: python-3.x woocommerce

我想在woocommerce中为订单创建退款而不使用支付网关。为此,我需要设置属性api_refund,其默认值为True到False。如何在不更改要发布到API的网址的情况下发送参数?

1 个答案:

答案 0 :(得分:0)

我在React.js中使用的是:


//Action for Full refund Order
const fullRefund = (order_id,net_total) => (dispatch) => {
  const data = {
    amount: "20",
    api_refund:false,
    
  };
  
  apiWoo.post( "orders" + "/" + order_id + "/" + "refunds", data)
    .then((response) => {
      console.log("Response Status:", response.status);
      console.log("Response Headers:", response.headers);
      console.log("Response Data:", response.data);
      console.log("Total of pages:", response.headers['x-wp-totalpages']);
      console.log("Total of items:", response.headers['x-wp-total']);
      alert('Full Refund created for the customer');
    })
    .catch((error) => {
      console.log(error.response.data);
    });

相关问题