Show / Hide Table of Contents

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
DisposableObject
ApplicationComponent
Service
Service<System.Object>
ServiceWithInstrumentationBase<System.Object>
PaySystem
BraintreeSystem
MockSystem
PaySystemWithStaticFees
StripeSystem
Implements
IApplicationComponent
System.IDisposable
IService
ILocalizedTimeProvider
IWebClientCaller
IPaySystemImplementation
IPaySystem
INamed
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
ServiceWithInstrumentationBase<Object>.ExternalParameters
ServiceWithInstrumentationBase<Object>.ExternalParametersForGroups(String[])
ServiceWithInstrumentationBase<Object>.ExternalGetParameter(String, Object, String[])
ServiceWithInstrumentationBase<Object>.ExternalSetParameter(String, Object, String[])
Service<Object>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoSignalStop()
Service.DoCheckForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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()
Namespace: NFX.Web.Pay
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
Type Name Description
System.String name
IConfigSectionNode node

PaySystem(String, IConfigSectionNode, Object)

Declaration
protected PaySystem(string name, IConfigSectionNode node, object director)
Parameters
Type Name Description
System.String name
IConfigSectionNode node
System.Object director

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
Type Description
ProcessingFeeKind

CurrenciesCfg

Declaration
[Config("currencies")]
public IConfigSectionNode CurrenciesCfg { get; set; }
Property Value
Type Description
IConfigSectionNode

DefaultSessionConnectParams

Declaration
protected ConnectionParameters DefaultSessionConnectParams { get; }
Property Value
Type Description
ConnectionParameters

DefaultSessionConnectParamsCfg

Declaration
[Config("default-session-connect-params")]
public IConfigSectionNode DefaultSessionConnectParamsCfg { get; set; }
Property Value
Type Description
IConfigSectionNode

Instances

Returns the read-only registry view of payment systems currently activated

Declaration
public static IRegistry<IPaySystem> Instances { get; }
Property Value
Type Description
IRegistry<IPaySystem>

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
Type Description
MessageType

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
Type Description
IPaySystemHost

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
Type Description
ProcessingFeeKind

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
Type Description
IPayWebTerminal

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
Type Name Description
IPaySystemHostImplementation host

AutoStartSystems()

Automatically starts systems designated in config with auto-start attribute

Declaration
public static void AutoStartSystems()

Destructor()

Declaration
protected override void Destructor()
Overrides
Service.Destructor()

DoAcceptManagerVisit(Object, DateTime)

Declaration
protected override void DoAcceptManagerVisit(object manager, DateTime managerNow)
Parameters
Type Name Description
System.Object manager
System.DateTime managerNow
Overrides
Service.DoAcceptManagerVisit(Object, DateTime)

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
Type Description
Transaction

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

DoRefresh(PaySession, Transaction, Object)

Declaration
protected virtual bool DoRefresh(PaySession session, Transaction transaction, object extraData = null)
Parameters
Type Name Description
PaySession session
Transaction transaction
System.Object extraData
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
Service.DoStart()

DoStartSession(ConnectionParameters, IPaySessionContext)

Declaration
protected abstract PaySession DoStartSession(ConnectionParameters cParams, IPaySessionContext context = null)
Parameters
Type Name Description
ConnectionParameters cParams
IPaySessionContext context
Returns
Type Description
PaySession

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
Type Name Description
PaySession session
Account from
Account to
Amount amount
System.String description
System.Object extraData
Returns
Type Description
Transaction

DoVerifyPotentialTransaction(PaySession, TransactionType, Account, Account, Amount)

Declaration
protected virtual PaymentException DoVerifyPotentialTransaction(PaySession session, TransactionType type, Account from, Account to, Amount amount)
Parameters
Type Name Description
PaySession session
TransactionType type
Account from
Account to
Amount amount
Returns
Type Description
PaymentException

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
Service.DoWaitForCompleteStop()

IsTransactionTypeSupported(TransactionType, String)

Declaration
public virtual bool IsTransactionTypeSupported(TransactionType type, string currencyISO = null)
Parameters
Type Name Description
TransactionType type
System.String currencyISO
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
Type Name Description
System.String name
IConfigSectionNode node
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
Type Name Description
IConfigSectionNode paramsSection
Returns
Type Description
ConnectionParameters

StartSession(ConnectionParameters, IPaySessionContext)

Starts new pay session of system-specific type

Declaration
public PaySession StartSession(ConnectionParameters cParams = null, IPaySessionContext context = null)
Parameters
Type Name Description
ConnectionParameters cParams
IPaySessionContext context
Returns
Type Description
PaySession

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
Type Name Description
Transaction charge

StatVoidError()

Declaration
protected void StatVoidError()

Implements

IApplicationComponent
System.IDisposable
IService
ILocalizedTimeProvider
IWebClientCaller
IPaySystemImplementation
IPaySystem
INamed
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX