| 1 | import { GetPrice } from "@distilled.cloud/stripe/stripe"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { RetrievePrice } from "./RetrievePrice.ts"; |
| 4 | import { makeHttpStripeIdBinding } from "./StripeHttp.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link RetrievePrice}. Provide it on the |
| 8 | * Function or Worker Effect. |
| 9 | * |
| 10 | * @layer |
| 11 | * @product Product |
| 12 | * @provides Stripe.RetrievePrice |
| 13 | */ |
| 14 | export const RetrievePriceHttp = Layer.effect( |
| 15 | RetrievePrice, |
| 16 | makeHttpStripeIdBinding({ |
| 17 | tag: "Stripe.RetrievePrice", |
| 18 | operation: GetPrice, |
| 19 | idField: "price", |
| 20 | permissions: ["prices_read"], |
| 21 | }), |
| 22 | ); |