コード例 #1
0
ファイル: Recurring.cs プロジェクト: shovelheadfxe/DevLab
        public string StoreCard()
        {
            using (BlackbaudSecurePayments spSvc = Common.GetSecurePaymentsProxy())
            {
                StoreCardInfoRequest req = new StoreCardInfoRequest();

                Common.SetBBPayPaymentServiceClientInfoHeader(req);

                req.Token = this.Token; //new Guid("D1B8CB72-083E-4A58-9F54-AB75D123AC24");
                req.DonorIP = "24.24.24.24";
                req.CardToken = this.CardToken;
                req.Description = "Monthly test of store card.";
                req.MerchantAccountId = Common.MERCHANT_ACCOUNT_ID; //new Guid("bb229843-c846-4d55-911e-905d9aea3b13");
                req.CallbackURI = Common.CALL_BACK_URI;

                StoreCardInfoReply r = spSvc.StoreCardInfo(req);

                if (r.Success)
                {
                    return r.ProcessURI;

                }
                else
                {
                    return r.Message;
                }
            }
        }
コード例 #2
0
ファイル: CardInfo.cs プロジェクト: shovelheadfxe/DevLab
        public void StoreCard()
        {
            StoreCardInfoRequest req = new StoreCardInfoRequest();

            Common.SetPSClientInfoHeader(req);

            using (var proxy = Common.GetPaymentServiceProxy())
            {
                req.CardToken = Guid.NewGuid().ToString();
                req.CardHolder = "William Frostberg";
                req.CardNumber = "4111111111111111";
                req.ExpiryDate = new FuzzyDate() { Month = 6, Year = 2016 };
                req.IsTransient = false;
                req.ValidateCardNumber = false;

                var reply = proxy.StoreCardInfo(req);

            }
        }
コード例 #3
0
ファイル: CCU.cs プロジェクト: shovelheadfxe/DevLab
        public void UploadCards()
        {
            var serv = Common.GetPaymentServiceProxy();

            using (System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(CONNECTIONSTRING))
            {
                using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
                {
                    con.Open();
                    cmd.Connection = con;
                    cmd.CommandText = "select cardtoken, cardnumber, cardholder, expirydate from dbo.cards";
                    var rdr = cmd.ExecuteReader();

                    while (rdr.Read())
                    {
                        var request = new StoreCardInfoRequest();
                        request.CardHolder = rdr.GetString(2);
                        request.CardNumber = rdr.GetString(1);
                        request.CardToken = rdr.GetSqlGuid(0).ToString();

                        request.ValidateCardNumber = false;
                        DateTime exDate = DateTime.Parse(rdr.GetString(3));

                        request.ExpiryDate = new FuzzyDate { Month = exDate.Month, Year = exDate.Year };

                        request.ClientAppInfo = new ClientAppInfoHeader() { ClientAppName = "ImportAgent", TimeZone = System.TimeZone.CurrentTimeZone.StandardName, REDatabaseToUse = "BBPS" };

                        var reply = serv.StoreCardInfo(request);
                    }
                }
            }
        }