• Resolved leobarbaro

    (@leobarbaro)


    Hello.
    I developed a custom plugin that implement a new payment method.
    Inside the “process_payment()” function I do basically 2 steps:

    – Insert a payment “to_do” into the Payment server (via a SOAP call)
    [I receive a “payment_key” as answer]

    – Redirect the customer to the external url, so it can do the payment.

    My external payment gateway accept these parameters in Post:

    • payment_key
      (obviously, so the customer is redirect to HIS order to pay)
    • ret_url
      This is the URL where the customer will be redirected after the payment.
      I set it with “$this->get_return_url( $order )”.
      In the URL parameters, after redirect back to the e-commerce there is a “result” parameter, that inform the e-commerce about the payment success (OK – ERROR)

    Problem:
    To “send” the customer “outside” to process the payment, I used “return” with array:

    	
       return array(
          'result' => 'success',
          'redirect' => $PPAurl
       );

    But being the “result” parameter already set to “success”, any response I get from the gateway (as URL parameters), when the browser come back to my e-commerce, I always land on the “Order received” page. The cart is empty, and all seems good.

    How can I process the answer (in the url parameters) from the gataway, when I return to my e-commerce after the “external” payment?

    How can I “go outside” the ecommerce for the payment, without set to “success” my payment return?

    Thanks Everyone.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Since there’s not been any further responses on this, I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Process the answer from external Payment Gateway’ is closed to new replies.