mirror of
https://github.com/rjNemo/payit
synced 2026-06-10 12:26:45 +00:00
- Integrate Stripe Go SDK and implement a checkout service for creating Stripe Checkout sessions for a demo product. - Add request/response types for checkout sessions. - Create HTTP handler for /api/checkout to initiate sessions via POST. - Provide comprehensive unit tests for Stripe client and web handler. - Wire Stripe-backed endpoint in server setup.
12 lines
345 B
Go
12 lines
345 B
Go
package stripe
|
|
|
|
// CheckoutSessionRequest captures optional inputs for creating a checkout session.
|
|
type CheckoutSessionRequest struct {
|
|
Quantity int64 `json:"quantity"`
|
|
}
|
|
|
|
// CheckoutSessionResult contains the data returned to callers initiating checkout.
|
|
type CheckoutSessionResult struct {
|
|
ID string `json:"id"`
|
|
URL string `json:"url"`
|
|
}
|