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
Methods
ClearCache()
Clears cached payments.
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
keysIEnumerable<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
keystringKey to reset
Clone(Payment)
Clones this instance.
public Payment Clone(Payment payment)
Parameters
paymentPayment
Returns
CopyPayment(string)
Copies the payment, fees and country relations based on the paymentId, appending "(Copy)" to the name.
public void CopyPayment(string paymentId)
Parameters
paymentIdstringThe id of the payment to copy.
Delete(string)
Deletes the payment with specified ID.
public void Delete(string paymentId)
Parameters
paymentIdstringThe payment ID.
DeleteByLanguage(string)
Deletes translations by language.
public void DeleteByLanguage(string languageId)
Parameters
languageIdstringThe language ID.
GetDefaultPaymentMethod(string, bool)
Gets the default payment method.
public Payment GetDefaultPaymentMethod(string countryCode, bool onlyActive)
Parameters
countryCodestringThe country code.
onlyActiveboolIf set to
true, only active payment methods will be included to the result, otherwise inactive will be also included.
Returns
GetPayment(string)
Gets the payment methods that has relation to any country.
public Payment GetPayment(string paymentId)
Parameters
paymentIdstring
Returns
GetPayment(string, string, string)
Gets the payment methods that has relation to specified country.
public Payment GetPayment(string paymentId, string countryCode, string regionCode)
Parameters
Returns
GetPaymentMethodsForUser(User, IEnumerable<Payment>)
Gets the active payment methods the user has access to in the list of payments provided.
public IEnumerable<Payment> GetPaymentMethodsForUser(User user, IEnumerable<Payment> payments)
Parameters
userUserThe User. Use null for anonymous user.
paymentsIEnumerable<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 IEnumerable<Payment> GetPaymentMethodsForUser(User user, string countryCode, string regionCode)
Parameters
userUserThe User. Use null for anonymous user.
countryCodestringThe country code.
regionCodestringThe region/state code.
Returns
- IEnumerable<Payment>
A collection of payment methods.
GetPayments()
Gets the payment methods with country relations.
public IEnumerable<Payment> GetPayments()
Returns
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
countryCodestringThe country code.
regionCodestringThe region/state code.
onlyActiveboolIf set to
true, only active payment methods will be included to the result, otherwise inactive will be also included.
Returns
GetPaymentsWithoutRegions(bool)
Gets all payment methods
public IEnumerable<Payment> GetPaymentsWithoutRegions(bool onlyActive)
Parameters
onlyActiveboolIf set to
true, only active payment methods will be included to the result, otherwise inactive will be also included.
Returns
Save(Payment)
Saves payment.
public void Save(Payment payment)
Parameters
paymentPaymentThe payment.