Skip to content

Commit

Permalink
Added method to create a new stripe checkout session.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffplays2005 committed Apr 1, 2024
1 parent 1e47df8 commit cd1c20e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 46 deletions.
20 changes: 20 additions & 0 deletions server/src/business-layer/services/StripeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,24 @@ export default class StripeService {
})
return result.data
}

public async createCheckoutSession(
client_reference_id: string,
return_url: string,
line_item: any,
metadata: any
) {
const session = await stripe.checkout.sessions.create({
// consumer changeable
client_reference_id,
return_url,
line_items: [line_item],
metadata,
// configured internally and should not change
ui_mode: "embedded",
mode: "payment",
currency: "NZD"
})
return session.client_secret
}
}
34 changes: 0 additions & 34 deletions server/src/service-layer/controllers/StripeCheckoutSession.ts

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit cd1c20e

Please sign in to comment.