다음을 통해 공유


GetPaymentMethods Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Returns a list of all active payment methods for all languages.

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

Syntax

'Declaration
Public Function GetPaymentMethods As DataSet
'Usage
Dim instance As OrderContext
Dim returnValue As DataSet

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

Return Value

Type: System.Data..::.DataSet
A DataSet containing multiple datatables, one for each language, containing the payment methods that are enabled.

Remarks

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

Payment methods are stored in the database table named PaymentMethod in the transaction configuration database. The query returns the following seven columns:

  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: int

  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

Language ID

PaymentMethodName

IsDefault

Enabled

PM1

en-US

PM1-enUS

True

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 allPaymentMethods = OrderContext.Current.GetPaymentMethods();

The dataset allPaymentMethods will contain three tables:

  • The table named "en-US" will contain records for PM1-enUS and PM3-enUS.

  • Tha table named "fr-FR" will records for PM1-frFR and PM2-frFR.

  • The table named "de-DE" will contain a record for PM3-deDE.

Permissions

See Also

Reference

OrderContext Class

OrderContext Members

GetPaymentMethods Overload

Microsoft.CommerceServer.Runtime.Orders Namespace