| 1 | import type { |
| 2 | GetPaymentLinkError, |
| 3 | GetPaymentLinkRequest, |
| 4 | PaymentLink as StripePaymentLink, |
| 5 | } from "@distilled.cloud/stripe/stripe"; |
| 6 | import type * as Effect from "effect/Effect"; |
| 7 | import * as Binding from "../Binding.ts"; |
| 8 | import type { RuntimeContext } from "../RuntimeContext.ts"; |
| 9 | import type { PaymentLink } from "./PaymentLink.ts"; |
| 10 | |
| 11 | export 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 | */ |
| 29 | export 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 | |
| 41 | export const RetrievePaymentLink = Binding.Service<RetrievePaymentLink>( |
| 42 | "Stripe.RetrievePaymentLink", |
| 43 | ); |