WooCommerce REST API:网关不支持管理员更改订阅的付款方式

时间:2021-04-28 13:42:30

标签: wordpress woocommerce woocommerce-rest-api woocommerce-subscriptions

我正在使用 WooCommerce Subscription REST API 来延长用户的订阅期。我遇到的问题是,当我想更新过期时间时,我收到此错误:

  Gateway does not support admin changing the payment method on a Subscription

有人知道问题出在哪里吗?

我正在使用以下代码更新订阅到期时间:

   return $this->guzzleClient->request('PUT', 'wp-json/wc/v1/subscriptions/'.$id, [
        'json' => [
            'end_date' => $endDate->toDateTimeString(),
            'status' => 'active',
        ]
    ]);

0 个答案:

没有答案