| 1 | import type * as paymentcryptographydata from "@distilled.cloud/aws/payment-cryptography-data"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Key } from "./Key.ts"; |
| 5 | |
| 6 | export interface GenerateCardValidationDataRequest extends Omit< |
| 7 | paymentcryptographydata.GenerateCardValidationDataInput, |
| 8 | "KeyIdentifier" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `payment-cryptography:GenerateCardValidationData` — |
| 13 | * generates card validation values (CVV/CVV2, dCVV, CSC) under a Card |
| 14 | * Verification Key (CVK) {@link Key}. Provide |
| 15 | * `GenerateCardValidationDataHttp` on the Function to satisfy this service. |
| 16 | * ### Card Validation Data |
| 17 | * **Example:** Generate a CVV2 for a card |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const generateCvv2 = yield* PaymentCryptography.GenerateCardValidationData(cvk); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const generated = yield* generateCvv2({ |
| 24 | * PrimaryAccountNumber: "9123456789012345", |
| 25 | * GenerationAttributes: { |
| 26 | * CardVerificationValue2: { CardExpiryDate: "0130" }, |
| 27 | * }, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GenerateCardValidationData extends Binding.Service< |
| 34 | GenerateCardValidationData, |
| 35 | "AWS.PaymentCryptography.GenerateCardValidationData", |
| 36 | <K extends Key>( |
| 37 | key: K, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: GenerateCardValidationDataRequest, |
| 41 | ) => Effect.Effect< |
| 42 | paymentcryptographydata.GenerateCardValidationDataOutput, |
| 43 | paymentcryptographydata.GenerateCardValidationDataError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | |
| 48 | export const GenerateCardValidationData = |
| 49 | Binding.Service<GenerateCardValidationData>( |
| 50 | "AWS.PaymentCryptography.GenerateCardValidationData", |
| 51 | ); |