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

Methods

ClearCache()

Clears cached payments.
public void ClearCache()

ClearCache(LanguageBasedKey<string>)

[Obsolete("Is not used anymore")]
public void ClearCache(LanguageBasedKey<string> key)

Parameters

key LanguageBasedKey<string>

ClearCache(IEnumerable<LanguageBasedKey<string>>)

[Obsolete("Is not used anymore")]
public void ClearCache(IEnumerable<LanguageBasedKey<string>> keys)

Parameters

keys IEnumerable<LanguageBasedKey<string>>

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 Payment Clone(Payment payment)

Parameters

payment Payment

Returns

Payment

Examples

class MyPage : System.Web.UI.Page
{
private Payment payment;
public void DoSave()
{
Payment thePayment = new Payment();
thePayment = Services.Payments.Clone(payment);
thePayment.ID = string.Empty;
thePayment.Save(thePayment.ID);
}
}

CopyPayment(string)

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

Parameters

paymentId string
The id of the payment to copy.

Delete(string)

Deletes the payment with specified ID.
public void Delete(string paymentId)

Parameters

paymentId string
The payment ID.

Delete(string, string)

Deletes the payment with specified ID and language
[Obsolete("Use Delete(String) instead")]
public void Delete(string paymentId, string languageId)

Parameters

paymentId string
The payment ID.
languageId string
The language id.

DeleteByLanguage(string)

Deletes translations by language.
public void DeleteByLanguage(string languageId)

Parameters

languageId string
The language ID.

GetDefaultPaymentMethod(string, bool)

Gets the default payment method.
public 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

GetDefaultPaymentMethod(string, string)

Gets the default payment method.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public Payment GetDefaultPaymentMethod(string languageId, string countryCode)

Parameters

languageId string
The language id.
countryCode string
The country code.

Returns

Payment

GetDefaultPaymentMethod(string, string, bool)

Gets the default payment method.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public Payment GetDefaultPaymentMethod(string languageId, string countryCode, bool onlyActive)

Parameters

languageId string
The language id.
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 Payment GetPayment(string paymentId)

Parameters

paymentId string

Returns

Payment

GetPayment(string, string)

Gets the payment methods that has relation to any country.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public Payment GetPayment(string paymentId, string languageId)

Parameters

paymentId string
languageId string

Returns

Payment

GetPayment(string, string, string)

Gets the payment methods that has relation to specified country.
public Payment GetPayment(string paymentId, string countryCode, string regionCode)

Parameters

paymentId string
countryCode string
regionCode string

Returns

Payment

GetPayment(string, string, string, string)

Gets the payment methods that has relation to specified country.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public Payment GetPayment(string paymentId, string languageId, string countryCode, string regionCode)

Parameters

paymentId string
languageId string
countryCode string
regionCode string

Returns

Payment

GetPaymentMethodsForUser(User, string, string)

Gets the active payment methods with the suitable country code and region code for the user.
public 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.

GetPaymentMethodsForUser(User, string, string, string)

Gets the active payment methods with the suitable country code and region code for the user.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPaymentMethodsForUser(User user, string languageId, string countryCode, string regionCode)

Parameters

user User
The User. Use null for anonymous user.
languageId string
The language id.
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 IEnumerable<Payment> GetPayments()

Returns

IEnumerable<Payment>

GetPayments(string)

Gets the payment methods with country relations.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPayments(string languageId)

Parameters

languageId string
The language id.

Returns

IEnumerable<Payment>

GetPayments(string, string)

Gets the payment methods with the suitable country code.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPayments(string languageId, string countryCode)

Parameters

languageId string
The language id.
countryCode string
The country code.

Returns

IEnumerable<Payment>

GetPayments(string, string, bool)

Gets the payment methods with the suitable country code AND region code.
public 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>

GetPayments(string, string, string)

Gets the payment methods with the suitable country code AND region code.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPayments(string languageId, string countryCode, string regionCode)

Parameters

languageId string
The language id.
countryCode string
The country code.
regionCode string
The region/state code.

Returns

IEnumerable<Payment>

GetPayments(string, string, string, bool)

Gets the payment methods with the suitable country code AND region code.
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPayments(string languageId, string countryCode, string regionCode, bool onlyActive)

Parameters

languageId string
The language id.
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 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>

GetPaymentsWithoutRegions(string)

Gets all payment methods
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPaymentsWithoutRegions(string languageId)

Parameters

languageId string
The language id.

Returns

IEnumerable<Payment>

GetPaymentsWithoutRegions(string, bool)

Gets all payment methods
[Obsolete("Use the overload without languageId and then use Translations on the payment.")]
public IEnumerable<Payment> GetPaymentsWithoutRegions(string languageId, bool onlyActive)

Parameters

languageId string
The language id.
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 void Save(Payment payment)

Parameters

payment Payment
The payment.
To top