다음을 통해 공유


GetPaymentMethods Method (String)

Returns a list of all configured payment methods for the specified language.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Function GetPaymentMethods ( _
    languageId As String _
) As DataSet
'Usage
Dim instance As OrderContext
Dim languageId As String
Dim returnValue As DataSet

returnValue = instance.GetPaymentMethods(languageId)
public DataSet GetPaymentMethods(
    string languageId
)
public:
DataSet^ GetPaymentMethods(
    String^ languageId
)
public function GetPaymentMethods(
    languageId : String
) : DataSet

Parameters

  • languageId
    Type: System..::.String
    LanguageId for language in which payment is needed.

Return Value

Type: System.Data..::.DataSet
A DataSet containing the payment methods with display names in the specified language.

Remarks

GetPaymentMethods caches payment methods, and returns payment methods from the cache if the payment method cache is configured. GetPaymentMethods queries the database only when the cache is not configured.

The GetPaymentMethods(String) method returns a dataset with a single table that contains one record for each Payment Method that is configured. For each PaymentMethodId object in the table, if a Payment Method is configured whose LanguageId value matches the value that you specify, that Payment Method is added to the dataset. If there is no Payment Method with a matching LanguageId value, the default Payment Method for that PaymentMethodId is added to the dataset.

Payment methods are stored in the database table named PaymentMethod in the transaction configuration database. Seven columns are returned:

  1. PaymentMethodId SQL Data Type: uniqueidentifier

  2. LanguageId SQL Data Type: nvarchar(128)

  3. PaymentMethodName SQL Data Type: nvarchar(255)

  4. Description SQL Data Type: nvarchar(255)

  5. PaymentProcessor SQL Data Type: nvarchar(255)

  6. ConfiguredMode SQL Data Type: nvarchar(255)

  7. PaymentType SQL Data Type: int

For example, assume that the Payment Methods listed in the following table have been configured for your Commerce Server Web application.

PaymentMethodId

LanguageId

PaymentMethodName

IsDefault

Enabled

PM1

en-US

PM1-enUS

True

True

PM1

fr-FR

PM1-frFR

False

True

PM2

fr-FR

PM2-frFR

True

True

PM3

en-US

PM3-enUS

True

True

PM3

de-DE

PM3-deDE

False

True

In your site code, you execute the following code:

DataSet dePaymentMethods = OrderContext.Current.GetPaymentMethods("de-DE");

The dataset dePaymentMethods will contain one table with three records:

  • PM1-enUS. Because there is no Payment Method configured with PaymentMethodId PM1 and LanguageId "de-DE", the default Payment Method for PM1 is included.

  • PM2-frFR. Because there is no Payment Method configured with PaymentMethodId PM2 and LanguageId "de-DE", the default Payment Method for PM2 is included.

  • PM3-deDE. Because there is a Payment Method configured with PaymentMethodId PM3 and LanguageId "de-DE", the Payment Method for PM3 in language de-DE is returned, even though it is not the default.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetPaymentMethods Overload

Microsoft.CommerceServer.Runtime.Orders Namespace