• Resolved themugician

    (@themugician)


    I’m adding a feature in a custom gateway to support WooCommerce subscriptions.
    When I click Pay I get a 302 redirect to /checkout
    For example the url /checkout/order-pay/{order_id}/?pay_for_order=true&key=wc_order_99999999&ig_scotiabank_form=pay redirects to /checkout
    This does not happen with products only subscriptions
    For context the ig_scotiabank_form=pay parameter is needed to display the payment gateway iframe
    Am I missing something in my process_payment function to support subscriptions?

    public function process_payment( $order_id ) {

    $order = new \WC_Order( $order_id );

    $order->update_status( 'pending' );

    $redirect_url = add_query_arg(
    array(
    'ig_scotiabank_form' => 'pay',
    ),
    $order->get_checkout_payment_url()
    );

    $this->log->add( $this->id, $redirect_url );

    // Return pay for order page redirect flagging our gateway is in use
    return array(
    'result' => 'success',
    'order_id' => $order_id,
    'redirect' => $redirect_url,
    );
    }

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.