Skip to content

Commit

Permalink
Merge branch 'master' into 134-filter-by-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
AzizPatel786 authored Apr 2, 2024
2 parents 202e9cf + e34dc57 commit 99b2340
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 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,27 @@ export default class StripeService {
})
return result.data
}

public async createCheckoutSession(
client_reference_id: string,
return_url: string,
line_item: {
price: string
quantity: number
},
metadata: Record<string, string>
) {
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
}
}

0 comments on commit 99b2340

Please sign in to comment.