【发布时间】:2015-09-24 06:52:29
【问题描述】:
我正在为我的支付网关创建一个用于 woocommerce 的支付网关插件。 在我通过我的支付网关点击结帐页面后。我收到语法错误。我想我没有错,下面是我的 process_payment 功能代码
/**
* Process the payment and return the result
**/
function process_payment($order_id){
global $woocommerce;
$order = new WC_Order($order_id);
$order_id = $order_id;
$the_order_total = $order->order_total;
$mercahntId=$this->merchant_id;
$merchantPassword=$this ->merchant_password;
$retrunUrl=$this->notify_url;
$paymentGatewayUrl=$this ->liveurl;
echo '<form name="Generator" method="post" action="' . $paymentGatewayUrl . '">';
echo '<input type="hidden" name="UID" value="' . $mercahntId . '">';
echo '<input type="hidden" name="PWD" value="' . $merchantPassword . '">';
echo '<input type="hidden" name="ProductDesc" value="' . $order_id . '">';
echo '<input type="hidden" name="returnURL" value="' . $retrunUrl . '">';
echo '<input type="hidden" name="Amount" value="' . $the_order_total . '">';
echo'</form>';
die();
//return array('result' => 'success', 'redirect' => $order->get_checkout_payment_url( true ));
}
它给我一个错误 SyntaxError: Unexpected token
我认为我在 woocommerce 中使用正确的语法来打印表单。有什么想法吗?
还有一个问题,我如何才能找出错误在哪个页面和行号上。在 woocommerce 中。
【问题讨论】:
标签: php wordpress woocommerce