首页 > 解决方案 > 使用 Woocommerce rest api 退款 api 导致服务器错误 (500)

问题描述

这是 Woocommerce 提供的文档。 https://woocommerce.github.io/woocommerce-rest-api-docs/?javascript#create-a-refund

每当我点击退款时,它都会给我 500 的代码错误。

编码 :

export const addRefundAmountInOrder = (orderId) => async (dispatch) => {
  let data = {
    amount: "10.00",
  };
  try {
    const res = await api.post(`orders/${orderId}/refunds`, data);
    console.log(res.data, "refund response.....");
  } catch (error) {
   console.log(error)
  }
};

标签: wordpresswoocommercewordpress-rest-apiwoocommerce-rest-apirefund

解决方案


推荐阅读