/// <summary> /// Initializes a new instance of the <see cref="BraintreeSubscriptionRecordPaymentMethod"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService">The <see cref="IBraintreeApiService"/></param> public BraintreeSubscriptionRecordPaymentMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod) { Mandate.ParameterNotNull(braintreeApiService, "braintreeApiService"); this._braintreeApiService = braintreeApiService; }
/// <summary> /// Initializes a new instance of the <see cref="BraintreePaymentGatewayMethodBase"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService"> /// The braintree api service. /// </param> protected BraintreePaymentGatewayMethodBase(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod) { Mandate.ParameterNotNull(braintreeApiService, "braintreeApiService"); _braintreeApiService = braintreeApiService; }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeSubscriptionRecordPaymentMethod"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService">The <see cref="IBraintreeApiService"/></param> public BraintreeSubscriptionRecordPaymentMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod) { Mandate.ParameterNotNull(braintreeApiService, "braintreeApiService"); _braintreeApiService = braintreeApiService; }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeTransactionControllerBase"/> class. /// </summary> protected BraintreeTransactionControllerBase() { //// D143E0F6-98BB-4E0A-8B8C-CE9AD91B0969 is the Guid from the BraintreeProvider Activation Attribute //// [GatewayProviderActivation("D143E0F6-98BB-4E0A-8B8C-CE9AD91B0969", "BrainTree Payment Provider", "BrainTree Payment Provider")] var provider = (BraintreePaymentGatewayProvider)MerchelloContext.Current.Gateways.Payment.GetProviderByKey(new Guid("D143E0F6-98BB-4E0A-8B8C-CE9AD91B0969")); // GetBraintreeProviderSettings() is an extension method with the provider _service = new BraintreeApiService(provider.ExtendedData.GetBrainTreeProviderSettings()); }
/// <summary> /// Initializes a new instance of the <see cref="BraintreePaymentModelFactory{TPaymentModel}"/> class. /// </summary> public BraintreePaymentModelFactory() { //// D143E0F6-98BB-4E0A-8B8C-CE9AD91B0969 is the Guid from the BraintreeProvider Activation Attribute //// [GatewayProviderActivation("D143E0F6-98BB-4E0A-8B8C-CE9AD91B0969", "BrainTree Payment Provider", "BrainTree Payment Provider")] var provider = (BraintreePaymentGatewayProvider)MerchelloContext.Current.Gateways.Payment.GetProviderByKey(Merchello.Providers.Constants.Braintree.GatewayProviderSettingsKey); //// GetBraintreeProviderSettings() is an extension method with the provider //// Note: We don't need to make this Lazy since all of the services are internally lazy loaded so the instantiation hit should be minimal this._braintreeApiService = new BraintreeApiService(provider.ExtendedData.GetBrainTreeProviderSettings()); }
public virtual void TestFixtureSetup() { this.TestCustomer = MerchelloContext.Current.Services.CustomerService.CreateCustomerWithKey( Guid.NewGuid().ToString(), "first", "last", "*****@*****.**"); this.BraintreeProviderSettings = TestHelper.GetBraintreeProviderSettings(); AutoMapperMappings.CreateMappings(); this.Gateway = this.BraintreeProviderSettings.AsBraintreeGateway(); this.BraintreeApiService = new BraintreeApiService(this.BraintreeProviderSettings); }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeApiController"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/>. /// </param> public BraintreeApiController(IMerchelloContext merchelloContext) { if (merchelloContext == null) throw new ArgumentNullException("merchelloContext"); var provider = (BraintreePaymentGatewayProvider)merchelloContext.Gateways.Payment.GetProviderByKey(Constants.Braintree.GatewayProviderSettingsKey); if (provider == null) { var ex = new NullReferenceException("The BraintreePaymentGatewayProvider could not be resolved. The provider must be activiated"); LogHelper.Error<BraintreeApiController>("BraintreePaymentGatewayProvider not activated.", ex); throw ex; } this._customerService = merchelloContext.Services.CustomerService; var settings = provider.ExtendedData.GetBrainTreeProviderSettings(); this._braintreeApiService = new BraintreeApiService(merchelloContext, settings); }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeApiController"/> class. /// </summary> /// <param name="merchelloContext"> /// The <see cref="IMerchelloContext"/>. /// </param> public BraintreeApiController(IMerchelloContext merchelloContext) { if (merchelloContext == null) { throw new ArgumentNullException("merchelloContext"); } var provider = (BraintreePaymentGatewayProvider)merchelloContext.Gateways.Payment.GetProviderByKey(Constants.Braintree.GatewayProviderSettingsKey); if (provider == null) { var ex = new NullReferenceException("The BraintreePaymentGatewayProvider could not be resolved. The provider must be activiated"); LogHelper.Error <BraintreeApiController>("BraintreePaymentGatewayProvider not activated.", ex); throw ex; } this._customerService = merchelloContext.Services.CustomerService; var settings = provider.ExtendedData.GetBrainTreeProviderSettings(); this._braintreeApiService = new BraintreeApiService(merchelloContext, settings); }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeSimpleTransactionPaymentGatewayMethod"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService"> /// The braintree Api Service. /// </param> public BraintreeSimpleTransactionPaymentGatewayMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod, braintreeApiService) { }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeVaultPaymentGatewayMethodBase"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService"> /// The braintree api service. /// </param> protected BraintreeVaultPaymentGatewayMethodBase(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod, braintreeApiService) { }
/// <summary> /// Initializes a new instance of the <see cref="BraintreePaymentGatewayProvider"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="gatewayProviderSettings"> /// The gateway provider settings. /// </param> /// <param name="runtimeCacheProvider"> /// The runtime cache provider. /// </param> public BraintreePaymentGatewayProvider(IGatewayProviderService gatewayProviderService, IGatewayProviderSettings gatewayProviderSettings, Umbraco.Core.Cache.IRuntimeCacheProvider runtimeCacheProvider) : base(gatewayProviderService, gatewayProviderSettings, runtimeCacheProvider) { _braintreeApiService = new BraintreeApiService(gatewayProviderSettings.ExtendedData.GetBrainTreeProviderSettings()); }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeStandardPaymentGatewayBase"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService"> /// The braintree api service. /// </param> protected BraintreeStandardPaymentGatewayBase(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod, braintreeApiService) { }
/// <summary> /// Initializes a new instance of the <see cref="BraintreeVaultTransactionPaymentGatewayMethod"/> class. /// </summary> /// <param name="gatewayProviderService"> /// The gateway provider service. /// </param> /// <param name="paymentMethod"> /// The payment method. /// </param> /// <param name="braintreeApiService"> /// The braintree api service. /// </param> public BraintreeVaultTransactionPaymentGatewayMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IBraintreeApiService braintreeApiService) : base(gatewayProviderService, paymentMethod, braintreeApiService) { this.Initialize(); }