我正在使用亚美尼亚银行API与woocommerce作为额外的支付方式。当我下订单时,它会给我运行时错误。我正在附加图像或我收到的错误和我正在使用的代码。
id = 'ameriabank'; // payment gateway plugin ID $this->icon = ''; // URL of the icon that will be displayed on checkout page near your gateway name $this->has_fields = true; // in case you need a custom credit card form $this->method_title = 'Ameria Bank Gateway'; $this->method_description = 'Description of Ameria payment gateway'; $this->supports = array( 'products', 'subscriptions' ); // Method with all the options fields $this->init_form_fields(); // Load the settings. $this->init_settings(); $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->enabled = $this->get_option( 'enabled' ); //$this->testmode = 'yes' === $this->get_option( 'testmode' ); $this->ClientID = $this->get_option( 'ClientID' ); $this->Username = $this->get_option( 'Username' ); $this->Password = $this->get_option( 'Password' ); // This action hook saves the settings add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); // We need custom JavaScript to obtain a token //add_action( 'wp_enqueue_scripts', array( $this, 'payment_scripts' ) ); // You can also register a webhook here // add_action( 'woocommerce_api_{webhook name}', array( $this, 'webhook' ) ); } /** * Plugin options, we deal with it in Step 3 too */ public function init_form_fields(){ $this->form_fields = array( 'enabled' => array( 'title' => 'Enable/Disable', 'label' => 'Enable AmeriaBank Gateway', 'type' => 'checkbox', 'description' => '', 'default' => 'no' ), 'title' => array( 'title' => 'Title', 'type' => 'text', 'description' => 'This controls the title which the user sees during checkout.', 'default' => 'Credit Card', 'desc_tip' => true, ), 'description' => array( 'title' => 'Description', 'type' => 'textarea', 'description' => 'This controls the description which the user sees during checkout.', 'default' => 'Pay with your credit card via our super-cool payment gateway.', ), 'ClientID' => array( 'title' => 'Client ID', 'type' => 'text' ), 'Username' => array( 'title' => 'Username', 'type' => 'text' ), 'Password' => array( 'title' => 'Password', 'type' => 'text' ) ); } public function process_payment( $order_id ) { global $woocommerce; $order = new WC_Order( $order_id ); // Ameria bank params $this->description = "[description]"; $this->orderID = $order_id; $this->paymentAmount = $order->get_total(); $_SESSION['eli_cart_total'] = $this->paymentAmount; $this->backURL = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(woocommerce_get_page_id('thanks')))); $options = array( 'soap_version' => SOAP_1_1, 'exceptions' => true, 'trace' => 1, 'wdsl_local_copy' => true ); $client = new SoapClient("https://testpayments.ameriabank.am/webservice/PaymentService.svc?wsdl", $options); $args['paymentfields'] = array( 'ClientID' => $this->ClientID, 'Username' => $this->Username, 'Password' => $this->Password, 'Description' => $this->description, 'OrderID' => $this->orderID, 'PaymentAmount' => $this->paymentAmount, 'backURL' => $this->backURL ); $webService = $client->GetPaymentID($args); $_SESSION['pid'] = $webService->GetPaymentIDResult->PaymentID; $this->liveurl = 'https://testpayments.ameriabank.am/forms/frm_paymentstype.aspx?clientid='.$this->ClientID.'&clienturl='.$this->backURL.'&lang=am&paymentid='.$webService->GetPaymentIDResult->PaymentID; // Return thankyou redirect return array( 'result' => 'success', 'redirect' => $this->liveurl ); } /** * Output for the order received page. * * @access public * @return void */ function thankyou_page($order_id) { global $woocommerce; $options = array( 'soap_version' => SOAP_1_1, 'exceptions' => true, 'trace' => 1, 'wdsl_local_copy' => true ); $client = new SoapClient("https://testpayments.ameriabank.am/webservice/PaymentService.svc?wsdl", $options); $total = $_SESSION['eli_cart_total']; $args['paymentfields'] = array( 'ClientID' => $this->ClientID, 'Username' => $this->Username, 'Password' => $this->Password, 'PaymentAmount' => $total, 'OrderID' => $order_id ); $webService = $client->GetPaymentFields($args); if($webService->GetPaymentFieldsResult->respcode == "00") { $order = new WC_Order( $order_id ); $type = $webService->GetPaymentFieldsResult->paymenttype; if( $type == "1" ) { $client->Confirmation($args); } $order->update_status('on-hold', __( 'Awaiting credit card payment', 'woocommerce' )); // Reduce stock levels $order->reduce_order_stock(); // Remove cart $woocommerce->cart->empty_cart(); } else { //echo ''; } } } }
如果有人能帮我就告诉我。
问题出在this->backurl
,因为它有/
,所以服务器感觉像是转到了/另一个资源,所以需要使用urlencode(this->backurl)
对其进行编码
说明 微信支付-企业付款到银行卡SDK。 官方文档:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=24_2 类 请求参数类 请求参数 类名:\Yurun\PaySDK\Weixin\CompanyPay\Bank\Pay\Request 属性 名称 类型 说明 $_apiMethod string 接口名称 $pa
问题内容: 通常,wooCommerce应该自动完成虚拟产品的订单。但是事实并非如此,这是一个实际的问题,即使是BUG之类的。 因此,在这一点上,您可以找到一些有用的东西(但不是很方便): 1)一段代码 (您可以在wooCommerce文档中找到): 但是此代码段不适用于 BACS , 货到付款 和 支票* 付款方式。Paypal和信用卡网关的付款方式都可以。 BACS 是直接银行转帐付款方式 还
“处理您的订单时出错” 我设置付款方式没有问题,但当我尝试使用authorize.net选项时,我得到一条弹出消息,上面写着“处理您的订单时出错”。订单不显示在后端,但付款被处理,我会收到一封确认电子邮件,上面有我的订单号。 我用Authorize.net检查了付款是否通过,信用卡是否有效,并且似乎没有问题,它去掉了问题可能是由于配置不良造成的选项。 下一个异常“zend_db_statement
我检查了贝宝开发人员的文档,以找到一个适合我的支付处理需求的解决方案。现在我不确定平行付款是否可以按我需要使用。 场景:商店中的客户可以有多个推车,因为每个推车都与一个可选择的交货时间相关联。结账时,每一辆车都必须成为一个单独的订单,并有自己的发票。现在,使用PayPal支付时,每一个订单都需要有自己的带有交易ID的支付等等,总结起来,我不需要一次性支付给多个接收方,而是每个订单多个支付给一个接收
我用woocommerce做了一个简单的网店,有三种付款方式。理想情况下,可通过直接银行转账和开户。订单ID是根据付款方式创建的。例如,如果使用iDEAL付款,订单id将变为ID190100;如果以账户付款,订单id将变为RK190100。我从BeRocket的插件“WooCommerce的顺序订单号”中得到了这一点,但这些都是在付款完成之前创建的。订单ID必须在付款后才能最终确定。现在,尚未付款
我WooCommerce,我正在使用“更改管理付款状态返回到WoocommercePending order status unpayed for WoocommercePending”答案代码,当订单状态在后端手动更改为pending时,重置订单的已付款状态。 例如,如果订单状态从“完成”更改为“挂起”,则删除以下内容:“支付日期为4月2日,2019年@5:29 PM” 现在我这里的问题是在订单