/// <summary>
		/// Initializes a new instance of the <see cref="PayPalApiController"/> class.
		/// </summary>
		/// <param name="merchelloContext">
		/// The <see cref="IMerchelloContext"/>.
		/// </param>
		public ResponseApiController(IMerchelloContext merchelloContext)
		{
			if (merchelloContext == null) throw new ArgumentNullException("merchelloContext");

			var providerKey = new Guid(SaferPayConstants.Key);
			var provider = (SaferPayPaymentGatewayProvider)merchelloContext.Gateways.Payment.GetProviderByKey(providerKey);

			if (provider == null)
			{
				var ex = new NullReferenceException("The PayPalPaymentGatewayProvider could not be resolved.  The provider must be activiated");
				LogHelper.Error<ResponseApiController>("PayPalPaymentGatewayProvider not activated.", ex);
				throw ex;
			}

			_merchelloContext = merchelloContext;
			_settings = provider.ExtendedData.GetSaferPayProcessorSettings();
			_processor = new SaferPayPaymentProcessor(_settings);
		}
		public SaferPayPaymentProcessor(SaferPayProcessorSettings settings)
		{
			_messageFactory = new MessageFactory();
			_messageFactory.Open(SaferPayConstants.Config);
			_settings = settings;
		}
		public SaferPayPaymentGatewayMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, ExtendedDataCollection providerExtendedData)
			: base(gatewayProviderService, paymentMethod)
		{
			_settings = providerExtendedData.GetSaferPayProcessorSettings();
			_processor = new SaferPayPaymentProcessor(_settings);
		}
		/// <summary>
		/// Serializes the <see cref="FixedRateTaxationProviderSettings" /> and saves them in the extend data collection.
		/// </summary>
		/// <param name="extendedData">The extended data.</param>
		/// <param name="settings">The settings.</param>
		public static void SaveProviderSettings(this ExtendedDataCollection extendedData, SaferPayProcessorSettings settings)
		{
			extendedData.SetValue(SaferPayConstants.ExtendedDataKey, JsonConvert.SerializeObject(settings));
		}