Guides

PaymentService

Documentation for Merch's PaymentService

The Payment service is used manage payments.

Instantiating

The PaymentService is exposed through the MerchelloContext

var paymentService = MerchelloContext.Current.Services.PaymentService;

Class

public class PaymentService : MerchelloRepositoryService, 
	IPaymentService, IService

Constructors

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

Public Methods

NameDescription
ApplyPaymentToInvoiceCreates and saves an AppliedPayment
CreatePaymentCreates a payment without saving it to the database
CreatePaymentWithKey(PaymentMethodType, Decimal, Nullable(Guid), Boolean)Creates and saves a payment
Delete(IAppliedPayment, Boolean)Deletes a IAppliedPayment
Delete(IEnumerable(IAppliedPayment), Boolean)Deletes a collection of IAppliedPayment
Delete(IPayment, Boolean)Deletes a single IPayment
Delete(IEnumerable(IPayment), Boolean)Deletes a collection of IPayment
GetAppliedPaymentsByInvoiceKeyGets a collection of IAppliedPayments by the invoice key
GetAppliedPaymentsByPaymentKeyGets a collection of IAppliedPayments by the payment key
GetByKeyGets a IPayment
GetByKeysGets list of IProduct objects given a list of Unique keys
GetPaymentsByCustomerKeyGets a collection of IPayment by customer key.
GetPaymentsByInvoiceKeyGets a collection of IPayment for a given invoice
GetPaymentsByPaymentMethodKeyGets a collection of IPayment for a given PaymentGatewayProvider
Save(IAppliedPayment, Boolean)Saves an IAppliedPayment
Save(IAppliedPayment, Boolean)Saves a single IPaymentMethod
Save(IEnumerable(IPayment), Boolean)Saves a collection of IPayment

Events

NameDescription
CreatingOccurs before create
CreatedOccurs after create
DeletingOccurs before delete
DeletedOccurs after delete
SavingOccurs before save
SavedOccurs after save

Interface on GitHub

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