1import type {
2 GetPaymentLinkError,
3 GetPaymentLinkRequest,
4 PaymentLink as StripePaymentLink,
5} from "@distilled.cloud/stripe/stripe";
6import type * as Effect from "effect/Effect";
7import * as Binding from "../Binding.ts";
8import type { RuntimeContext } from "../RuntimeContext.ts";
9import type { PaymentLink } from "./PaymentLink.ts";
10
11export interface RetrievePaymentLinkRequest extends Omit<
12 GetPaymentLinkRequest,
13 "payment_link"
14> {}
15
16/**
17 * Retrieve a bound Stripe Payment Link over HTTP.
18 *
19 * ### Reading a Payment Link
20 * **Example:** Bind and retrieve
21 * ```typescript
22 * const retrieve = yield* Stripe.RetrievePaymentLink(checkout);
23 * const live = yield* retrieve();
24 * ```
25 *
26 * @binding
27 * @product Checkout
28 */
29export interface RetrievePaymentLink extends Binding.Service<
30 RetrievePaymentLink,
31 "Stripe.RetrievePaymentLink",
32 (
33 paymentLink: PaymentLink,
34 ) => Effect.Effect<
35 (
36 request?: RetrievePaymentLinkRequest,
37 ) => Effect.Effect<StripePaymentLink, GetPaymentLinkError, RuntimeContext>
38 >
39> {}
40
41export const RetrievePaymentLink = Binding.Service<RetrievePaymentLink>(
42 "Stripe.RetrievePaymentLink",
43);