예제 #1
0
파일: PayPal.cs 프로젝트: srowlison/bbiller
        private CreditCardDetailsType MapCardDetails(string CCNumber, string FirstName, string LastName, string Address, string City, string Zip, string State, string Country, string Telephone, string DOB, string EmailAddress, string CardHolderName, string ExpiryMonth, string ExpiryYear, string CVC2)
        {
            var details          = new CreditCardDetailsType();
            var payerInfo        = new PayerInfoType();
            var address          = new AddressType();
            var personalNameType = new PersonNameType();

            // var cardType = MapCardType(CardType);

            personalNameType.FirstName = FirstName;
            personalNameType.LastName  = LastName;

            payerInfo.Address      = address;
            payerInfo.ContactPhone = Telephone;
            payerInfo.PayerName    = personalNameType;

            details.CardOwner        = payerInfo;
            details.CreditCardNumber = CCNumber;
            //      details.CreditCardType = cardType;
            details.CVV2     = CVC2;
            details.ExpMonth = int.Parse(ExpiryMonth);
            details.ExpYear  = int.Parse(ExpiryYear);

            return(details);
        }
예제 #2
0
        private static EmpContactInfoType CreateEmpContactInfoType()
        {
            EmpContactInfoType e = new EmpContactInfoType();

            e.ContactMethod = new List <ContactMethodType>();
            ContactMethodType m = CreateContactMethodType();

            e.ContactMethod.Add(m);

            e.contactType = "Contacttype";

            e.InternetDomainName = new List <InternetDomainNameType>();
            InternetDomainNameType i = CreateInternetDomainNameType();

            e.InternetDomainName.Add(i);

            e.LocationSummary = CreateEmploymentLocationSummaryType();

            var personName = new PersonNameType();

            SetName(personName, "", "Jansen", "Jan", "Jan");
            e.PersonName = personName;

            return(e);
        }
예제 #3
0
        public NameTypeCTRLViewModel(PersonNameType personNameType)
        {
            _personNameType = personNameType;

            // _personNameType.Language = LanguageCodeList.EnUS;
            LanguageChangedCommand = new LanguageChangedCommandClass(this);
        }
예제 #4
0
        /// <summary>
        /// Appends mention to a person.
        /// </summary>
        /// <param name="person"><see cref="Person"/> to be mentioned.</param>
        /// <param name="nameType"><see cref="PersonNameType"/> to be used on mention.</param>
        /// <returns>A reference to this instance after the append operation has completed.</returns>
        public MarkdownBuilder AppendMentionToPerson(Person person, PersonNameType nameType = PersonNameType.DisplayName)
        {
            string name = null;

            switch (nameType)
            {
            case PersonNameType.NickName:
                name = person.NickName;
                break;

            case PersonNameType.FirstName:
                name = person.FirstName;
                break;

            case PersonNameType.LastName:
                name = person.LastName;
                break;

            default:
                name = person.DisplayName;
                break;
            }

            if (String.IsNullOrEmpty(name))
            {
                name = person.DisplayName;
            }

            return(AppendMentionToPerson(person.Id, name, PersonIdType.Id));
        }
예제 #5
0
        private static ReferenceType CreateReferenceType()
        {
            ReferenceType r = new ReferenceType();

            r.Comments = "Commentaar";

            r.ContactMethod = new List <ContactMethodType>();
            ContactMethodType m = CreateContactMethodType();

            r.ContactMethod.Add(m);

            var personName = new PersonNameType();

            SetName(personName, "", "Jansen", "Jan", "Jan");

            r.PersonName = personName;

            r.PositionTitle = "PositionTitle";

            //<xsd:enumeration value="Professional"/>
            //<xsd:enumeration value="Personal"/>
            //<xsd:enumeration value="Verification"/>

            r.type = "Personal";
            return(r);
        }
예제 #6
0
 public OTA_ResRetrieveRSReservationsListPackageReservation()
 {
     this._departureLocation = new LocationType();
     this._arrivalLocation   = new LocationType();
     this._name     = new PersonNameType();
     this._uniqueID = new UniqueID_Type();
 }
예제 #7
0
        public int Create([FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            using (var db = new peppaDB())
            {
                int uid = db.InsertWithInt32Identity <PersonNameType>(o);
                return(uid);
            }
        }
예제 #8
0
        public int Upsert([FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            using (var db = new peppaDB())
            {
                int count = db.InsertOrReplace <PersonNameType>(o);
                return(count);
            }
        }
예제 #9
0
        public int Modify(int personNameTypeId, [FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            using (var db = new peppaDB())
            {
                var count = db.Update <PersonNameType>(o);
                return(count);
            }
        }
        private static DoDirectPaymentResponseType MakePayment(PaymentModel paymentModel)
        {
            // Create request object
            var request        = new DoDirectPaymentRequestType();
            var requestDetails = new DoDirectPaymentRequestDetailsType();

            request.DoDirectPaymentRequestDetails = requestDetails;

            var creditCard = new CreditCardDetailsType();

            requestDetails.CreditCard = creditCard;
            var payer = new PayerInfoType();

            // (Optional) First and last name of buyer.
            PersonNameType name = new PersonNameType();

            name.FirstName  = string.Format("{0} {1}", SessionWrapper.LoggedUser.FirstName, SessionWrapper.LoggedUser.LastName);
            name.LastName   = SessionWrapper.LoggedUser.Email; //pass buyer email address.
            payer.PayerName = name;

            creditCard.CardOwner = payer;

            creditCard.CreditCardNumber = paymentModel.CreditCardModel.CardNumber;

            creditCard.CreditCardType = (CreditCardTypeType)
                                        Enum.Parse(typeof(CreditCardTypeType), paymentModel.CreditCardModel.CardType.ToUpper());
            creditCard.CVV2 = paymentModel.CreditCardModel.SecurityCode;

            creditCard.ExpMonth = Convert.ToInt32(paymentModel.CreditCardModel.ExpMonth);
            creditCard.ExpYear  = Convert.ToInt32(paymentModel.CreditCardModel.ExpYear);

            requestDetails.PaymentDetails = new PaymentDetailsType();


            CurrencyCodeType currency = (CurrencyCodeType)
                                        Enum.Parse(typeof(CurrencyCodeType), "USD");
            var paymentAmount = new BasicAmountType(currency, paymentModel.OrderDetailModel.TotalOrder.ToString());

            requestDetails.PaymentDetails.OrderTotal = paymentAmount;

            // Invoke the API
            var wrapper = new DoDirectPaymentReq();

            wrapper.DoDirectPaymentRequest = request;

            var service = new PayPalAPIInterfaceServiceService();

            // API call
            return(service.DoDirectPayment(wrapper));
        }
예제 #11
0
        private static SEPContactInfoType CreateSEPContactInfoType()
        {
            SEPContactInfoType c = new SEPContactInfoType();

            c.ContactMethod = new List <ContactMethodType>();
            ContactMethodType m = CreateContactMethodType();

            c.ContactMethod.Add(m);

            var personName = new PersonNameType();

            SetName(personName, "", "Jansen", "Jan", "Jan");
            c.PersonName = personName;

            return(c);
        }
        public IActionResult Modify(int personNameTypeId, [FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            if (ModelState.IsValid)
            {
                using (var db = new peppaDB())
                {
                    o.modified_by = CurrentAccountId;
                    var count = db.Update <PersonNameType>(o);
                    return(Ok(count));
                }
            }
            return(BadRequest());
        }
        public IActionResult Create([FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            if (ModelState.IsValid)
            {
                using (var db = new peppaDB())
                {
                    o.created_by  = CurrentAccountId;
                    o.modified_by = CurrentAccountId;
                    o.uid         = db.InsertWithInt32Identity <PersonNameType>(o);
                    return(CreatedAtAction(nameof(Get), new { personNameTypeId = o.person_name_type_id }, o));
                }
            }
            return(BadRequest());
        }
예제 #14
0
        public static void SetName(
            PersonNameType personName, string voorvoegsel, string achternaam, string volledigenaam, string roepnaam)
        {
            // preferredGivenName = voornaam
            personName.PreferredGivenName = roepnaam;

            var familyName = new PersonNameTypeFamilyName();

            familyName.primarySpecified = true;
            familyName.primary          = PersonNameTypeFamilyNamePrimary.@true;
            familyName.Value            = achternaam;
            familyName.prefix           = voorvoegsel;
            personName.FamilyName.Add(familyName);

            personName.GivenName.Add(roepnaam);

            // volledige naam
            personName.FormattedName = volledigenaam;
        }
        public IActionResult Upsert([FromBody] PersonNameType o)
        {
#if DEBUG
            DataConnection.TurnTraceSwitchOn();
            DataConnection.WriteTraceLine = (msg, context) => Debug.WriteLine(msg, context);
#endif
            if (ModelState.IsValid)
            {
                using (var db = new peppaDB())
                {
                    if (o.uid == 0)
                    {
                        o.created_by = CurrentAccountId;
                    }
                    o.modified_by = CurrentAccountId;
                    int count = db.InsertOrReplace <PersonNameType>(o);
                    return(Ok(count));
                }
            }
            return(BadRequest());
        }
예제 #16
0
        private static void DoHumanResource()
        {
            HumanResourceType   humanResource;
            EntityIdType        entityIDFlex2GO;
            EntityIdTypeIdValue entityIdTypeIdFlex2GO;
            EntityIdType        entityIDNocore;
            EntityIdTypeIdValue entityIdTypeIdNocore;

            // aanmaken hoofdelement.
            humanResource = new HumanResourceType();
            // referenceInformation hebben we zo ook nodig
            humanResource.ReferenceInformation = new HumanResourceTypeReferenceInformation();
            // resourceInformation hebben we zo ook nodig.
            humanResource.ResourceInformation = new HumanResourceTypeResourceInformation();
            // profielinformatie zoals beschikbaarheden hebben we zo ook nodig
            humanResource.Profile = new HumanResourceTypeProfile();
            // userArea, die we gaan gebruiken voor eigen gegevens en setu aanvullingen
            humanResource.UserArea = new UserAreaType();
            // voorkeuren, leeg element.
            humanResource.Preferences = new HumanResourceTypePreferences();

            #region Status

            humanResource.HumanResourceStatus = new HumanResourceTypeHumanResourceStatus();
            // nieuwe medewerker
            humanResource.HumanResourceStatus.status = KnownStatusType.New;
            #endregion

            #region Identifier van HumanResource in Flex2GO

            // maken van eigen identifier Flex2GO
            entityIDFlex2GO = new EntityIdType();
            // wij zijn eigenaar
            entityIDFlex2GO.idOwner = "Flex2GO";
            // waardeobject
            entityIdTypeIdFlex2GO = new EntityIdTypeIdValue();
            // Flex2GO gebruikt guids
            entityIdTypeIdFlex2GO.Value = "F020D955-A2A8-4371-A57F-BB9E5012CEDD";
            // toevoegen waarde object aan entityId object
            entityIDFlex2GO.IdValue.Add(entityIdTypeIdFlex2GO);
            // toevoegen van EntityId object aan de lijst met HumanResourceId's, dit is die van Flex2GO
            humanResource.HumanResourceId.Add(entityIDFlex2GO);

            #endregion

            #region Identifier van HumanResource in Nocore
            // maken van eigen identifier Nocore
            entityIDNocore = new EntityIdType();
            // wij zijn eigenaar
            entityIDNocore.idOwner = "SEDIS";
            // waardeobject
            entityIdTypeIdNocore = new EntityIdTypeIdValue();
            // Nocore gebruikt integers, personeelsnummer
            entityIdTypeIdNocore.Value = "12345";
            // toevoegen waarde object aan entityId object
            entityIDNocore.IdValue.Add(entityIdTypeIdNocore);
            // toevoegen van EntityId object aan de lijst met HumanResourceId's, dit is die van Nocore
            humanResource.HumanResourceId.Add(entityIDNocore);

            #endregion

            #region Identifier Bedrijf Flex2GO = StaffingSupplier indien van Flex2GO naar Nocore

            // maken van eigen identifier Flex2GO
            EntityIdType entityIDBedrijfFlex2GO = new EntityIdType();
            // waardeobject
            EntityIdTypeIdValue entityIdTypeIdBedrijfFlex2GO = new EntityIdTypeIdValue();
            // Flex2GO gebruikt guids, guid van het Bedrijf in Flex2GO
            entityIdTypeIdBedrijfFlex2GO.Value = "0F14A513-BC2A-4F44-9EBC-5EDA5CF58BDC";
            // toevoegen waarde object aan entityId object
            entityIDBedrijfFlex2GO.IdValue.Add(entityIdTypeIdBedrijfFlex2GO);
            // toevoegen van EntityId object aan de lijst met HumanResourceId's, dit is die van Flex2GO
            humanResource.ReferenceInformation.StaffingSupplierId.Add(entityIDBedrijfFlex2GO);

            #endregion

            #region Identifier Administratie Nocore = StaffingCustomer indien van Flex2GO naar Nocore
            // maken van eigen identifier Nocore
            EntityIdType entityIDAdministratieNocore = new EntityIdType();
            // waardeobject
            EntityIdTypeIdValue entityIdTypeIdAdministratieNocore = new EntityIdTypeIdValue();
            // Nocore gebruikt integers, administratienummer
            entityIdTypeIdAdministratieNocore.Value = "1";
            // toevoegen waarde object aan entityId object
            entityIDAdministratieNocore.IdValue.Add(entityIdTypeIdAdministratieNocore);
            // toevoegen van EntityId object aan de lijst met HumanResourceId's, dit is die van Nocore
            humanResource.ReferenceInformation.StaffingCustomerId.Add(entityIDAdministratieNocore);

            #endregion

            #region PersonName structuur
            // nieuw HR-XML naam object
            PersonNameType name = new PersonNameType();
            // zet de naam op het HR-XML object in subroutine
            SetName(name, "de", "Vries", "Jan de Vries", "Jan");
            // stop de personname op de resourceInformation
            humanResource.ResourceInformation.PersonName = name;

            #endregion

            #region ContactInfo

            // nieuw HR-XML contactInfo object
            EntityContactInfoType entityContactInfo = new EntityContactInfoType();
            // gelijk aan formattedname bij ons
            entityContactInfo.EntityName = "Jan de Vries";

            // zet contactinformatie en voeg die toe aan contactInfo object
            ContactMethodType contactInfo = new ContactMethodType();
            contactInfo.Mobile               = CreateMobileNumber("0612332230", TelcomItemsChoiceType.FormattedNumber);
            contactInfo.Telephone            = CreateNumber("0306561563", TelcomItemsChoiceType.FormattedNumber);
            contactInfo.InternetEmailAddress = "*****@*****.**";
            entityContactInfo.ContactMethod.Add(contactInfo);

            humanResource.ResourceInformation.EntityContactInfo = entityContactInfo;

            #endregion

            #region Adres

            // nieuw HR-XML adres object
            PostalAddressType postalAddress = new PostalAddressType();
            // landcode van Nederland in ISO2
            postalAddress.CountryCode = "NL";

            // nieuw HR-XML PostalAddressTypeDeliveryAddress object

            PostalAddressTypeDeliveryAddress deliveryAddress = new PostalAddressTypeDeliveryAddress();
            // eigenschappen op object plakken
            deliveryAddress.StreetName     = "Groeneweg";
            deliveryAddress.BuildingNumber = "21";
            deliveryAddress.Unit           = "Z";
            deliveryAddress.AddressLine.Add("Groeneweg 21Z");
            postalAddress.DeliveryAddress = deliveryAddress;
            postalAddress.PostalCode      = "3981 CK";
            // type = streetAddress = Huisadres
            postalAddress.type          = PostalAddressTypeType.streetAddress;
            postalAddress.typeSpecified = true;

            // zet adres op ResourceInformation object
            humanResource.ResourceInformation.PostalAddress = postalAddress;

            #endregion

            #region Profile

            // reisafstand in kilometers
            HumanResourceTypePreferencesCommute commute = new HumanResourceTypePreferencesCommute();
            commute.DistanceMax = "100";
            humanResource.Preferences.Commute = commute;

            #endregion

            #region HumanResourceAdditionalNL

            HumanResourceAdditionalNLType humanResourceAdditionalNL = new HumanResourceAdditionalNLType();

            //geslacht
            humanResourceAdditionalNL.Sex          = SexType.male;
            humanResourceAdditionalNL.SexSpecified = true;

            // geboortedatum
            humanResourceAdditionalNL.BirthDate          = new DateTime(1981, 07, 24);
            humanResourceAdditionalNL.BirthDateSpecified = true;

            // aanmaken idDocument en vervaldatum
            IdentificationDocumentType idDocument    = new IdentificationDocumentType();
            EffectiveDateType          effictiveDate = new EffectiveDateType();

            // vervaldatum
            effictiveDate.ValidTo          = new DateTime(2015, 01, 10);
            effictiveDate.ValidToSpecified = true;
            idDocument.EffectiveDate       = effictiveDate;

            // formaat en nummer
            idDocument.Format = "Paspoort";
            idDocument.Id     = "123456789";
            humanResourceAdditionalNL.IdentificationDocument = idDocument;

            // toewijzen humanresourceAdditionalNL deel aan de humanResource
            humanResource.UserArea.HumanResourceAdditionalNL          = humanResourceAdditionalNL;
            humanResource.UserArea.HumanResourceAdditionalNLSpecified = true;

            #endregion

            #region Nocore specifieke data

            NocoreHumanResourceType nocoreHumanResource = new NocoreHumanResourceType();

            // intercedent
            nocoreHumanResource.AccountManager = "Piet Intercedent";

            nocoreHumanResource.BankAccountInfo = new BankAccountInfoType();
            nocoreHumanResource.BankAccountInfo.BankAccountForeign = "569759943";

            nocoreHumanResource.Status = "Uit dienst";

            // twee fase periodes, fase 1 en fase 2A
            FasePeriodType periode1 = new FasePeriodType();
            periode1.Fase        = "1";
            periode1.From        = new DateTime(2008, 01, 01);
            periode1.To          = new DateTime(2008, 06, 30);
            periode1.ToSpecified = true;
            nocoreHumanResource.FaseHistorie.Add(periode1);
            FasePeriodType periode2 = new FasePeriodType();
            periode2.Fase        = "2A";
            periode2.From        = new DateTime(2008, 07, 01);
            periode2.ToSpecified = false;
            nocoreHumanResource.FaseHistorie.Add(periode2);
            // initialen, met puntjes ertussen
            nocoreHumanResource.Initials = "J.";

            // nocore vestiging
            nocoreHumanResource.Location      = new NocoreLocationType();
            nocoreHumanResource.Location.Code = "1";
            nocoreHumanResource.Location.Name = "Hoofdvestiging";

            // samenwonend
            nocoreHumanResource.MaritalStatus = "Gehuwd";

            // nationaliteit
            nocoreHumanResource.Nationality         = new NationalityType();
            nocoreHumanResource.Nationality.GBACode = "1";
            nocoreHumanResource.Nationality.Name    = "Nederlandse";

            // mutatiedatum
            nocoreHumanResource.Modified = DateTime.Now;
            humanResource.UserArea.NocoreHumanResource          = nocoreHumanResource;
            humanResource.UserArea.NocoreHumanResourceSpecified = true;

            #endregion

            // serializen, valideren, en opslaan in bestand. Zie EntityBase voor meer informatie van de basisklasse

            humanResource.SaveToFile("HumanResource.xml");

            // En weer laden uit bestand.

            HumanResourceType loadedHumanResource = EntityBase <HumanResourceType> .LoadFromFile("HumanResource.xml");

            // druk naam af in de console.

            Console.WriteLine(loadedHumanResource.ResourceInformation.PersonName.FormattedName);
        }
예제 #17
0
 public OTA_ReadRQReadRequestsGlobalReservationReadRequest()
 {
     this._travelerName = new PersonNameType();
 }
예제 #18
0
 public OffLocationServiceType()
 {
     this._trackingID = new UniqueID_Type();
     this._telephone  = new OffLocationServiceTypeTelephone();
     this._personName = new PersonNameType();
 }
        protected void BtnPayNow_Click(object sender, EventArgs e)
        {
            Customer c = (Customer)Session["User"] as Customer;
            CreditCardDetailsType creditCard = new CreditCardDetailsType();

            switch (rblCardType.SelectedValue)
            {
            case "visa":
                creditCard.CreditCardType = CreditCardTypeType.VISA;
                break;

            case "mastercard":
                creditCard.CreditCardType = CreditCardTypeType.MASTERCARD;
                break;
                //case "discover":
                //    creditCard.CreditCardType = CreditCardTypeType.DISCOVER;
                //    break;
                //case "amex":
                //    creditCard.CreditCardType = CreditCardTypeType.AMEX;
                //    break;
            }
            creditCard.CreditCardNumber = txtCardNumber.Text;
            creditCard.ExpMonth         = Convert.ToInt16(ddlMonthExp.SelectedValue);
            creditCard.ExpYear          = Convert.ToInt16(ddlExpYear.SelectedValue);

            AddressType adrs = new AddressType
            {
                Street1         = txtAddress.Text,
                StateOrProvince = ddlState.SelectedValue,
                PostalCode      = txtPostalCode.Text,
                CityName        = txtCity.Text
            };

            PayerInfoType cardOwner = new PayerInfoType
            {
                Payer = c.Email
            };

            switch (ddlCountry.SelectedValue)
            {
            case "CA":
                cardOwner.PayerCountry = CountryCodeType.CA;
                adrs.Country           = CountryCodeType.CA;
                break;

            case "US":
                cardOwner.PayerCountry = CountryCodeType.US;
                adrs.Country           = CountryCodeType.US;
                break;
            }
            cardOwner.Address = adrs;

            PersonNameType payer = new PersonNameType
            {
                FirstName = txtFirstNameOnCard.Text.ToUpper(),
                LastName  = txtLastNameOnCard.Text.ToUpper()
            };

            cardOwner.PayerName  = payer;
            creditCard.CardOwner = cardOwner;

            switch (Request.QueryString["item"])
            {
            case "ad":
                switch (Request.QueryString["size"])
                {
                case "L":
                    Session["AdType"] = "Business Ad Large";
                    GetPaid("ad", "Large Ad (rotating banner)", "599", creditCard);
                    break;

                case "S":
                    Session["AdType"] = "Business Ad Small";
                    GetPaid("ad", "Small Ad (rotating images)", "299", creditCard);
                    break;
                }
                break;

            case "car":
                string amount = string.Empty;
                switch (Request.QueryString["adtype"])
                {
                case "Business":
                    Session["AdType"] = "Dealership item sales ad";
                    amount            = "19.99";
                    break;

                case "Private":
                    Session["AdType"] = "Private item sales ad";
                    amount            = "0.99";
                    break;
                }
                switch (Request.QueryString["size"])
                {
                case "1":
                    GetPaid("car", "1 vehicle", amount, creditCard);
                    break;

                case "8":
                    GetPaid("car", "8 vehicles", "89.99", creditCard);
                    break;

                case "20":
                    GetPaid("car", "20 vehicles", "199.99", creditCard);
                    break;
                }
                break;
            }
        }
예제 #20
0
 public AirArrangerType()
 {
     this._contactName = new PersonNameType();
     this._companyInfo = new CompanyNameType();
     this._profileRef  = new AirArrangerTypeProfileRef();
 }
예제 #21
0
 public NameTypeCTRL(PersonNameType personNameType)
 {
     this.InitializeComponent();
     DataContext = new NameTypeCTRLViewModel(personNameType);
 }
예제 #22
0
 public OTA_ReadRQReadRequestsCruiseReadRequest()
 {
     this._guestInfo       = new PersonNameType();
     this._selectedSailing = new OTA_ReadRQReadRequestsCruiseReadRequestSelectedSailing();
 }
예제 #23
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            DoDirectPaymentRequestType        request        = new DoDirectPaymentRequestType();
            DoDirectPaymentRequestDetailsType requestDetails = new DoDirectPaymentRequestDetailsType();

            request.DoDirectPaymentRequestDetails = requestDetails;

            requestDetails.PaymentAction = (PaymentActionCodeType)
                                           Enum.Parse(typeof(PaymentActionCodeType), paymentType.SelectedValue);

            // Populate card requestDetails
            CreditCardDetailsType creditCard = new CreditCardDetailsType();

            requestDetails.CreditCard = creditCard;
            PayerInfoType  payer = new PayerInfoType();
            PersonNameType name  = new PersonNameType();

            name.FirstName       = firstName.Value;
            name.LastName        = lastName.Value;
            payer.PayerName      = name;
            creditCard.CardOwner = payer;

            creditCard.CreditCardNumber = creditCardNumber.Value;
            creditCard.CreditCardType   = (CreditCardTypeType)
                                          Enum.Parse(typeof(CreditCardTypeType), creditCardType.SelectedValue);
            creditCard.CVV2 = cvv2Number.Value;
            string[] cardExpiryDetails = cardExpiryDate.Text.Split(new char[] { '/' });
            if (cardExpiryDetails.Length == 2)
            {
                creditCard.ExpMonth = Int32.Parse(cardExpiryDetails[0]);
                creditCard.ExpYear  = Int32.Parse(cardExpiryDetails[1]);
            }

            requestDetails.PaymentDetails = new PaymentDetailsType();
            AddressType billingAddr = new AddressType();

            if (firstName.Value != "" && lastName.Value != "" &&
                street1.Value != "" && country.Value != "")
            {
                billingAddr.Name            = payerName.Value;
                billingAddr.Street1         = street1.Value;
                billingAddr.Street2         = street2.Value;
                billingAddr.CityName        = city.Value;
                billingAddr.StateOrProvince = state.Value;
                billingAddr.Country         = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), country.Value);
                billingAddr.PostalCode      = postalCode.Value;

                //Fix for release
                billingAddr.Phone = phone.Value;

                payer.Address = billingAddr;
            }

            // Populate payment requestDetails
            CurrencyCodeType currency = (CurrencyCodeType)
                                        Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue);
            BasicAmountType paymentAmount = new BasicAmountType(currency, amount.Value);

            requestDetails.PaymentDetails.OrderTotal = paymentAmount;


            // Invoke the API
            DoDirectPaymentReq wrapper = new DoDirectPaymentReq();

            wrapper.DoDirectPaymentRequest = request;
            PayPalAPIInterfaceServiceService service  = new PayPalAPIInterfaceServiceService();
            DoDirectPaymentResponseType      response = service.DoDirectPayment(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, response);
        }
예제 #24
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            // Create request object
            DoDirectPaymentRequestType        request        = new DoDirectPaymentRequestType();
            DoDirectPaymentRequestDetailsType requestDetails = new DoDirectPaymentRequestDetailsType();

            request.DoDirectPaymentRequestDetails = requestDetails;

            // (Optional) How you want to obtain payment. It is one of the following values:
            // * Authorization – This payment is a basic authorization subject to settlement with PayPal Authorization and Capture.
            // * Sale – This is a final sale for which you are requesting payment (default).
            // Note: Order is not allowed for Direct Payment.
            requestDetails.PaymentAction = (PaymentActionCodeType)
                                           Enum.Parse(typeof(PaymentActionCodeType), paymentType.SelectedValue);

            // (Required) Information about the credit card to be charged.
            CreditCardDetailsType creditCard = new CreditCardDetailsType();

            requestDetails.CreditCard = creditCard;
            PayerInfoType payer = new PayerInfoType();
            // (Optional) First and last name of buyer.
            PersonNameType name = new PersonNameType();

            name.FirstName  = firstName.Value;
            name.LastName   = lastName.Value;
            payer.PayerName = name;
            // (Required) Details about the owner of the credit card.
            creditCard.CardOwner = payer;

            // (Required) Credit card number.
            creditCard.CreditCardNumber = creditCardNumber.Value;
            // (Optional) Type of credit card. For UK, only Maestro, MasterCard, Discover, and Visa are allowable. For Canada, only MasterCard and Visa are allowable and Interac debit cards are not supported. It is one of the following values:
            // * Visa
            // * MasterCard
            // * Discover
            // * Amex
            // * Maestro: See note.
            // Note: If the credit card type is Maestro, you must set currencyId to GBP. In addition, you must specify either StartMonth and StartYear or IssueNumber.
            creditCard.CreditCardType = (CreditCardTypeType)
                                        Enum.Parse(typeof(CreditCardTypeType), creditCardType.SelectedValue);
            // Card Verification Value, version 2. Your Merchant Account settings determine whether this field is required. To comply with credit card processing regulations, you must not store this value after a transaction has been completed.
            // Character length and limitations: For Visa, MasterCard, and Discover, the value is exactly 3 digits. For American Express, the value is exactly 4 digits.
            creditCard.CVV2 = cvv2Number.Value;
            string[] cardExpiryDetails = cardExpiryDate.Text.Split(new char[] { '/' });
            if (cardExpiryDetails.Length == 2)
            {
                // (Required) Credit card expiration month.
                creditCard.ExpMonth = Convert.ToInt32(cardExpiryDetails[0]);
                // (Required) Credit card expiration year.
                creditCard.ExpYear = Convert.ToInt32(cardExpiryDetails[1]);
            }

            requestDetails.PaymentDetails = new PaymentDetailsType();
            // (Optional) Your URL for receiving Instant Payment Notification (IPN) about this transaction. If you do not specify this value in the request, the notification URL from your Merchant Profile is used, if one exists.
            // Important: The notify URL applies only to DoExpressCheckoutPayment. This value is ignored when set in SetExpressCheckout or GetExpressCheckoutDetails.
            requestDetails.PaymentDetails.NotifyURL = ipnNotificationUrl.Value.Trim();

            // (Optional) Buyer's shipping address information.
            AddressType billingAddr = new AddressType();

            if (firstName.Value != string.Empty && lastName.Value != string.Empty &&
                street1.Value != string.Empty && country.Value != string.Empty)
            {
                billingAddr.Name = payerName.Value;
                // (Required) First street address.
                billingAddr.Street1 = street1.Value;
                // (Optional) Second street address.
                billingAddr.Street2 = street2.Value;
                // (Required) Name of city.
                billingAddr.CityName = city.Value;
                // (Required) State or province.
                billingAddr.StateOrProvince = state.Value;
                // (Required) Country code.
                billingAddr.Country = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), country.Value);
                // (Required) U.S. ZIP code or other country-specific postal code.
                billingAddr.PostalCode = postalCode.Value;

                // (Optional) Phone number.
                billingAddr.Phone = phone.Value;

                payer.Address = billingAddr;
            }

            // (Required) The total cost of the transaction to the buyer. If shipping cost and tax charges are known, include them in this value. If not, this value should be the current subtotal of the order. If the transaction includes one or more one-time purchases, this field must be equal to the sum of the purchases. This field must be set to a value greater than 0.
            // Note: You must set the currencyID attribute to one of the 3-character currency codes for any of the supported PayPal currencies.
            CurrencyCodeType currency = (CurrencyCodeType)
                                        Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue);
            BasicAmountType paymentAmount = new BasicAmountType(currency, amount.Value);

            requestDetails.PaymentDetails.OrderTotal = paymentAmount;

            // Invoke the API
            DoDirectPaymentReq wrapper = new DoDirectPaymentReq();

            wrapper.DoDirectPaymentRequest = request;

            // Configuration map containing signature credentials and other required configuration.
            // For a full list of configuration parameters refer in wiki page
            // [https://github.com/paypal/sdk-core-dotnet/wiki/SDK-Configuration-Parameters]
            Dictionary <string, string> configurationMap = Configuration.GetAcctAndConfig();

            // Create the PayPalAPIInterfaceServiceService service object to make the API call
            PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService(configurationMap);

            // # API call
            // Invoke the DoDirectPayment method in service wrapper object
            DoDirectPaymentResponseType response = service.DoDirectPayment(wrapper);

            // Check for API return status
            setKeyResponseObjects(service, response);
        }
예제 #25
0
 public AccessesTypeAccess()
 {
     this._accessComment = new FreeTextType();
     this._accessPerson  = new PersonNameType();
 }
예제 #26
0
        public static PersonNameType GetPersonNameForProvider(Provider prov)
        {
            //No need to check RemotingRole; no call to db.
            PersonNameType personName = new PersonNameType();

            personName.last   = prov.LName.Trim(); //Cannot be blank.
            personName.first  = prov.FName.Trim(); //Cannot be blank.
            personName.middle = prov.MI;           //May be blank.
            if (prov.Suffix != "")
            {
                personName.suffixSpecified = true;
                personName.suffix          = PersonNameSuffix.DDS;
                string[] suffixes = prov.Suffix.ToUpper().Split(' ', '.');
                for (int i = 0; i < suffixes.Length; i++)
                {
                    if (suffixes[i] == "ABOC")
                    {
                        personName.suffix = PersonNameSuffix.ABOC;
                        break;
                    }
                    else if (suffixes[i] == "ANP")
                    {
                        personName.suffix = PersonNameSuffix.ANP;
                        break;
                    }
                    else if (suffixes[i] == "APRN")
                    {
                        personName.suffix = PersonNameSuffix.APRN;
                        break;
                    }
                    else if (suffixes[i] == "ARNP")
                    {
                        personName.suffix = PersonNameSuffix.ARNP;
                        break;
                    }
                    else if (suffixes[i] == "CNM")
                    {
                        personName.suffix = PersonNameSuffix.CNM;
                        break;
                    }
                    else if (suffixes[i] == "CNP")
                    {
                        personName.suffix = PersonNameSuffix.CNP;
                        break;
                    }
                    else if (suffixes[i] == "CNS")
                    {
                        personName.suffix = PersonNameSuffix.CNS;
                        break;
                    }
                    else if (suffixes[i] == "CRNP")
                    {
                        personName.suffix = PersonNameSuffix.CRNP;
                        break;
                    }
                    else if (suffixes[i] == "DDS")
                    {
                        personName.suffix = PersonNameSuffix.DDS;
                        break;
                    }
                    else if (suffixes[i] == "DMD")
                    {
                        personName.suffix = PersonNameSuffix.DMD;
                        break;
                    }
                    else if (suffixes[i] == "DO")
                    {
                        personName.suffix = PersonNameSuffix.DO;
                        break;
                    }
                    else if (suffixes[i] == "DPM")
                    {
                        personName.suffix = PersonNameSuffix.DPM;
                        break;
                    }
                    else if (suffixes[i] == "ESQ")                   //ESQ or Esq
                    {
                        personName.suffix = PersonNameSuffix.ESQ;
                        break;
                    }
                    else if (suffixes[i] == "ESQ1")                   //ESQ1 or Esq1
                    {
                        personName.suffix = PersonNameSuffix.ESQ1;
                        break;
                    }
                    else if (suffixes[i] == "FACC")
                    {
                        personName.suffix = PersonNameSuffix.FACC;
                        break;
                    }
                    else if (suffixes[i] == "FACP")
                    {
                        personName.suffix = PersonNameSuffix.FACP;
                        break;
                    }
                    else if (suffixes[i] == "FNP")
                    {
                        personName.suffix = PersonNameSuffix.FNP;
                        break;
                    }
                    else if (suffixes[i] == "GNP")
                    {
                        personName.suffix = PersonNameSuffix.GNP;
                        break;
                    }
                    else if (suffixes[i] == "I")
                    {
                        personName.suffix = PersonNameSuffix.I;
                        break;
                    }
                    else if (suffixes[i] == "II")
                    {
                        personName.suffix = PersonNameSuffix.II;
                        break;
                    }
                    else if (suffixes[i] == "III")
                    {
                        personName.suffix = PersonNameSuffix.III;
                        break;
                    }
                    else if (suffixes[i] == "IV")
                    {
                        personName.suffix = PersonNameSuffix.IV;
                        break;
                    }
                    else if (suffixes[i] == "JR")                   //JR or jr
                    {
                        personName.suffix = PersonNameSuffix.Jr;
                        break;
                    }
                    else if (suffixes[i] == "JR1")                   //JR1 or jr1
                    {
                        personName.suffix = PersonNameSuffix.Jr;
                        break;
                    }
                    else if (suffixes[i] == "LPN")
                    {
                        personName.suffix = PersonNameSuffix.LPN;
                        break;
                    }
                    else if (suffixes[i] == "LVN")
                    {
                        personName.suffix = PersonNameSuffix.LVN;
                        break;
                    }
                    else if (suffixes[i] == "MA")
                    {
                        personName.suffix = PersonNameSuffix.MA;
                        break;
                    }
                    else if (suffixes[i] == "MD")
                    {
                        personName.suffix = PersonNameSuffix.MD;
                        break;
                    }
                    else if (suffixes[i] == "NB")
                    {
                        personName.suffix = PersonNameSuffix.NB;
                        break;
                    }
                    else if (suffixes[i] == "ND")
                    {
                        personName.suffix = PersonNameSuffix.ND;
                        break;
                    }
                    else if (suffixes[i] == "NP")
                    {
                        personName.suffix = PersonNameSuffix.NP;
                        break;
                    }
                    else if (suffixes[i] == "OD")
                    {
                        personName.suffix = PersonNameSuffix.OD;
                        break;
                    }
                    else if (suffixes[i] == "PA")
                    {
                        personName.suffix = PersonNameSuffix.PA;
                        break;
                    }
                    else if (suffixes[i] == "PAC")
                    {
                        personName.suffix = PersonNameSuffix.PAC;
                        break;
                    }
                    else if (suffixes[i] == "PHARMD")                   //PARMD or PharmD
                    {
                        personName.suffix = PersonNameSuffix.PharmD;
                        break;
                    }
                    else if (suffixes[i] == "PHD")                   //PHD or PhD
                    {
                        personName.suffix = PersonNameSuffix.PhD;
                        break;
                    }
                    else if (suffixes[i] == "PNP")
                    {
                        personName.suffix = PersonNameSuffix.PNP;
                        break;
                    }
                    else if (suffixes[i] == "RD")
                    {
                        personName.suffix = PersonNameSuffix.RD;
                        break;
                    }
                    else if (suffixes[i] == "RN")
                    {
                        personName.suffix = PersonNameSuffix.RN;
                        break;
                    }
                    else if (suffixes[i] == "RPAC")
                    {
                        personName.suffix = PersonNameSuffix.RPAC;
                        break;
                    }
                    else if (suffixes[i] == "RPH")                   //RPH or RPh
                    {
                        personName.suffix = PersonNameSuffix.RPh;
                        break;
                    }
                    else if (suffixes[i] == "SR")                   //SR or Sr
                    {
                        personName.suffix = PersonNameSuffix.Sr;
                        break;
                    }
                    else if (suffixes[i] == "SR1")                   //SR1 or Sr1
                    {
                        personName.suffix = PersonNameSuffix.Sr1;
                        break;
                    }
                    else if (suffixes[i] == "V")
                    {
                        personName.suffix = PersonNameSuffix.V;
                        break;
                    }
                    else if (suffixes[i] == "VI")
                    {
                        personName.suffix = PersonNameSuffix.VI;
                        break;
                    }
                }
            }
            return(personName);
        }
예제 #27
0
 public InsuranceType()
 {
     this._underwriter      = new CompanyNameType();
     this._insuranceCompany = new CompanyNameType();
     this._insuredName      = new PersonNameType();
 }
예제 #28
0
 public AmenityOptionType()
 {
     this._message    = new ParagraphType();
     this._originator = new PersonNameType();
 }
예제 #29
0
        // ProcessCard() is used for Credit Card processing via Website Payments Pro,
        // just like other credit card gateways.
        // ProcessPaypal() is used for Express Checkout and PayPal payments.
        public override string ProcessCard(int OrderNumber, int CustomerID, decimal OrderTotal, bool useLiveTransactions, TransactionModeEnum TransactionMode, Address UseBillingAddress, string CardExtraCode, Address UseShippingAddress, string CAVV, string ECI, string XID, out string AVSResult, out string AuthorizationResult, out string AuthorizationCode, out string AuthorizationTransID, out string TransactionCommandOut, out string TransactionResponse)
        {
            String result = AppLogic.ro_OK;

            AuthorizationCode     = String.Empty;
            AuthorizationResult   = String.Empty;
            AuthorizationTransID  = String.Empty;
            AVSResult             = String.Empty;
            TransactionCommandOut = String.Empty;
            TransactionResponse   = String.Empty;
            try
            {
                // the request details object contains all payment details
                DoDirectPaymentRequestDetailsType RequestDetails = new DoDirectPaymentRequestDetailsType();

                // define the payment action to 'Sale'
                // (another option is 'Authorization', which would be followed later with a DoCapture API call)
                RequestDetails.PaymentAction = (PaymentActionCodeType)CommonLogic.IIF(AppLogic.TransactionModeIsAuthOnly(), (int)PaymentActionCodeType.Authorization, (int)PaymentActionCodeType.Sale);

                // define the total amount and currency for the transaction
                PaymentDetailsType PaymentDetails = new PaymentDetailsType();

                BasicAmountType totalAmount = new BasicAmountType();
                totalAmount.Value               = Localization.CurrencyStringForGatewayWithoutExchangeRate(OrderTotal);
                totalAmount.currencyID          = (CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), AppLogic.AppConfig("Localization.StoreCurrency"), true);
                PaymentDetails.OrderTotal       = totalAmount;
                PaymentDetails.InvoiceID        = OrderNumber.ToString();
                PaymentDetails.ButtonSource     = PayPal.BN + "_DP_US";
                PaymentDetails.OrderDescription = AppLogic.AppConfig("StoreName");

                // define the credit card to be used

                CreditCardDetailsType creditCard = new CreditCardDetailsType();
                creditCard.CreditCardNumber  = UseBillingAddress.CardNumber;
                creditCard.ExpMonth          = Localization.ParseUSInt(UseBillingAddress.CardExpirationMonth);
                creditCard.ExpYear           = Localization.ParseUSInt(UseBillingAddress.CardExpirationYear);
                creditCard.ExpMonthSpecified = true;
                creditCard.ExpYearSpecified  = true;
                creditCard.CVV2 = CardExtraCode;

                if (UseBillingAddress.CardType == "AmericanExpress")
                {
                    creditCard.CreditCardType = (CreditCardTypeType)Enum.Parse(typeof(CreditCardTypeType), "Amex", true);
                }
                else
                {
                    creditCard.CreditCardType = (CreditCardTypeType)Enum.Parse(typeof(CreditCardTypeType), UseBillingAddress.CardType, true);
                }
                creditCard.CreditCardTypeSpecified = true;

                PayerInfoType  cardHolder      = new PayerInfoType();
                PersonNameType oPersonNameType = new PersonNameType();
                oPersonNameType.FirstName  = UseBillingAddress.FirstName;
                oPersonNameType.LastName   = UseBillingAddress.LastName;
                oPersonNameType.MiddleName = String.Empty;
                oPersonNameType.Salutation = String.Empty;
                oPersonNameType.Suffix     = String.Empty;
                cardHolder.PayerName       = oPersonNameType;

                AddressType PayerAddress = new AddressType();
                PayerAddress.Street1          = UseBillingAddress.Address1;
                PayerAddress.CityName         = UseBillingAddress.City;
                PayerAddress.StateOrProvince  = UseBillingAddress.State;
                PayerAddress.PostalCode       = UseBillingAddress.Zip;
                PayerAddress.Country          = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), AppLogic.GetCountryTwoLetterISOCode(UseBillingAddress.Country), true);
                PayerAddress.CountrySpecified = true;

                if (UseShippingAddress != null)
                {
                    AddressType shippingAddress = new AddressType();
                    shippingAddress.Name             = (UseShippingAddress.FirstName + " " + UseShippingAddress.LastName).Trim();
                    shippingAddress.Street1          = UseShippingAddress.Address1;
                    shippingAddress.Street2          = UseShippingAddress.Address2 + CommonLogic.IIF(UseShippingAddress.Suite != "", " Ste " + UseShippingAddress.Suite, "");
                    shippingAddress.CityName         = UseShippingAddress.City;
                    shippingAddress.StateOrProvince  = UseShippingAddress.State;
                    shippingAddress.PostalCode       = UseShippingAddress.Zip;
                    shippingAddress.Country          = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), AppLogic.GetCountryTwoLetterISOCode(UseShippingAddress.Country), true);
                    shippingAddress.CountrySpecified = true;
                    PaymentDetails.ShipToAddress     = shippingAddress;
                }

                cardHolder.Address   = PayerAddress;
                creditCard.CardOwner = cardHolder;

                RequestDetails.CreditCard     = creditCard;
                RequestDetails.PaymentDetails = PaymentDetails;
                RequestDetails.IPAddress      = CommonLogic.CustomerIpAddress();            // cart.ThisCustomer.LastIPAddress;

                if (RequestDetails.IPAddress == "::1")
                {
                    RequestDetails.IPAddress = "127.0.0.1";
                }

                // instantiate the actual request object
                PaymentRequest         = new DoDirectPaymentRequestType();
                PaymentRequest.Version = API_VER;
                PaymentRequest.DoDirectPaymentRequestDetails = RequestDetails;
                DDPReq = new DoDirectPaymentReq();
                DDPReq.DoDirectPaymentRequest = PaymentRequest;

                DoDirectPaymentResponseType responseDetails = (DoDirectPaymentResponseType)IPayPal.DoDirectPayment(DDPReq);

                //if (LogToErrorTable)
                //{
                //    PayPalController.Log(XmlCommon.SerializeObject(DDPReq, DDPReq.GetType()), "DoDirectPayment Request");
                //    PayPalController.Log(XmlCommon.SerializeObject(responseDetails, responseDetails.GetType()), "DoDirectPayment Response");
                //}

                if (responseDetails != null && responseDetails.Ack.ToString().StartsWith("success", StringComparison.InvariantCultureIgnoreCase))
                {
                    AuthorizationTransID = CommonLogic.IIF(TransactionMode.ToString().ToLower() == AppLogic.ro_TXModeAuthOnly.ToLower(), "AUTH=", "CAPTURE=") + responseDetails.TransactionID.ToString();
                    AuthorizationCode    = responseDetails.CorrelationID;
                    AVSResult            = responseDetails.AVSCode;
                    result = AppLogic.ro_OK;
                    AuthorizationResult = responseDetails.Ack.ToString() + "|AVSCode=" + responseDetails.AVSCode.ToString() + "|CVV2Code=" + responseDetails.CVV2Code.ToString();
                }
                else
                {
                    if (responseDetails.Errors != null)
                    {
                        String Separator = String.Empty;
                        for (int ix = 0; ix < responseDetails.Errors.Length; ix++)
                        {
                            AuthorizationResult += Separator;
                            AuthorizationResult += responseDetails.Errors[ix].LongMessage;                            // record failed TX
                            TransactionResponse += Separator;
                            try
                            {
                                TransactionResponse += String.Format("|{0},{1},{2}|", responseDetails.Errors[ix].ShortMessage, responseDetails.Errors[ix].ErrorCode, responseDetails.Errors[ix].LongMessage);                                 // record failed TX
                            }
                            catch { }
                            Separator = ", ";
                        }
                    }
                    result = AuthorizationResult;
                    // just store something here, as there is no other way to get data out of this gateway about the failure for logging in failed transaction table
                }
            }
            catch
            {
                result = "Transaction Failed";
            }
            return(result);
        }
예제 #30
0
 public CustomerTypeAddress()
 {
     this._addresseeName = new PersonNameType();
     this._companyName   = new CompanyNameType();
 }