Skip to content

Commit

Permalink
working version
Browse files Browse the repository at this point in the history
  • Loading branch information
abeljimo committed Feb 22, 2024
1 parent 1eb4767 commit 9f20c7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions apps/stripe/bundle/bots/runaction/checkout/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export default function checkout(bot: RunActionBotApi) {
const { currency, customer, success_url, cancel_url } = params
const actionName = bot.getActionName()
const mode = params.mode as Stripe.Checkout.SessionCreateParams.Mode
// eslint-disable-next-line @typescript-eslint/naming-convention
const line_items = params.line_items as
| Stripe.Checkout.SessionCreateParams.LineItem[]
| undefined

if (actionName !== "checkout") {
bot.addError("unsupported action name: " + actionName)
Expand All @@ -30,6 +34,7 @@ export default function checkout(bot: RunActionBotApi) {
customer,
cancel_url,
success_url,
line_items,
},
})

Expand Down
12 changes: 8 additions & 4 deletions apps/stripe/bundle/bots/runaction/checkout/bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ params:
- name: currency
label: Currency
type: TEXT
required: true
required: false
- name: customer
label: Customer ID
type: TEXT
required: true
required: false
- name: success_url
label: Success URL
type: TEXT
required: true
required: false
- name: cancel_url
label: Cancel URL
type: TEXT
required: true
required: false
- name: line_items
label: Line Items
type: MAP #TO-DO This must be a List of Struct using MAP so we got undefined type in typescript
required: false
1 change: 1 addition & 0 deletions apps/stripe/generated/@types/@uesio/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare module "@uesio/app/bots/runaction/uesio/stripe/checkout" {
customer: string
success_url: string
cancel_url: string
line_items?: unknown
}

export type {
Expand Down

0 comments on commit 9f20c7d

Please sign in to comment.