Class OrderPaymentService
- Namespace
- GastroSky.Services.OrderPaymentService
- Assembly
- GastroSky.dll
public class OrderPaymentService : IOrderPaymentService
- Inheritance
-
OrderPaymentService
- Implements
- Inherited Members
Constructors
OrderPaymentService(IConfiguration, ILogger<OrderPaymentService>, GastroSkyDatabaseContext)
public OrderPaymentService(IConfiguration configuration, ILogger<OrderPaymentService> logger, GastroSkyDatabaseContext db)
Parameters
configurationIConfigurationloggerILogger<OrderPaymentService>dbGastroSkyDatabaseContext
Methods
CheckOrderPaymentStatus(Order)
Returns true if the specified order has been paid in full.
This contacts the payment service provider's web API and queries the paid amount for a given reference ID there, so use sparingly!
We don't wanna test exactly HOW many requests we can send out there before being rate-limited :')
public Task<bool> CheckOrderPaymentStatus(Order order)
Parameters
Returns
- Task<bool>
Returns
trueif the specifiedorderhas been paid in full. If it returnstrue, the db context must be saved!
Remarks
This method sets the passed order's fields "RawPaymentData" and "RawPaymentData" to their new, updated values if the payment has meanwhile been executed in full. Remember to save those changes to DB afterwards: this method does NOT call SaveChangesAsync()