我试图在Woocommerce中集成自定义支付网关。订单已完成,支付网关正在运行。但来自支付网关的人员提出了数量篡改的高风险漏洞。付款完成后,他们基本上都在更改密钥。他们建议交叉检查密钥并防止woocommerce在密钥更改后生成收据。
我们有什么方法可以查看该密钥。 这是我正在使用的代码:
$order = new WC_Order($oid);
if ( $ostatus == 'Success'){
$transauthorised = true;
$this->msg['message'] = $this->success_message;
$this->msg['class'] = 'success';
$order->payment_complete($oid);
$order->add_order_note('HDFC payment successful<br/>Ref Number/Transaction ID: '.$bankref.'/'.$tid);
$order->add_order_note($this->msg['message']);
$woocommerce->cart->empty_cart();
}
else{
$this->msg['class'] = 'error';
$this->msg['message'] = 'An error occured . '.$failmsg;
$order->add_order_note($this->msg['message']);
$order->update_status('failed');
//extra code can be added here such as sending an email to customer on transaction fail
}
$redirect_url = $order->get_checkout_order_received_url();
$this->web_redirect( $redirect_url); exit;