-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathStoreHelper.cs
More file actions
35 lines (34 loc) · 1.41 KB
/
StoreHelper.cs
File metadata and controls
35 lines (34 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using OpenActive.FakeDatabase.NET;
using OpenActive.NET;
using OpenActive.Server.NET.OpenBookingHelper;
namespace BookingSystem
{
public static class StoreHelper
{
public static List<TaxChargeSpecification> GetUnitTaxSpecification(BookingFlowContext flowContext, AppSettings appSettings, decimal? price)
{
switch (flowContext.TaxPayeeRelationship)
{
case TaxPayeeRelationship.BusinessToBusiness when appSettings.Payment.TaxCalculationB2B:
case TaxPayeeRelationship.BusinessToConsumer when appSettings.Payment.TaxCalculationB2C:
return new List<TaxChargeSpecification>
{
new TaxChargeSpecification
{
Name = "VAT at 20%",
Price = price * (decimal?)0.2,
PriceCurrency = "GBP",
Rate = (decimal?)0.2
}
};
case TaxPayeeRelationship.BusinessToBusiness when !appSettings.Payment.TaxCalculationB2B:
case TaxPayeeRelationship.BusinessToConsumer when !appSettings.Payment.TaxCalculationB2C:
return null;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}