【发布时间】:2019-03-01 12:27:44
【问题描述】:
我正在尝试将响应数据返回到我的支付网关,但没有成功。 这是我的 woocommerce 扩展中的代码 sn-p,它将数据发送到我的支付处理器(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,
) );
我得到的数据非常好到 url(index.php)。问题是将响应返回到我的自定义 woocommerce 扩展,以便我可以完成 payment_process()
我在网上找到的大多数资源只讨论发送数据,而不是如何将响应或结果发送回查询资源文件。
我们将不胜感激任何帮助。谢谢。
【问题讨论】:
标签: wordpress woocommerce payment-gateway