Пример #1
0
        /// <summary>
        /// 本示例介绍如何创余额提现申请(Userwithdrawals 对象)、更新 Userwithdrawals 对象 获取列表和明细
        /// </summary>
        /// <param name="appId"></param>
        public static void Example(string appId)
        {
            Console.WriteLine("****发起余额提现请求创建余额体现 withdrawals对象-unionpay渠道****");
            var withDrawal = unionpayWithdrawal(appId);

            Console.WriteLine(withDrawal);
            Console.WriteLine();

            Console.WriteLine("****发起余额提现请求创建余额体现 withdrawals对象-alipay渠道****");
            Console.WriteLine(alipayWithdrawal(appId));
            Console.WriteLine();

            Console.WriteLine("****发起余额提现请求创建余额体现 withdrawals对象-wx_pub渠道****");
            Console.WriteLine(wxPubWithdrawal(appId));
            Console.WriteLine();

            Console.WriteLine("****发起余额提现请求创建余额体现 withdrawals对象-allinpay渠道****");
            Console.WriteLine(allinpayWithdrawal(appId));
            Console.WriteLine();

            Console.WriteLine("****发起余额提现请求创建余额体现 withdrawals对象-jdpay渠道****");
            Console.WriteLine(jdpayWithdrawal(appId));
            Console.WriteLine();

            var listParams = new Dictionary <string, object> {
                { "page", 1 },
                { "per_page", 10 },
                { "status", "created" },
                { "channel", "alipay" }   //提现使用渠道。银联:unionpay,支付宝:alipay,微信:wx_pub。
            };

            Console.WriteLine("****发起余额提现列表查询 Userwithdrawals 对象****");
            Console.WriteLine(Withdrawal.List(appId, listParams));

            Console.WriteLine("****余额提现对象查询 Userwithdrawals 对象****");
            Console.WriteLine(Withdrawal.Retrieve(appId, withDrawal.Id));

            Console.WriteLine("****发起余额提现请求确认 Userwithdrawals 对象****");
            Console.WriteLine(Withdrawal.Confirm(appId, withDrawal.Id));
            Console.WriteLine();

            Console.WriteLine("****发起余额提现请求取消 Userwithdrawals 对象****");
            Console.WriteLine(Withdrawal.Cancel(appId, withDrawal.Id));
            Console.WriteLine();
        }