| 1 | import type { |
| 2 | GetPaymentMethodConfigurationError, |
| 3 | GetPaymentMethodConfigurationRequest, |
| 4 | PaymentMethodConfiguration as StripePaymentMethodConfiguration, |
| 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 { PaymentMethodConfiguration } from "./PaymentMethodConfiguration.ts"; |
| 10 | |
| 11 | export interface RetrievePaymentMethodConfigurationRequest extends Omit< |
| 12 | GetPaymentMethodConfigurationRequest, |
| 13 | "configuration" |
| 14 | > {} |
| 15 | |
| 16 | /** |
| 17 | * Retrieve a bound Stripe Payment Method Configuration over HTTP. |
| 18 | * |
| 19 | * ### Reading a Payment Method Configuration |
| 20 | * **Example:** Bind and retrieve |
| 21 | * ```typescript |
| 22 | * const retrieve = yield* Stripe.RetrievePaymentMethodConfiguration(checkout); |
| 23 | * const live = yield* retrieve(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | * @product Payment Methods |
| 28 | */ |
| 29 | export interface RetrievePaymentMethodConfiguration extends Binding.Service< |
| 30 | RetrievePaymentMethodConfiguration, |
| 31 | "Stripe.RetrievePaymentMethodConfiguration", |
| 32 | ( |
| 33 | configuration: PaymentMethodConfiguration, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: RetrievePaymentMethodConfigurationRequest, |
| 37 | ) => Effect.Effect< |
| 38 | StripePaymentMethodConfiguration, |
| 39 | GetPaymentMethodConfigurationError, |
| 40 | RuntimeContext |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const RetrievePaymentMethodConfiguration = |
| 46 | Binding.Service<RetrievePaymentMethodConfiguration>( |
| 47 | "Stripe.RetrievePaymentMethodConfiguration", |
| 48 | ); |