Guides

GatewayProviderService

The GatewayProvider service allows you to get to the gateways in Merchello. Gateways.

🚧

Passed to all instantiated Gateway Providers

This class will eventually be obsoleted.

Intantiating

The GatewayProviderService is exposed through the MerchelloContext

var gatewayProviderService = MerchelloContext.Current.Services.GatewayProviderService;

Class

public class GatewayProviderService : MerchelloRepositoryService, 
    IGatewayProviderService, IService

Constructors

NameDescription
GatewayProviderService()Initializes a new instance of the GatewayProviderService class.
GatewayProviderService(ILogger)Initializes a new instance of the GatewayProviderService class.

Public Methods

NameDescription
ApplyPaymentToInvoiceCreates and saves an AppliedPayment
CreateNotificationMessageWithKeyCreates a INotificationMessage and saves it to the database
CreateNotificationMethodWithKeyCreates a INotificationMethod and saves it to the database
CreateNotificationMethodWithKeyCreates a payment without saving it to the database
CreatePaymentMethodWithKeyAttempts to create a IPaymentMethod for a given provider. If the provider already defines a paymentCode, the creation fails.
CreatePaymentWithKeyCreates and saves a payment
CreateShipMethodWithKeyCreates a IShipMethod. This is useful due to the data constraint preventing two ShipMethods being created with the same ShipCountry and ServiceCode for any provider.
CreateTaxMethodWithKeyAttempts to create a ITaxMethod for a given provider and country. If the provider already defines a tax rate for the country, the creation fails.
Delete(INotificationMessage)Deletes a INotificationMessage
Delete(INotificationMethod)Deletes a INotificationMethod
Delete(IPaymentMethod)Deletes a single IPaymentMethod
Delete(IShipMethod)Deletes a IShipMethod
Delete(IShipRateTier)Deletes a IShipRateTier
Delete(ITaxMethod)Deletes a ITaxMethod
Delete(IGatewayProviderSettings, Boolean)Deletes a IGatewayProviderSettings
GetAllGatewayProvidersGets a collection containing all IGatewayProviderSettings
GetAllGatewayProvidersReturns a collection of all IInvoiceStatus
GetAllOrderStatusesReturns a collection of all IOrderStatus
GetAllShipCountriesReturns a collection of all IShipCountry
GetAppliedPaymentsByInvoiceKeyGets a collection of IAppliedPayments by the invoice key
GetAppliedPaymentsByPaymentKeyGets a collection of IAppliedPayments by the payment key
GetDefaultWarehouseGets the default IWarehouse
GetGatewayProviderByKeyGets a IGatewayProviderSettings by it's unique 'Key' (Guid)
GetGatewayProvidersByShipCountryGets a collection of IGatewayProviderSettings by ship country
GetGatewayProvidersByTypeGets a collection of IGatewayProviderSettings by its type (Shipping, Taxation, Payment)
GetNotificationMessageByKeyGets a INotificationMethod by it's unique key(Guid)
GetNotificationMessageByKeyGets a collection of INotificationMessages based on a monitor key
GetNotificationMessagesByMonitorKeyGets a collection of INotificationMessages based on a monitor key
GetNotificationMethodsByProviderKeyGets a collection of INotificationMethod for a give NotificationGatewayProvider
GetPaymentMethodsByProviderKeyGets a collection of IPaymentMethod for a given PaymentGatewayProvider
GetPaymentsForInvoiceGets a collection of IPayment for a given invoice
GetShipCountryGets a IShipCountry by CatalogKey and CountryCode
GetShipCountryByKeyGets a IShipCountry by it's unique key (Guid)
GetShipMethodByKeyGets a IShipMethod by it's unique key
GetShipMethodsByShipCountryKey(Guid)Gets a list of all IShipMethod objects given a IGatewayProviderSettings key
GetShipMethodsByShipCountryKey(Guid, Guid)Gets a list of IShipMethod objects given a IGatewayProviderSettings key and a IShipCountry key
GetShipRateTiersByShipMethodKeyGets a list of IShipRateTier objects given a IShipMethod key
GetTaxMethodByCountryCodeGets a ITaxMethod based on a provider and country code
GetTaxMethodForProductPricingGet tax method for product pricing.
GetTaxMethodsByCountryCodeGets a ITaxMethod based on a provider and country code
GetTaxMethodsByProviderKeyGets a collection of ITaxMethod for a given TaxationGatewayProvider
Save(IAppliedPayment)Saves a single IAppliedPayme
Save(IInvoice)Saves a single IInvoice
Save(INotificationMessage)Saves a INotificationMessage
Save(INotificationMessage)Saves a INotificationMethod
Save(IPayment)Saves a single IPayment
Save(IPaymentMethod)Saves a single IPaymentMethod
Save(IShipMethod)Saves a single IShipMethod
Save(IEnumerable(IShipMethod))Saves a collection of IShipMethod
Save(IShipRateTier)Saves a single IShipRateTier
Save(IShipRateTier)Saves a collection of IShipRateTier
Save(ITaxMethod)Saves a single ITaxMethod
Save(IGatewayProviderSettings, Boolean)Saves a single instance of a IGatewayProviderSettings

Events

NameDescription
DeletingOccurs before delete
DeletedOccurs after delete
SavingOccurs before saving
SavedOccurs after saved

📘

GatewayProviderSerivce

Events associated with the GatewayProviderService are only fired for methods associated with IGatewayProviderSettings

Interface on GitHub

https://github.com/Merchello/Merchello/blob/master/src/Merchello.Core/Services/Interfaces/IGatewayProviderService.cs