public static string GetTokenId(paymentrequestfortoken model)
        {
            string token = "";
            var myToken = new StripeTokenCreateOptions
            {
                Card = new StripeCreditCardOptions
                {
                    // set these properties if passing full card details (do not
                    // set these properties if you set TokenId)
                    Number = model.cardnumber, // "4242424242424242",
                    ExpirationYear = model.expiryear, // "2022",
                    ExpirationMonth = model.expirymonth, // "10",
                    //AddressCountry = "US",                // optional
                    //AddressLine1 = "24 Beef Flank St",    // optional
                    //AddressLine2 = "Apt 24",              // optional
                    //AddressCity = "Biggie Smalls",        // optional
                    //AddressState = "NC",                  // optional
                    //AddressZip = "27617",                 // optional
                    Name = model.Name, // optional
                    // Cvc = "1223"                          // optional
                }
            };
            // if you need this...
            // set this property if using a customer (stripe connect only)
            //myToken.CustomerId = *customerId*;

            var tokenService = new StripeTokenService();
            StripeToken stripeToken = tokenService.Create(myToken);

            token = stripeToken.Id;
            return token;
        }
        public string DoPaymentByUserId(ReqPayment objreq)
        {
            string returnval = "0";
            try
            {
                var objmodel = new paymentrequestfortoken();
                objmodel.cardnumber = objreq.cardnumber;
                objmodel.expiryear = objreq.year;
                objmodel.expirymonth = objreq.cardexpmonth;
                objmodel.Name = objreq.nameoncard;

                string tokenId = StripPayment.GetTokenId(objmodel);
                if (!string.IsNullOrEmpty(tokenId))
                {
                    var objchargemodel = new paymentrequestforcharge();
                    objchargemodel.amount = objreq.amount;
                    objchargemodel.description = "Payment from User " + objreq.userId;
                    objchargemodel.tokenid = tokenId;
                    string chargeid = StripPayment.ChargeCustomer(objchargemodel);
                    if (!string.IsNullOrEmpty(chargeid))
                    {
                        InsertTransaction(Convert.ToInt64(objreq.userId), chargeid, objreq.amount,
                            (int) TransactionType.Credit, objreq.tokenId);
                        returnval = "1";
                    }
                }
                else
                {
                    returnval = "-1";
                }
            }
            catch (Exception ex)
            {
                returnval = ex.Message;
            }
            return returnval;
        }