account-pay
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -11,3 +11,18 @@ declare const _default: { | ||
listNewTransaction: (day: number) => Promise<import("./types").PushData[]>; | ||
transaction: { | ||
BankOfList: () => Promise<{ | ||
bankClearingCode: string; | ||
bankName: string; | ||
"network.cmCode": string; | ||
}[]>; | ||
retrieve: (accountId: string, bankCode: string) => Promise<{ | ||
fullName: string | null; | ||
iban: string | null; | ||
account: string | null; | ||
alias: null; | ||
msgId: string | null; | ||
name: string | null; | ||
}>; | ||
}; | ||
}; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const service_1 = require("./service"); | ||
exports.default = { Auth: service_1.Auth, listTransaction: service_1.listTransaction, listNewTransaction: service_1.listNewTransaction }; | ||
const transaction_1 = require("./transaction"); | ||
exports.default = { Auth: service_1.Auth, listTransaction: service_1.listTransaction, listNewTransaction: service_1.listNewTransaction, transaction: transaction_1.default }; |
import { Transaction, PushData } from "./types"; | ||
export declare let accessToken: string; | ||
export declare const Auth: (data: { | ||
@@ -9,3 +10,4 @@ DEVICE_ID: string; | ||
}) => Promise<string>; | ||
export declare const createToken: () => Promise<string>; | ||
export declare const listTransaction: (day: number) => Promise<Transaction[]>; | ||
export declare const listNewTransaction: (day: number) => Promise<PushData[]>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.listNewTransaction = exports.listTransaction = exports.Auth = void 0; | ||
exports.listNewTransaction = exports.listTransaction = exports.createToken = exports.Auth = exports.accessToken = void 0; | ||
const date_and_time_1 = require("date-and-time"); | ||
@@ -11,3 +11,3 @@ const axios_master_1 = require("axios-master"); | ||
let KHAANBANK_USERNAME = ""; | ||
let accessToken = ""; | ||
exports.accessToken = ""; | ||
async function createId(date, accountId) { | ||
@@ -23,3 +23,3 @@ return new Date(date).getTime() + "" + parseInt(accountId); | ||
try { | ||
await createToken(); | ||
await (0, exports.createToken)(); | ||
return "Success Login khaanbank"; | ||
@@ -67,3 +67,3 @@ } | ||
}); | ||
accessToken = result.access_token; | ||
exports.accessToken = result.access_token; | ||
return Promise.resolve(result.access_token); | ||
@@ -75,2 +75,3 @@ } | ||
}; | ||
exports.createToken = createToken; | ||
const listTransaction = async (day) => { | ||
@@ -88,3 +89,3 @@ const edate = (0, date_and_time_1.format)(new Date(), "YYYY-MM-DD"); | ||
"Content-Type": "application/json", | ||
Authorization: "Bearer " + accessToken, | ||
Authorization: "Bearer " + exports.accessToken, | ||
}, | ||
@@ -96,3 +97,3 @@ }, { | ||
shouldRetryStatus: [401, 400], | ||
retryFunction: createToken, | ||
retryFunction: exports.createToken, | ||
}); | ||
@@ -99,0 +100,0 @@ return Promise.resolve(result); |
{ | ||
"name": "account-pay", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "e.khaanbank api", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25207
11
703