【问题标题】:woocommerce twocheckout return payment error, but mail sendwoocommerce twocheckout 返回付款错误,但邮件发送
【发布时间】:2017-08-08 02:41:43
【问题描述】:

我为woocommerce选择了带有twocheckout插件的付款方式,付款过程没问题,我可以通过带有插件的沙箱进行paymanet问题在于流程的退货付款:

Order properties should not be accessed directly.
Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), 
require_once('wp-config.php'), require_once('wp-settings.php'), 
do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, 
call_user_func_array, WC_Form_Handler::checkout_action, 
WC_Checkout->process_checkout, WC_Checkout->process_order_payment, 
WC_Gateway_Twocheckout->process_payment, WC_Abstract_Legacy_Order->__get, 
wc_doing_it_wrong

wordpress 会报错

"Warning: Cannot modify header information - headers already sent"

但是付款没问题,下单了,其实连订单邮件都寄出去了,

感谢您的支持和帮助

【问题讨论】:

    标签: php wordpress


    【解决方案1】:

    在阅读了 woocommerce 的 twocheckout 功能插件的 get 方法后,我意识到有未更新的方法来调用 Order 属性,所以,检查错误应该去 WC order methods of Woocommerce 并检查更改,:

    twocheckout 的“process_payment”函数已弃用了调用帐单地址信息的方法,因此更新如下:

                if ( 'yes' == $this->debug && $this->notify_url !=='')
                $this->log( 'Generating payment form for order ' . $order->get_order_number() . '. Notify URL: '. $this->notify_url );
    
            // 2Checkout Args
            $twocheckout_args = array(
                                    'token'         => $_POST['token'],
                                    'sellerId'      => $this->seller_id,
                                    'currency' => get_woocommerce_currency(),
                                    'total'         => $order->get_total(),
    
                                    // Order key
                                    'merchantOrderId'    => $order->get_order_number(),
    
                                    // Billing Address info
                                    "billingAddr" => array(
                                        'name'          => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
                                        'addrLine1'     => $order->get_billing_address_1(),
                                        'addrLine2'     => $order->get_billing_address_2(),
                                        'city'          => $order->get_billing_city(),
                                        'state'         => $order->get_billing_state(),
                                        'zipCode'       => $order->get_billing_postcode(),
                                        'country'       => $order->get_billing_country(),
                                        'email'         => $order->get_billing_email(),
                                        'phoneNumber'   => $order->get_billing_phone()
                                    )
                                );
    

    您也可以在 forkedre here 上找到更新的方法

    希望尽快更新。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-09
      • 1970-01-01
      • 1970-01-01
      • 2011-06-04
      • 1970-01-01
      • 2012-04-22
      • 2021-08-05
      • 1970-01-01
      相关资源
      最近更新 更多