예제 #1
0
        private void UpdateAccountInfo(IDatabaseCustomerMarketPlace databaseCustomerMarketPlace)
        {
            var securityInfo = RetrieveCustomerSecurityInfo <PayPalSecurityData>(databaseCustomerMarketPlace);
            PayPalPersonalData personalData = GetAccountInfo(securityInfo.PermissionsGranted);

            Helper.SaveOrUpdateAcctountInfo(databaseCustomerMarketPlace, personalData);
        }
예제 #2
0
        private PayPalPersonalData ParcePersonalData(Dictionary <PersonalAttribute, string> dict, DateTime submitDate)
        {
            var personalData = new PayPalPersonalData {
                SubmittedDate = submitDate
            };

            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgnamePersonfirst, v => personalData.FirstName             = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgnamePersonlast, v => personalData.LastName               = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactemail, v => personalData.Email                    = v);
            TryGetDictValue(dict, PersonalAttribute.httpschemaopenidnetcontactfullname, v => personalData.FullName          = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcompanyname, v => personalData.BusinessName              = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactcountryhome, v => personalData.AddressCountry     = v);
            TryGetDictValue(dict, PersonalAttribute.httpswwwpaypalcomwebappsauthschemapayerID, v => personalData.PlayerId   = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgbirthDate, v => personalData.BirthDate                   = ConvertToDateTime(v));
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactpostalCodehome, v => personalData.AddressPostCode = v);
            TryGetDictValue(dict, PersonalAttribute.httpschemaopenidnetcontactstreet1, v => personalData.AddressStreet1     = v);
            TryGetDictValue(dict, PersonalAttribute.httpschemaopenidnetcontactstreet2, v => personalData.AddressStreet2     = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactcityhome, v => personalData.AddressCity           = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactstatehome, v => personalData.AddressState         = v);
            TryGetDictValue(dict, PersonalAttribute.httpaxschemaorgcontactphonedefault, v => personalData.Phone             = v);

            return(personalData);
        }
        private int SavePayPal(Customer customer, PayPalPermissionsGranted permissionsGranted, PayPalPersonalData personalData, PayPalDatabaseMarketPlace paypal)
        {
            var securityData = new PayPalSecurityData
            {
                PermissionsGranted = permissionsGranted,
                UserId             = personalData.Email
            };

            var mp = this.dbHelper.SaveOrUpdateCustomerMarketplace(personalData.Email, paypal, securityData, customer);

            this.dbHelper.SaveOrUpdateAcctountInfo(mp, personalData);
            return(mp.Id);
        }
예제 #4
0
파일: paypal.cs 프로젝트: vijayamazon/ezbob
        public void SaveOrUpdateAcctountInfo(IDatabaseCustomerMarketPlace databaseCustomerMarketPlace, PayPalPersonalData data)
        {
            MP_CustomerMarketPlace customerMarketPlace = GetCustomerMarketPlace(databaseCustomerMarketPlace.Id);

            if (customerMarketPlace.PersonalInfo == null)
            {
                customerMarketPlace.PersonalInfo = new MP_PayPalPersonalInfo {
                    CustomerMarketPlace = customerMarketPlace,
                };

                _CustomerMarketplaceRepository.Save(customerMarketPlace);
            }

            MP_PayPalPersonalInfo info = customerMarketPlace.PersonalInfo;

            info.Updated      = data.SubmittedDate;
            info.BusinessName = data.BusinessName;
            info.City         = data.AddressCity;
            info.FirstName    = data.FirstName;
            info.Country      = data.AddressCountry;
            info.DateOfBirth  = data.BirthDate;
            info.Phone        = data.Phone == "0" ? null : data.Phone;
            info.EMail        = data.Email;
            info.LastName     = data.LastName;
            info.FullName     = data.FullName;
            info.PlayerId     = data.PlayerId;
            info.Postcode     = data.AddressPostCode;
            info.State        = data.AddressState;
            info.Street1      = data.AddressStreet1;
            info.Street2      = data.AddressStreet2;

            _CustomerMarketplaceRepository.SaveOrUpdate(customerMarketPlace);
        }