Skip to content

Commit

Permalink
feat: support manual gateway is cli as basic quick start option
Browse files Browse the repository at this point in the history
  • Loading branch information
field123 committed Nov 14, 2023
1 parent 54e5668 commit caae49a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ type PaymentTypeOptions =
epPaymentsStripeAccountId: string
epPaymentsStripePublishableKey: string
}
| { paymentGatewayType: "None" }
| { paymentGatewayType: "Manual" }

type PlpTypeOptions =
| {
Expand Down Expand Up @@ -678,8 +678,8 @@ async function schematicOptionPrompts(): Promise<{
value: "EP Payments",
},
{
name: "None",
value: "None",
name: "Basic (quick start)",
value: "Manual",
},
],
},
Expand All @@ -688,7 +688,7 @@ async function schematicOptionPrompts(): Promise<{
const paymentGateway =
paymentGatewayType === "EP Payments"
? await epPaymentsSchematicPrompts()
: { paymentGatewayType: "None" as const }
: { paymentGatewayType: "Manual" as const }

return {
plp,
Expand Down
6 changes: 4 additions & 2 deletions packages/d2c-schematics/checkout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ export default function (options: CheckoutOptions): Rule {
}),
move(options.path || ""),
]),
MergeStrategy.Overwrite
MergeStrategy.Overwrite,
),
])
}
}

function resolveGatewaySchematic(
gateway: CheckoutOptions["paymentGatewayType"]
gateway: CheckoutOptions["paymentGatewayType"],
): string {
switch (gateway) {
case "EP Payments":
return "ep-payments-payment-gateway"
case "Manual":
return "manual-payment-gateway"
case "None":
return "none"
default:
Expand Down
2 changes: 1 addition & 1 deletion packages/d2c-schematics/checkout/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"paymentGatewayType": {
"description": "The type of payment gateway to use for your checkout experience.",
"type": "string",
"enum": ["EP Payments", "None"],
"enum": ["EP Payments", "Manual", "None"],
"x-prompt": "Which payment gateway do you want to use?"
},
"epccClientId": {
Expand Down
2 changes: 1 addition & 1 deletion packages/d2c-schematics/d2c/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"plpType": {
"description": "The type of product list page to use.",
"type": "string",
"enum": ["Algolia", "None"]
"enum": ["Algolia", "Manual", "None"]
}
},
"required": ["name", "epccClientId", "epccClientSecret", "epccEndpointUrl"]
Expand Down

0 comments on commit caae49a

Please sign in to comment.