@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 56 lines 1.99 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 VerifyAuthRequestCryptogramRequest extends Omit<
7 paymentcryptographydata.VerifyAuthRequestCryptogramInput,
8 "KeyIdentifier"
9 > {}
10
11 /**
12 * Runtime binding for `payment-cryptography:VerifyAuthRequestCryptogram` —
13 * verifies an Authorization Request Cryptogram (ARQC) during EMV transaction
14 * processing under an issuer master {@link Key}, optionally producing the
15 * Authorization Response Cryptogram (ARPC). A mismatch fails with the typed
16 * `VerificationFailedException`. Provide `VerifyAuthRequestCryptogramHttp`
17 * on the Function to satisfy this service.
18 * ### EMV Cryptograms
19 * **Example:** Verify an ARQC and produce the ARPC
20 * ```typescript
21 * // init
22 * const verifyArqc =
23 * yield* PaymentCryptography.VerifyAuthRequestCryptogram(issuerMasterKey);
24 *
25 * // runtime
26 * const verified = yield* verifyArqc({
27 * TransactionData: transactionDataHex,
28 * AuthRequestCryptogram: arqc,
29 * MajorKeyDerivationMode: "EMV_OPTION_A",
30 * SessionKeyDerivationAttributes: {
31 * EmvCommon: { PrimaryAccountNumber: pan, PanSequenceNumber: "00", ApplicationTransactionCounter: "0001" },
32 * },
33 * AuthResponseAttributes: { ArqcMethod1: { AuthResponseCode: "0000" } },
34 * });
35 * ```
36 *
37 * @binding
38 */
39 export interface VerifyAuthRequestCryptogram extends Binding.Service<
40 VerifyAuthRequestCryptogram,
41 "AWS.PaymentCryptography.VerifyAuthRequestCryptogram",
42 <K extends Key>(
43 key: K,
44 ) => Effect.Effect<
45 (
46 request: VerifyAuthRequestCryptogramRequest,
47 ) => Effect.Effect<
48 paymentcryptographydata.VerifyAuthRequestCryptogramOutput,
49 paymentcryptographydata.VerifyAuthRequestCryptogramError
50 >
51 >
52 > {}
53
54 export const VerifyAuthRequestCryptogram = Binding.Service<VerifyAuthRequestCryptogram>(
55 "AWS.PaymentCryptography.VerifyAuthRequestCryptogram",
56 );