The best way to control Claude Code, Codex and more from any computer or phone

main
ts 57 lines 1.84 KB
Raw
1 import type * as paymentcryptographydata from "@distilled.cloud/aws/payment-cryptography-data";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Key } from "./Key.ts";
5
6 export interface VerifyCardValidationDataRequest extends Omit<
7 paymentcryptographydata.VerifyCardValidationDataInput,
8 "KeyIdentifier"
9 > {}
10
11 /**
12 * Runtime binding for `payment-cryptography:VerifyCardValidationData` —
13 * verifies card validation values (CVV/CVV2, dCVV, CSC) under the same Card
14 * Verification Key (CVK) {@link Key} used to generate them. A mismatch fails
15 * with the typed `VerificationFailedException`. Provide
16 * `VerifyCardValidationDataHttp` on the Function to satisfy this service.
17 * ### Card Validation Data
18 * **Example:** Verify a CVV2 presented in a transaction
19 * ```typescript
20 * // init
21 * const verifyCvv2 = yield* PaymentCryptography.VerifyCardValidationData(cvk);
22 *
23 * // runtime
24 * const outcome = yield* verifyCvv2({
25 * PrimaryAccountNumber: "9123456789012345",
26 * VerificationAttributes: {
27 * CardVerificationValue2: { CardExpiryDate: "0130" },
28 * },
29 * ValidationData: cvv2,
30 * }).pipe(
31 * Effect.map(() => "valid"),
32 * Effect.catchTag("VerificationFailedException", () =>
33 * Effect.succeed("invalid"),
34 * ),
35 * );
36 * ```
37 *
38 * @binding
39 */
40 export interface VerifyCardValidationData extends Binding.Service<
41 VerifyCardValidationData,
42 "AWS.PaymentCryptography.VerifyCardValidationData",
43 <K extends Key>(
44 key: K,
45 ) => Effect.Effect<
46 (
47 request: VerifyCardValidationDataRequest,
48 ) => Effect.Effect<
49 paymentcryptographydata.VerifyCardValidationDataOutput,
50 paymentcryptographydata.VerifyCardValidationDataError
51 >
52 >
53 > {}
54
55 export const VerifyCardValidationData = Binding.Service<VerifyCardValidationData>(
56 "AWS.PaymentCryptography.VerifyCardValidationData",
57 );