向另一台服务器

时间:2018-05-24 06:48:45

标签: wordpress woocommerce

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

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);

0 个答案:

没有答案
相关问题