diff --git a/MidrandBookshop/MidrandBookshop.csproj b/MidrandBookshop/MidrandBookshop.csproj
index dcbb80e..16e98d4 100644
--- a/MidrandBookshop/MidrandBookshop.csproj
+++ b/MidrandBookshop/MidrandBookshop.csproj
@@ -18,13 +18,13 @@
-
+
-
+
@@ -51,6 +51,10 @@
+
+
+
+
diff --git a/MidrandBookshop/Program.cs b/MidrandBookshop/Program.cs
index 1172d23..a7d4499 100644
--- a/MidrandBookshop/Program.cs
+++ b/MidrandBookshop/Program.cs
@@ -1,6 +1,7 @@
using LiteCharms.Features.Extensions;
using LiteCharms.Features.Mediator;
using LiteCharms.Features.MidrandBooks.Extensions;
+using LiteCharms.Features.MidrandBooks.Payments;
using Microsoft.AspNetCore.HttpOverrides;
using MidrandBookshop.Components;
using static LiteCharms.Features.Extensions.Quartz;
@@ -25,8 +26,11 @@ builder.Services.AddEmailServices(builder.Configuration);
builder.Services.AddEmailServiceBus();
builder.Services.AddHttpClient();
-builder.Services.AddShopServices();
+builder.Services.AddScoped();
+builder.Services.AddShopServices(includeLocalStorage: true);
builder.Services.AddHashServices(builder.Configuration);
+builder.Services.AddSecurityApiSdk(builder.Configuration);
+builder.Services.AddPayfastServices(builder.Configuration);
builder.Services.AddMidrandShopDatabase(builder.Configuration);
builder.Services.AddMidrandShopPostgresHealthCheck();
diff --git a/MidrandBookshop/appsettings.json b/MidrandBookshop/appsettings.json
index 2823623..7d7b09e 100644
--- a/MidrandBookshop/appsettings.json
+++ b/MidrandBookshop/appsettings.json
@@ -1,7 +1,22 @@
{
+ "PayfastSettings": {
+ "CheckoutUrl": "https://sandbox.payfast.co.za/eng/process",
+ "ValidHosts": [
+ "www.payfast.co.za",
+ "sandbox.payfast.co.za",
+ "ips.payfast.co.za",
+ "api.payfast.co.za",
+ "payment.payfast.io"
+ ]
+ },
"LiteCharmsSettings": {
"Authority": "https://sts.security.khongisa.co.za"
},
+ "LiteCharmsClientSettings": {
+ "Authority": "https://sts.security.khongisa.co.za",
+ "GrantType": "client_credentials",
+ "Scope": "midrandbooks-api"
+ },
"HasherSettings": {
"MinHashLength": 11
},
diff --git a/midrandbooks-uat.yml b/midrandbooks-uat.yml
index 1ebea6c..0abdaa5 100644
--- a/midrandbooks-uat.yml
+++ b/midrandbooks-uat.yml
@@ -19,16 +19,18 @@ data:
BookshopS3Settings__Region: "garage"
BookshopS3Settings__BucketName: "bookshop"
BookshopS3Settings__CdnBaseUrl: "https://bookshop.cdn.khongisa.co.za"
- ValidPayfastHosts__0: "www.payfast.co.za"
- ValidPayfastHosts__1: "sandbox.payfast.co.za"
- ValidPayfastHosts__2: "w1w.payfast.co.za"
- ValidPayfastHosts__3: "w2w.payfast.co.za"
- ValidPayfastHosts__4: "ips.payfast.co.za"
- ValidPayfastHosts__5: "api.payfast.co.za"
- ValidPayfastHosts__6: "payment.payfast.io"
+ PayfastSettings__CheckoutUrl: "https://sandbox.payfast.co.za/eng/process"
+ PayfastSettings__ValidHosts__0: "www.payfast.co.za"
+ PayfastSettings__ValidHosts__1: "sandbox.payfast.co.za"
+ PayfastSettings__ValidHosts__2: "ips.payfast.co.za"
+ PayfastSettings__ValidHosts__3: "api.payfast.co.za"
+ PayfastSettings__ValidHosts__4: "payment.payfast.io"
LiteCharmsSettings__Authority: "https://sts.security.khongisa.co.za"
LiteCharmsSettings__Audience: "midrandbooks-api"
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
+ LiteCharmsClientSettings__Authority: "https://sts.security.khongisa.co.za"
+ LiteCharmsClientSettings__GrantType: "client_credentials"
+ LiteCharmsClientSettings__Scope: "midrandbooks-api"
---
apiVersion: v1
kind: Secret
@@ -40,12 +42,16 @@ data:
connection-string: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPW1pZHJhbmRzaG9wLWRldjtVc2VybmFtZT1taWRyYW5kc2hvcC1kZXYtdXNlcjtQYXNzd29yZD1hUFh5a0tnM3RTOWNtRDtQZXJzaXN0IFNlY3VyaXR5IEluZm89VHJ1ZQ==
connection-string-quartz: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPXNjaGVkdWxlci1kZXY7VXNlcm5hbWU9c2NoZWR1bGVyLWRldi11c2VyO1Bhc3N3b3JkPWtWVm1vV0tKM3h6Z1FYO1BlcnNpc3QgU2VjdXJpdHkgSW5mbz1UcnVl
aspire-apikey: bWMzRzYzSzJqNVpPRXNpMEFqTW9qTFRYbTFLRVpGY3R6SUlqU3dEaVRHdXQ4cUdTa1B1V3d4R1AxUmJzY0pVbw==
- hasher-salt: VEdsbmFIUWdRMmhoY20xekxDQk5hV1J5WVc1a1FtOXZhM01nYldGclpTQnNiM1J6SUc5bUlHMXZibVY1SUdGdVpDQmhjbVVnWVNCemRXTmpaWE56Wm5Wc0lIWnBjbUZzSUhOMGIzSjVJR2x1SUZOdmRYUm9JRUZtY21sallRPT0=
- hasher-payfastpassphrase: OUdBSVIwdFdwaFgwcU8=
+ hasher-salt: VEdsbmFIUWdRMmhoY20xekxDQk5hV1J5WVc1a1FtOXZhM01nYldGclpTQnNiM1J6SUc5bUlHMXZibVY1SUdGdVpDQmhjbVVnWVNCemRXTmpaWE56Wm5Wc0lIWnBjbUZzSUhOMGIzSjVJR2x1SUZOdmRYUm9JRUZtY21sallRPT0=
bookshop-s3-accesskey: R0s1MTRkMmNlOGRjNjkyMzdhMDVjMDFlZWY=
bookshop-s3-secretkey: ZWFhZmVkYTFhZWQ0MDllY2ZlNjA3MTRlY2RhNTQ5YjgyYmRmNWEzZGFmOWYxOGRkNjFmNjZiNDk3M2E2NDgyZQ==
litecharms-clientid: bWlkcmFuZGJvb2tzLXVhdA==
litecharms-clientsecret: c2VjcmV0Xzc3OGJkODM3NWFjNGE3Mzg2N2QxZDdhNjcwODJlZTJjNGU4NmUwODYwYmI0Y2ZlZWI5NDExOTQ5OTk2ZThhOGU=
+ payfast-passphrase: OUdBSVIwdFdwaFgwcU8=
+ payfast-merchantid: MTAwNDkzMDc=
+ payfast-merchantkey: anU2bmF2bjBqY2JmMA==
+ litecharms-client-clientid: bWlkcmFuZGJvb2tzLWFwaS1zY2FsZXItdWF0
+ litecharms-client-clientsecret: c2VjcmV0XzBhOGRjMWY5OTA2MTU5MGE1MmIxMjcyZGIzYTE4NzFkMjc2MWM3OWZiZDA1OGIyYTk2ODkxMTAyOWU0YjIwOGE=
---
apiVersion: v1
kind: PersistentVolumeClaim
@@ -123,11 +129,31 @@ spec:
secretKeyRef:
name: midrandbooks-secrets
key: hasher-salt
- - name: HasherSettings__PayfastPassphrase
+ - name: PayfastSettings__Passphrase
valueFrom:
secretKeyRef:
name: midrandbooks-secrets
- key: hasher-payfastpassphrase
+ key: payfast-passphrase
+ - name: PayfastSettings__MerchantId
+ valueFrom:
+ secretKeyRef:
+ name: midrandbooks-secrets
+ key: payfast-merchantid
+ - name: PayfastSettings__MerchantKey
+ valueFrom:
+ secretKeyRef:
+ name: midrandbooks-secrets
+ key: payfast-merchantkey
+ - name: LiteCharmsClientSettings__ClientId
+ valueFrom:
+ secretKeyRef:
+ name: midrandbooks-secrets
+ key: litecharms-client-clientid
+ - name: LiteCharmsClientSettings__ClientSecret
+ valueFrom:
+ secretKeyRef:
+ name: midrandbooks-secrets
+ key: litecharms-client-clientsecret
- name: ConnectionStrings__PostgresScheduler
valueFrom:
secretKeyRef: