Woocommerce回调重定向两个url成功和错误
我正在开发woocommerce支付基础设施,但我遇到了一个问题,我的支付方法是发送表单。 这些: 成功的: 不正确: https:/examplefirma.com.tr/Error?hasError=True&resultMessage=%C3%96deme 20%C5%9Use-Flemi%20%C4%B1c%C4%B1%20-side%C4%B1%20-canceled%20%C5%9F.&sourceAccountNumberToDisplay=&transferServerRefNo=&IsFinancial=False&responseSign=&requestId=e3af8ebc-a2e7-4ec7-c35b-03a022a10d7c&resultCode=59203 如何处理这些URL并更新订单Woocommerce回调重定向两个url成功和错误,woocommerce,default,gateway,Woocommerce,Default,Gateway,我正在开发woocommerce支付基础设施,但我遇到了一个问题,我的支付方法是发送表单。 这些: 成功的: 不正确: https:/examplefirma.com.tr/Error?hasError=True&resultMessage=%C3%96deme 20%C5%9Use-Flemi%20%C4%B1c%C4%B1%20-side%C4%B1%20-canceled%20%C5%9F.&sourceAccountNumberToDisplay=&transferServerRefNo
enter code here
public function generate_multinet_form( $order_id ) {
$order = new WC_Order( $order_id );
$npay_adr ='https://test-multiwebpos.multinet.com.tr/ThreeDPayment/ThreeDPayment';
$npay_args = $this->get_multinet_args($order);
$npay_args_array = array();
foreach ( $npay_args as $key => $value ) {
$npay_args_array[] = '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
}
wc_enqueue_js( '
$.blockUI({
message: "' . esc_js( __( 'Thank you for your order. We are now redirecting you to nPay to make payment.', 'wc-gateway-npay' ) ) . '",
baseZ: 99999,
overlayCSS: {
background: "#fff",
opacity: 0.6
},
css: {
padding: "20px",
zindex: "9999999",
textAlign: "center",
color: "#555",
border: "3px solid #aaa",
backgroundColor:"#fff",
cursor: "wait",
lineHeight: "24px",
}
});
jQuery("#submit-payment-form").click();
' );
return '<form action="' . esc_url( $npay_adr ) . '" method="post" id="payment-form" target="_top">
' . implode( '', $npay_args_array ) . '
<input type="submit" class="button alt" id="submit-payment-form"/>
<script type="text/javascript">
jQuery(function(){
jQuery("body").block(
{
message: "' . __( 'Thank you for your order. We are now redirecting you to PayFast to make payment.', 'woocommerce-gateway-payfast' ) . '",
overlayCSS:
{
background: "#fff",
opacity: 0.6
},
css: {
padding: 20,
textAlign: "center",
color: "#555",
border: "3px solid #aaa",
backgroundColor:"#fff",
cursor: "wait"
}
});
jQuery( "#submit-payment-form" ).click();
});
</script>
</form>';
}
在此处输入代码
公共函数生成多网表单($order\u id){
$order=新WC\U订单($order\U id);
$npay\uhttps://test-multiwebpos.multinet.com.tr/ThreeDPayment/ThreeDPayment';
$npay\u args=$this->get\u multinet\u args($order);
$npay_args_array=array();
foreach($npay_参数为$key=>$value){
$npay_args_数组[]='';
}
wc_enqueue_js('
$.blockUI({
消息:“.esc_js(uuuu(‘谢谢您的订单。我们现在将您重定向到nPay进行付款’,‘wc网关nPay’)”,
baseZ:99999,
覆盖层:{
背景:“fff”,
不透明度:0.6
},
css:{
填充:“20px”,
zindex:“9999999”,
textAlign:“居中”,
颜色:#555“,
边框:“3px实心#aaa”,
背景颜色:“fff”,
光标:“等待”,
线宽:“24px”,
}
});
jQuery(“提交付款单”)。单击();
' );
返回'
“.内爆(“”,$npay\u args\u数组)。”
jQuery(函数(){
jQuery(“body”).block(
{
消息:“.”(“感谢您的订单。我们现在将您重定向到PayFast进行支付。”,“woocommerce gateway PayFast”)。“,
覆盖层:
{
背景:“fff”,
不透明度:0.6
},
css:{
填充:20,
textAlign:“居中”,
颜色:#555“,
边框:“3px实心#aaa”,
背景颜色:“fff”,
光标:“等待”
}
});
jQuery(“提交付款单”)。单击();
});
';
}