2019-04-26 12:05
浏览 52

WooCommerce Extension - 重定向到'Pay'端点时适用的挂钩

I'm integrating a WooCommerce payment gateway plugin and have a requirement to embed the gateway in an iframe. I'm redirecting with the below code to the Pay (the /order-pay route by default) endpoint where I'd like to include the iframe where the payment process will continue.

Does anyone know of an applicable hook in which I load the necessary JS scripts to initialise the iframe on the order-pay template?

function process_payment( $order_id ) {
  global $woocommerce;
  $order = new WC_Order( $order_id );
  $order->update_status( 'pending-payment', __( 'Awaiting payment', 'some-domain' ) );

  return array(
    'result'   => 'success',
    'redirect' => $order->get_checkout_payment_url( $on_checkout = true )
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题