Class PaySystem
Base class for IPaySystemImplementation implementation.
Instances of descendants of this class is typically created and configured in PaySystemStarter class.
Then particular pay system can be obtained from PaySystem.Instances[PAY_SYSTEM_NAME] indexer
Inheritance
System.Object
PaySystem
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.Web.dll
Syntax
public abstract class PaySystem : ServiceWithInstrumentationBase<object>, IApplicationComponent, IDisposable, IService, ILocalizedTimeProvider, IWebClientCaller, IPaySystemImplementation, IPaySystem, INamed, IConfigurable, IInstrumentable, IExternallyParameterized
Constructors
PaySystem(String, IConfigSectionNode)
Declaration
protected PaySystem(string name, IConfigSectionNode node)
Parameters
PaySystem(String, IConfigSectionNode, Object)
Declaration
protected PaySystem(string name, IConfigSectionNode node, object director)
Parameters
Fields
CONFIG_AUTO_START_ATTR
Declaration
public const string CONFIG_AUTO_START_ATTR = "auto-start"
Field Value
Type |
Description |
System.String |
|
CONFIG_CURRENCIES_SECTION
Declaration
public const string CONFIG_CURRENCIES_SECTION = "currencies"
Field Value
Type |
Description |
System.String |
|
CONFIG_CURRENCY_MARKET_SECTION
Declaration
public const string CONFIG_CURRENCY_MARKET_SECTION = "currency-market"
Field Value
Type |
Description |
System.String |
|
CONFIG_FEE_FLAT_ATTR
Declaration
public const string CONFIG_FEE_FLAT_ATTR = "fee-flat"
Field Value
Type |
Description |
System.String |
|
CONFIG_FEE_PCT_ATTR
Declaration
public const string CONFIG_FEE_PCT_ATTR = "fee-pct"
Field Value
Type |
Description |
System.String |
|
CONFIG_FEE_TRAN_TYPE_ATTR
Declaration
public const string CONFIG_FEE_TRAN_TYPE_ATTR = "tran-type"
Field Value
Type |
Description |
System.String |
|
CONFIG_PAY_SYSTEM_HOST_SECTION
Declaration
public const string CONFIG_PAY_SYSTEM_HOST_SECTION = "pay-system-host"
Field Value
Type |
Description |
System.String |
|
CONFIG_PAY_SYSTEM_SECTION
Declaration
public const string CONFIG_PAY_SYSTEM_SECTION = "pay-system"
Field Value
Type |
Description |
System.String |
|
CONFIG_PAYMENT_PROCESSING_SECTION
Declaration
public const string CONFIG_PAYMENT_PROCESSING_SECTION = "payment-processing"
Field Value
Type |
Description |
System.String |
|
Sessions
Declaration
protected readonly List<PaySession> Sessions
Field Value
Type |
Description |
System.Collections.Generic.List<PaySession> |
|
Properties
ChargeFeeKind
Declaration
public virtual ProcessingFeeKind ChargeFeeKind { get; }
Property Value
CurrenciesCfg
Declaration
[Config("currencies")]
public IConfigSectionNode CurrenciesCfg { get; set; }
Property Value
DefaultSessionConnectParams
Declaration
protected ConnectionParameters DefaultSessionConnectParams { get; }
Property Value
DefaultSessionConnectParamsCfg
Declaration
[Config("default-session-connect-params")]
public IConfigSectionNode DefaultSessionConnectParamsCfg { get; set; }
Property Value
Instances
Returns the read-only registry view of payment systems currently activated
Declaration
public static IRegistry<IPaySystem> Instances { get; }
Property Value
InstrumentationEnabled
Implements IInstrumentable
Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"instrumentation", "pay"})]
public override bool InstrumentationEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.InstrumentationEnabled
IsPaySystemHost
Declaration
public static bool IsPaySystemHost { get; }
Property Value
Type |
Description |
System.Boolean |
|
KeepAlive
Declaration
[Config(Default = true)]
public bool KeepAlive { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
LogLevel
Specifies the log level for operations performed by Pay System.
Declaration
[Config(Default = MessageType.Warning)]
[ExternalParameter(new string[]{"pay"})]
public MessageType LogLevel { get; set; }
Property Value
PaySystemHost
Returns process-global pay system host used to resolve accounts and transactions
or throws if host is not set. Check IsPaySystemHost to see if host is set.
This design provides an indirection level between pay systems (like Stripe, PayPal, Bank etc.) and
particular application data store implementation as it decouples system-internal formats of transaction and
account storage from provider-internal data (i.e. PayPal payment token string)
Declaration
public static IPaySystemHost PaySystemHost { get; }
Property Value
Pipelined
Declaration
[Config(Default = true)]
public bool Pipelined { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
SupportedCurrencies
Declaration
public virtual IEnumerable<string> SupportedCurrencies { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
TransferFeeKind
Declaration
public virtual ProcessingFeeKind TransferFeeKind { get; }
Property Value
WebServiceCallTimeoutMs
Declaration
[Config(Default = 20000)]
public int WebServiceCallTimeoutMs { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
WebTerminal
Declaration
public virtual IPayWebTerminal WebTerminal { get; }
Property Value
Methods
___SetPaySystemHost(IPaySystemHostImplementation)
Sets process-global pay system host used to resolve accounts and transactions.
If PayStarter is used then the host may be auto-injected from configuration if it is there.
Developers: Do not call this method as it is used for dependency injection from system code
Declaration
public static void ___SetPaySystemHost(IPaySystemHostImplementation host)
Parameters
AutoStartSystems()
Automatically starts systems designated in config with auto-start attribute
Declaration
public static void AutoStartSystems()
Destructor()
Declaration
protected override void Destructor()
Overrides
DoAcceptManagerVisit(Object, DateTime)
Declaration
protected override void DoAcceptManagerVisit(object manager, DateTime managerNow)
Parameters
Type |
Name |
Description |
System.Object |
manager |
|
System.DateTime |
managerNow |
|
Overrides
DoCapture(PaySession, Transaction, Nullable<Decimal>, String, Object)
Declaration
protected abstract bool DoCapture(PaySession session, Transaction charge, decimal ? amount = default (decimal ? ), string description = null, object extraData = null)
Parameters
Type |
Name |
Description |
PaySession |
session |
|
Transaction |
charge |
|
System.Nullable<System.Decimal> |
amount |
|
System.String |
description |
|
System.Object |
extraData |
|
Returns
Type |
Description |
System.Boolean |
|
DoCharge(PaySession, Account, Account, Amount, Boolean, String, Object)
Declaration
protected abstract Transaction DoCharge(PaySession session, Account from, Account to, Amount amount, bool capture = true, string description = null, object extraData = null)
Parameters
Type |
Name |
Description |
PaySession |
session |
|
Account |
from |
|
Account |
to |
|
Amount |
amount |
|
System.Boolean |
capture |
|
System.String |
description |
|
System.Object |
extraData |
|
Returns
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoRefresh(PaySession, Transaction, Object)
Declaration
protected virtual bool DoRefresh(PaySession session, Transaction transaction, object extraData = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
DoRefund(PaySession, Transaction, Nullable<Decimal>, String, Object)
Declaration
protected abstract bool DoRefund(PaySession session, Transaction charge, decimal ? amount = default (decimal ? ), string description = null, object extraData = null)
Parameters
Type |
Name |
Description |
PaySession |
session |
|
Transaction |
charge |
|
System.Nullable<System.Decimal> |
amount |
|
System.String |
description |
|
System.Object |
extraData |
|
Returns
Type |
Description |
System.Boolean |
|
DoStart()
Declaration
protected override void DoStart()
Overrides
DoStartSession(ConnectionParameters, IPaySessionContext)
Declaration
protected abstract PaySession DoStartSession(ConnectionParameters cParams, IPaySessionContext context = null)
Parameters
Returns
DoTransfer(PaySession, Account, Account, Amount, String, Object)
Declaration
protected abstract Transaction DoTransfer(PaySession session, Account from, Account to, Amount amount, string description = null, object extraData = null)
Parameters
Returns
DoVerifyPotentialTransaction(PaySession, TransactionType, Account, Account, Amount)
Declaration
protected virtual PaymentException DoVerifyPotentialTransaction(PaySession session, TransactionType type, Account from, Account to, Amount amount)
Parameters
Returns
DoVoid(PaySession, Transaction, String, Object)
Declaration
protected abstract bool DoVoid(PaySession session, Transaction charge, string description = null, object extraData = null)
Parameters
Type |
Name |
Description |
PaySession |
session |
|
Transaction |
charge |
|
System.String |
description |
|
System.Object |
extraData |
|
Returns
Type |
Description |
System.Boolean |
|
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
IsTransactionTypeSupported(TransactionType, String)
Declaration
public virtual bool IsTransactionTypeSupported(TransactionType type, string currencyISO = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Log(MessageType, String, String, Exception, Nullable<Guid>, String)
Declaration
protected Guid Log(MessageType type, string from, string message, Exception error = null, Guid? relatedMessageID = default (Guid? ), string parameters = null)
Parameters
Type |
Name |
Description |
MessageType |
type |
|
System.String |
from |
|
System.String |
message |
|
System.Exception |
error |
|
System.Nullable<System.Guid> |
relatedMessageID |
|
System.String |
parameters |
|
Returns
Type |
Description |
System.Guid |
|
Make<TPaySystem>(String, IConfigSectionNode)
Declaration
public static TPaySystem Make<TPaySystem>(string name, IConfigSectionNode node)where TPaySystem : PaySystem
Parameters
Returns
Type |
Description |
TPaySystem |
|
Type Parameters
Name |
Description |
TPaySystem |
|
Make<TPaySystem>(String, String, String)
Declaration
public static TPaySystem Make<TPaySystem>(string name, string cfgStr, string format = "laconf")where TPaySystem : PaySystem
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
cfgStr |
|
System.String |
format |
|
Returns
Type |
Description |
TPaySystem |
|
Type Parameters
Name |
Description |
TPaySystem |
|
MakeDefaultSessionConnectParams(IConfigSectionNode)
Declaration
protected abstract ConnectionParameters MakeDefaultSessionConnectParams(IConfigSectionNode paramsSection)
Parameters
Returns
StartSession(ConnectionParameters, IPaySessionContext)
Starts new pay session of system-specific type
Declaration
public PaySession StartSession(ConnectionParameters cParams = null, IPaySessionContext context = null)
Parameters
Returns
StatCapture(Transaction, Nullable<Decimal>)
Declaration
protected void StatCapture(Transaction charge, decimal ? amount)
Parameters
Type |
Name |
Description |
Transaction |
charge |
|
System.Nullable<System.Decimal> |
amount |
|
StatCaptureError()
Declaration
protected void StatCaptureError()
StatCharge(Amount)
Declaration
protected void StatCharge(Amount amount)
Parameters
Type |
Name |
Description |
Amount |
amount |
|
StatChargeError()
Declaration
protected void StatChargeError()
StatRefund(Transaction, Nullable<Decimal>)
Declaration
protected void StatRefund(Transaction charge, decimal ? amount)
Parameters
Type |
Name |
Description |
Transaction |
charge |
|
System.Nullable<System.Decimal> |
amount |
|
StatRefundError()
Declaration
protected void StatRefundError()
StatTransfer(Amount)
Declaration
protected void StatTransfer(Amount amount)
Parameters
Type |
Name |
Description |
Amount |
amount |
|
StatTransferError()
Declaration
protected void StatTransferError()
StatVoid(Transaction)
Declaration
protected void StatVoid(Transaction charge)
Parameters
StatVoidError()
Declaration
protected void StatVoidError()
Implements
System.IDisposable
Extension Methods