0
votes

I am trying to get response data back to my payment gateway with no success. This is the code snippet within my woocommerce extension that sends data to my payment processor(index.php)

$environment_url = "https://example.com/api/index.php";
$payload = array(
        // Credentials and API Info
        "x_tran_key"            => $this->trans_key,
        "x_login"               => $this->api_login,
        "x_version"             => "3.1",

        // Order total
        "x_amount"              => $customer_order->order_total
);
$response = wp_remote_post( $environment_url, array(
        'method'    => 'POST',
        'body'      => http_build_query( $payload ),
        'timeout'   => 90,
        'sslverify' => false,
    ) );

I get the data very fine to the url(index.php). The issue is getting the response back to my custom woocommerce extension so that I can complete payment_process()

Most resources I have found online only talk about sending data, but not how the response or result is sent back to the querying resource file.

Any help will be highly appreciated. Thank you.

1

1 Answers

0
votes

Just did a simple print_r and it did the trick, I got my results in an array and used print_r If anybody encounters the same problem as I did, I hope this has saved your time.