-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinLookup_test.ts
More file actions
27 lines (23 loc) · 885 Bytes
/
binLookup_test.ts
File metadata and controls
27 lines (23 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import { config } from "https://deno.land/x/dotenv/mod.ts";
import { Client, Environment } from "./client.ts";
const { MERCHANT_ACCOUNT, API_KEY } = config()
const commonPayload = {
merchantAccount: MERCHANT_ACCOUNT,
cardNumber: "4111111111111111"
}
const { binLookup } = new Client({ apiKey: API_KEY, environment: Environment.TEST });
Deno.test("get 3ds availability", async function (): Promise<void> {
const { binDetails } = await binLookup.get3dsAvailability({
brands: ["visa"],
...commonPayload
})
assertEquals(binDetails?.issuerCountry, "NL")
})
Deno.test("get cost estimate", async function (): Promise<void> {
const { resultCode } = await binLookup.getCostEstimate({
amount: { currency: "EUR", value: 1 },
...commonPayload
})
assertEquals(resultCode, "Unsupported")
})