| 198 | }); |
| 199 | |
| 200 | const settleSetup = (sessionId: string) => |
| 201 | Effect.gen(function* () { |
| 202 | const response = yield* Effect.promise(() => |
| 203 | fetch(`${autumnUrl}/checkout/setup/${encodeURIComponent(sessionId)}/settle`, { |
| 204 | method: "POST", |
| 205 | }), |
| 206 | ); |
| 207 | if (!response.ok) { |
| 208 | return yield* Effect.fail( |
| 209 | `autumn setup settle responded ${response.status}: ${yield* Effect.promise(() => response.text())}`, |
| 210 | ); |
| 211 | } |
| 212 | }); |
| 213 | |
| 214 | const paymentMethod = (customerId: string) => |
| 215 | Effect.gen(function* () { |