次の方法で共有


Commerce Foundation UserProfile CommerceCreate

This Commerce Server 2009 operation is used to create a new user profile record. This operation also lets you create new addresses or credit cards through related operations.

Syntax

        var createUserProfile = new CommerceCreate<CommerceEntity>("UserProfile");
      

Parameters

Property

Description

EmailAddress

Required. E-mail address for the user.

Password

Password selected by the user.

GeneralInfo.password_question

Password hint for retrieval, if the password is forgotten.

GeneralInfo.password_answer

Corresponding answer for the GeneralInfo.password_question.

AccountStatus

Indicates the initial state of the account, which is either active or requires approval. This corresponds to the AccountStatusSiteTerm value.

Operation Sequence Components

Operation Sequence Component

Description

UserProfileLoader

Loads the user profile from Commerce Server.

UserProfileAddressesProcessor

Creates and adds the addresses to Commerce Server.

UserProfileCreditCardsProcessor

Creates and adds the credit cards to Commerce Server.

UserProfileShippingMethodsProcessor

Creates and adds the shipping method to Commerce Server.

UserProfileCommitter

Creates and adds the user profile to Commerce Server.

UserProfileResponseBuilder

Converts the user profiles of the cached Commerce Server to Commerce Server 2009 user profiles and adds them to the response.

UserProfileAddressResponseBuilder

Converts Commerce Server addresses to Commerce Server 2009 addresses and adds them to the response.

UserProfileCreditCardsResponseBuilder

Converts Commerce Server credit cards to Commerce Server 2009 credit cards and adds them to the response.

UserProfileShippingMethodsResponseBuilder

Converts Commerce Server shipping methods to Commerce Server 2009 shipping methods and adds them to the response.

Related Operation

Description

CommerceCreateRelatedItem<Address>

Creates and adds a new address to the system. At a minimum, you need to specify the following information when creating an address:

PropertyDescription
AddressNameA user friendly name for this address.
Line1The streets address, PO Box, and so on.
StateProvinceCodeThe code for the state or province. For example, ON for Ontario.
ZipPostalCodeThe zip code or postal code.
CountryRegionCodeThe code for the country. For example, CA for Canada.

CommerceCreateRelatedItem<CreditCard>(CreditCards)

Creates and adds a new credit card to the system. At a minimum, you need to specify the following information when creating a credit card profile:

PropertyDescription
CreditCardNumberThe account number for the credit card.
ExpirationMonthThe expiry month for the credit card.
ExpirationYearThe expiry year for the credit card.
CreditCardIdentifierThe last 4 digits of the credit card.
BillingAddressIdThe ID of an address profile to use as a billing address.

CommerceCreateRelationship<Address>(PreferredAddress)

Associates an existing address to a user profile.

CommerceCreateRelationship<CreditCard>(PreferredCreditCard)

Associates an existing credit card to a user profile.

CommerceCreateRelationship<ShippingMethod>(PreferredShippingMethod)

Associates the preferred shipping method to a user profile.

The CreditCard commerce entity contains a relationship to a PaymentMethod. This is required when creating a new credit card. The following table details the related operations on the CreditCard being created as part of this operation.

Related Operation

Description

CommerceCreateRelationship<PaymentMethod>(PaymentMethod)

Associates an existing payment method to the credit card being created.

Return Value

This operation returns a CommerceCreateOperationResponse.

Exceptions

Microsoft Multi-Channel Commerce Foundation may throw the following exception during this operation:

  • FaultException<ItemAlreadyExistsFault>

  • FaultException<GeneralOperationFault>

  • FaultException<ValidationFault>

Remarks

Generally, a UserProfile will be created using the ASP.NET Membership API with the UpmMembershipProvider, not through a CommerceCreate operation.

See Also

Other Resources

Developing with the Commerce Foundation Profiles System

Commerce Foundation User Profile

Commerce Foundation UserProfile CommerceDelete

Commerce Foundation UserProfile CommerceQuery

Commerce Foundation UserProfile CommerceUpdate

CommerceCreate