Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I’ll get these regenerated shortly.

    For your gateway, check its not calling get_permalink inside – these urls need replacing with the new endpoints.

    Thread Starter piggy811

    (@piggy811)

    Hi Mike,
    Thanks I checked and it sure has get_permalink.
    What should I replace it?
    i just try replaced it with get_checkout_payment_url( true ) but it does’t work.
    Did I type wrong?
    Thanks!

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    If its a permalink to the pay page:

    $order->get_checkout_payment_url( true )
    Thread Starter piggy811

    (@piggy811)

    I have one for thanks page:

    /**
    * Process the payment and return the result
    *
    * @access public
    * @param int $order_id
    * @return array
    */
    function process_payment($order_id) {
    global $woocommerce;
    $order = new WC_Order($order_id);

    // Empty awaiting payment session
    unset($_SESSION[‘order_awaiting_payment’]);
    return array(
    ‘result’ => ‘success’,
    ‘redirect’ => add_query_arg(‘order’, $order->id, add_query_arg(‘key’, $order->order_key, get_permalink(woocommerce_get_page_id(‘thanks’))))
    );
    }

    what will the code be like?

    That’s wrong, it should use the method Mike mentioned. The thanks page is no longer a page, but is now an endpoint (and so is the pay page).

    Thread Starter piggy811

    (@piggy811)

    Hi Coen & Mike,

    Thanks for the kind reply again.
    The problem was solved by replacing
    'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('thanks'))))

    to

    'redirect' => $this->get_return_url( $order )

    Thanks for the efforts to all develop team. Though the 2.1 version do have some adjustment, I think it’s on the way to the best. And we are very impressive by the support while it’s a free system ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom payment gateway can't use after updated to 2.1.2’ is closed to new replies.