Table of Contents

Class PaymentService

Namespace
Dynamicweb.Ecommerce.Orders
Assembly
Dynamicweb.Ecommerce.dll
public class PaymentService : ICacheStorage<string, Payment>, ICacheStorage<string>, ICacheStorage
Inheritance
PaymentService
Implements
Inherited Members

Fields

MethodType

public static readonly string MethodType

Field Value

string

Properties

Info

Information about the object cache

public CacheInformation Info { get; }

Property Value

CacheInformation

Methods

ClearCache()

Resets all keys to the default value for objects stored in the object cache

public void ClearCache()

ClearCache(IEnumerable<string>)

Resets the specified keys to the default value for objects stored in the object cache

public void ClearCache(IEnumerable<string> keys)

Parameters

keys IEnumerable<string>

Keys to reset

ClearCache(string)

Resets the specified key to the default value for objects stored in the object cache

public void ClearCache(string key)

Parameters

key string

Key to reset

Clone(Payment)

Clones this instance.

public virtual Payment Clone(Payment payment)

Parameters

payment Payment

Returns

Payment

CopyPayment(string)

Copies the payment, fees and country relations based on the paymentId, appending "(Copy)" to the name.

public virtual void CopyPayment(string paymentId)

Parameters

paymentId string

The id of the payment to copy.

Delete(string)

Deletes the payment with specified ID.

public virtual void Delete(string paymentId)

Parameters

paymentId string

The payment ID.

DeleteByLanguage(string)

Deletes translations by language.

public virtual void DeleteByLanguage(string languageId)

Parameters

languageId string

The language ID.

GetDefaultPaymentMethod(string, bool)

Gets the default payment method.

public virtual Payment GetDefaultPaymentMethod(string countryCode, bool onlyActive)

Parameters

countryCode string

The country code.

onlyActive bool

If set to true, only active payment methods will be included to the result, otherwise inactive will be also included.

Returns

Payment

GetPayment(string)

Gets the payment methods that has relation to any country.

public virtual Payment GetPayment(string paymentId)

Parameters

paymentId string

Returns

Payment

GetPayment(string, string, string)

Gets the payment methods that has relation to specified country.

public virtual Payment GetPayment(string paymentId, string countryCode, string regionCode)

Parameters

paymentId string
countryCode string
regionCode string

Returns

Payment

GetPaymentMethodsForUser(User, IEnumerable<Payment>)

Gets the active payment methods the user has access to in the list of payments provided.

public virtual IEnumerable<Payment> GetPaymentMethodsForUser(User user, IEnumerable<Payment> payments)

Parameters

user User

The User. Use null for anonymous user.

payments IEnumerable<Payment>

The payments to check if the user has access against.

Returns

IEnumerable<Payment>

A collection of payment methods.

GetPaymentMethodsForUser(User, string, string)

Gets the active payment methods with the suitable country code and region code for the user.

public virtual IEnumerable<Payment> GetPaymentMethodsForUser(User user, string countryCode, string regionCode)

Parameters

user User

The User. Use null for anonymous user.

countryCode string

The country code.

regionCode string

The region/state code.

Returns

IEnumerable<Payment>

A collection of payment methods.

GetPayments()

Gets the payment methods with country relations.

public virtual IEnumerable<Payment> GetPayments()

Returns

IEnumerable<Payment>

GetPayments(string, string, bool)

Gets the payment methods with the suitable country code AND region code.

public virtual IEnumerable<Payment> GetPayments(string countryCode, string regionCode, bool onlyActive)

Parameters

countryCode string

The country code.

regionCode string

The region/state code.

onlyActive bool

If set to true, only active payment methods will be included to the result, otherwise inactive will be also included.

Returns

IEnumerable<Payment>

GetPaymentsWithoutRegions(bool)

Gets all payment methods

public virtual IEnumerable<Payment> GetPaymentsWithoutRegions(bool onlyActive)

Parameters

onlyActive bool

If set to true, only active payment methods will be included to the result, otherwise inactive will be also included.

Returns

IEnumerable<Payment>

Save(Payment)

Saves payment.

public virtual void Save(Payment payment)

Parameters

payment Payment

The payment.

SetCacheType<TObjectCache>()

Changes the storage container

public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, Payment>

Type Parameters

TObjectCache
To top