feat: Create payment sessions (#6549)

~~Opening a draft PR to discuss a couple of implementation details that we should align on~~

**What**

Add workflow and API endpoint for creating payment sessions for a payment collection. Endpoint is currently `POST /store/payment-collection/:id/payment-sessions`. I suggested an alternative in a comment below.

Please note, we intentionally do not want to support creating payment sessions in bulk, as this would become a mess when having to manage multiple calls to third-party providers.
This commit is contained in:
Oli Juhl
2024-03-05 08:40:47 +00:00
committed by GitHub
parent 908b1dc3a2
commit 84208aafc1
30 changed files with 603 additions and 182 deletions
@@ -25,21 +25,21 @@ export const defaultPaymentSessionData = [
amount: 100,
currency_code: "usd",
provider_id: "pp_system_default",
payment_collection: "pay-col-id-1",
payment_collection_id: "pay-col-id-1",
},
{
id: "pay-sess-id-2",
amount: 100,
currency_code: "usd",
provider_id: "pp_system_default",
payment_collection: "pay-col-id-2",
payment_collection_id: "pay-col-id-2",
},
{
id: "pay-sess-id-3",
amount: 100,
currency_code: "usd",
provider_id: "pp_system_default",
payment_collection: "pay-col-id-2",
payment_collection_id: "pay-col-id-2",
},
]
@@ -48,7 +48,7 @@ export const defaultPaymentData = [
id: "pay-id-1",
amount: 100,
currency_code: "usd",
payment_collection: "pay-col-id-1",
payment_collection_id: "pay-col-id-1",
payment_session: "pay-sess-id-1",
provider_id: "pp_system_default",
authorized_amount: 100,
@@ -59,7 +59,7 @@ export const defaultPaymentData = [
amount: 100,
authorized_amount: 100,
currency_code: "usd",
payment_collection: "pay-col-id-2",
payment_collection_id: "pay-col-id-2",
payment_session: "pay-sess-id-2",
provider_id: "pp_system_default",
data: {},