protected PaySession(PaySystem paySystem, ConnectionParameters cParams, IPaySessionContext context = null) { if (paySystem == null || cParams == null) { throw new PaymentException(StringConsts.ARGUMENT_ERROR + this.GetType().Name + ".ctor((paySystem|cParams)=null)"); } PaySystem = paySystem; Context = context ?? PaySystemHost.GetDefaultTransactionContext(); ConnectionParameters = cParams; lock (PaySystem.Sessions) PaySystem.Sessions.Add(this); }
public BraintreeSession(BraintreeSystem system, BraintreeConnectionParameters cParams, IPaySessionContext context = null) : base(system, cParams, context) { }
protected override PaySession DoStartSession(ConnectionParameters cParams, IPaySessionContext context = null) { return(new PayPalSession(this, (PayPalConnectionParameters)cParams, context)); }
protected override PaySession DoStartSession(ConnectionParameters cParams, IPaySessionContext context = null) { return(new BraintreeSession(this, (BraintreeConnectionParameters)cParams, context)); }
public bool Refund(decimal?amount = null, string description = null, object extraData = null, ConnectionParameters cParams = null, IPaySessionContext context = null) { using (var session = PaySystem.StartSession(cParams, context)) return(session.Refund(this, amount, description, extraData)); }
public bool Void(string description = null, object extraData = null, ConnectionParameters cParams = null, IPaySessionContext context = null) { using (var session = PaySystem.StartSession(cParams, context)) return(session.Void(this, description, extraData)); }
public bool Refresh(ConnectionParameters cParams = null, IPaySessionContext context = null) { using (var session = PaySystem.StartSession(cParams, context)) return(session.Refresh(this)); }
protected abstract PaySession DoStartSession(ConnectionParameters cParams, IPaySessionContext context = null);
/// <summary> /// Starts new pay session of system-specific type /// </summary> public PaySession StartSession(ConnectionParameters cParams = null, IPaySessionContext context = null) { return(DoStartSession(cParams ?? DefaultSessionConnectParams, context)); }
public StripeSession(PaySystem paySystem, StripeConnectionParameters cParams, IPaySessionContext context = null) : base(paySystem, cParams, context) { }
public MockSession(PaySystem paySystem, MockConnectionParameters cParams, IPaySessionContext context = null) : base(paySystem, cParams, context) { }
public PayPalSession(PayPalSystem paySystem, PayPalConnectionParameters cParams, IPaySessionContext context = null) : base(paySystem, cParams, context) { }