@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 53 lines 1.79 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 GenerateAuthRequestCryptogramRequest extends Omit<
7 paymentcryptographydata.GenerateAuthRequestCryptogramInput,
8 "KeyIdentifier"
9 > {}
10
11 /**
12 * Runtime binding for `payment-cryptography:GenerateAuthRequestCryptogram` —
13 * generates an Authorization Request Cryptogram (ARQC) for AS2805 terminal
14 * transactions under an EMV issuer master {@link Key}. Provide
15 * `GenerateAuthRequestCryptogramHttp` on the Function to satisfy this
16 * service.
17 * ### EMV Cryptograms
18 * **Example:** Generate an ARQC for transaction data
19 * ```typescript
20 * // init
21 * const generateArqc =
22 * yield* PaymentCryptography.GenerateAuthRequestCryptogram(issuerMasterKey);
23 *
24 * // runtime
25 * const generated = yield* generateArqc({
26 * TransactionData: transactionDataHex,
27 * MajorKeyDerivationMode: "EMV_OPTION_A",
28 * SessionKeyDerivationAttributes: {
29 * EmvCommon: { PrimaryAccountNumber: pan, PanSequenceNumber: "00", ApplicationTransactionCounter: "0001" },
30 * },
31 * });
32 * ```
33 *
34 * @binding
35 */
36 export interface GenerateAuthRequestCryptogram extends Binding.Service<
37 GenerateAuthRequestCryptogram,
38 "AWS.PaymentCryptography.GenerateAuthRequestCryptogram",
39 <K extends Key>(
40 key: K,
41 ) => Effect.Effect<
42 (
43 request: GenerateAuthRequestCryptogramRequest,
44 ) => Effect.Effect<
45 paymentcryptographydata.GenerateAuthRequestCryptogramOutput,
46 paymentcryptographydata.GenerateAuthRequestCryptogramError
47 >
48 >
49 > {}
50
51 export const GenerateAuthRequestCryptogram = Binding.Service<GenerateAuthRequestCryptogram>(
52 "AWS.PaymentCryptography.GenerateAuthRequestCryptogram",
53 );