【问题标题】:Woocommerce subscriptions hook scheduled_subscription_payment_ passes parent order instead of a renewall oneWoocommerce 订阅挂钩 schedule_subscription_payment_ 传递父订单而不是续订订单
【发布时间】:2017-04-05 12:39:31
【问题描述】:

我正在尝试将 Paymaster Recurring 付款存入现有的支付网关。

标准的钩子调用看起来像这样

add_action('scheduled_subscription_payment_'. $this->id , array($this, 'scheduled_subscription_payment'), 10, 2);

很好很清楚。 下面是函数处理调用:

function scheduled_subscription_payment( $amount_to_charge, $order ) {
    $this->process_subscription_payment($order, $amount_to_charge);
}

没什么特别的,但有一个问题:根据官方文档$order 参数应该由 Woocommerce 订阅引擎订单自动创建 - 但我收到一个已经处理的父订单。

我通过Sheduled actions 中的Run 按钮启动付款流程:续订订单已创建但从未传递给之前显示的函数。有什么问题?

【问题讨论】:

    标签: woocommerce-subscriptions


    【解决方案1】:

    找到答案here。一个人遇到了同样的问题,所以问题是钩子scheduled_subscription_payment_已被弃用,我们应该改用woocommerce_scheduled_subscription_payment_

    【讨论】:

      猜你喜欢
      • 2017-09-17
      • 2020-08-17
      • 2017-03-21
      • 1970-01-01
      • 2017-09-24
      • 2021-04-21
      • 2018-05-12
      • 2019-04-09
      • 2018-09-19
      相关资源
      最近更新 更多