Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 向其他服务器发送请求时超出订单对象_Wordpress_Woocommerce - Fatal编程技术网

Wordpress 向其他服务器发送请求时超出订单对象

Wordpress 向其他服务器发送请求时超出订单对象,wordpress,woocommerce,Wordpress,Woocommerce,我在建立退款请求时遇到了一个问题。。。 当我运行代码时,woocommerce订单对象无法识别,我不能超过订单id和付款金额。我试图包含一个woocommerce文件来定义order对象,但由于某些原因,之后的代码不会显示在页面中,甚至不会显示在控制台中 ini_set('display_errors', 'On'); error_reporting(E_ALL); include "./wp-content/plugins/woocommerce/woocommerce.php"; gl

我在建立退款请求时遇到了一个问题。。。 当我运行代码时,woocommerce订单对象无法识别,我不能超过订单id和付款金额。我试图包含一个woocommerce文件来定义order对象,但由于某些原因,之后的代码不会显示在页面中,甚至不会显示在控制台中

ini_set('display_errors', 'On');
error_reporting(E_ALL);

include "./wp-content/plugins/woocommerce/woocommerce.php";


global $woocommerce;

$w = 'https://api.demo.ezidebit.com.au/v3-5/nonpci?wsdl';
$client = new \SoapClient($w);

$orderId = $_GET['order'];

$order = wc_get_order($orderId);

$BankReceiptID = $order->_BankReceiptID;

$propertys = [
  'DigitalKey'            => 'D7C700C4-92DD-0CA2-E043-0A1017ACD099',
  // 'PaymentID'             =>  $_GET['TransactionID'], // PaymentID  or BankReceiptID
  'BankReceiptID'         =>  $BankReceiptID, //PaymentID or BankReceiptID
  'RefundAmountInCents'   => (($order->get_total()*100)-1500), //total back
];

$RefundResult = $client->ProcessRefund($propertys);

echo '$RefundResult: ' . $RefundResult;
return; // remove after checking how to get the RefundResult letter

//print_r($client->ProcessRefund($propertys));

header('Location:http://localhost/360transformation/?page_id=567&order=' . $orderId . '&RefundResult=' . $RefundResult->ProccessRefundResult->Data->RefundResult);

您如何调用或运行此代码?AJAX还是什么?调用这个代码。它位于打开此页面时调用的php文件中。没有ajax