将自定义args添加到Paypal Woocommerce

时间:2017-02-23 19:16:29

标签: php paypal woocommerce

我需要为PayPal付费链接添加自定义参数。

PHP函数如下所示:

public bool UpdateDiscrepancyReport()
    {
        var errorStatus = false;
        int carRequired ;
        carRequired = cbxCarRequired.Checked == false ? 0 : 1;
        var updateQuery = "my query string ";                         
        dbf.OpenConnection(updateQuery);
        bool updateStatus = dbf.OpenConnection(updateQuery);
        if (updateStatus)
        {
            errorStatus = true;
        }
        else
        {
        MessageBox.Show(@"Error in updating DR" + tbxDRNumber.Text+@" ",@"Update Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        return errorStatus;
    }

我添加了$paypal_args = apply_filters( 'woocommerce_paypal_args', $paypal_args ); add_filter( 'woocommerce_paypal_args' , 'change_paypal_args' ); function change_paypal_args( $paypal_args ) { global $wp; global $woocommerce; $order = wc_get_order( $order_id ); $paypal_args['invoice'] = 'spi432'; $paypal_args['txn_type'] = 'cart'; $paypal_args['payment_date'] = $order->order_date; return $paypal_args; } txn_type作为链接的参数。但invoice未显示。

可能是什么问题?另外,如何显示客户的电子邮件?

0 个答案:

没有答案