@openlib.dev/mn-payment-sdk
Version:
Монголын төлбөрийн хэрэгсэлүүд SDK
1,494 lines (1,463 loc) • 40.6 kB
text/typescript
interface QPayConfig {
username: string;
password: string;
endpoint: string;
callback: string;
invoiceCode: string;
merchantId: string;
}
interface QPayLoginResponse {
tokenType: string;
refreshToken: string;
refreshExpiresIn: number;
accessToken: string;
expiresIn: number;
scope: string;
notBeforePolicy: string;
sessionState: string;
}
interface QPayCreateInvoiceInput {
senderCode: string;
senderBranchCode: string;
receiverCode: string;
description: string;
amount: number;
callbackParam: Record<string, string>;
}
interface QPaySimpleInvoiceRequest {
invoiceCode: string;
senderInvoiceCode: string;
senderBranchCode: string;
invoiceReceiverCode: string;
invoiceDescription: string;
amount: number;
callbackUrl: string;
}
interface Deeplink {
name: string;
description: string;
logo: string;
link: string;
}
interface QPaySimpleInvoiceResponse {
invoiceId: string;
qrData: string;
qrImage: string;
urls: {
web: string;
deeplink: string;
};
}
interface QPayInvoiceGetResponse {
invoiceId: string;
status: string;
amount: number;
createdAt: string;
updatedAt: string;
}
interface QPayInput {
}
interface QPayTransaction {
}
interface QPayLine {
discounts: any[];
lineDescription: string;
lineQuantity: string;
lineUnitPrice: string;
note: string;
surcharges: any[];
taxProductCode: null;
taxes: any[];
}
interface QPayPaymentCheckRequest {
objectID: string;
objectType: string;
offset: {
pageLimit: number;
pageNumber: number;
};
}
interface QPayPaymentCheckResponse {
rows: Array<{
paymentId: string;
status: string;
amount: number;
createdAt: string;
}>;
count: number;
}
interface QPayPaymentCancelRequest {
callbackUrl: string;
note: string;
}
interface QPayPaymentListRequest {
merchantID: string;
merchantBranchCode: string;
merchantTerminalCode: string;
merchantStaffCode: string;
offset: {
pageLimit: number;
pageNumber: number;
};
}
declare class QpayClient {
private endpoint;
private password;
private username;
private callback;
private invoiceCode;
private merchantId;
private loginObject;
constructor(config: QPayConfig);
private sleep;
private makeRequest;
private httpRequest;
private authQpayV2;
private refreshToken;
createInvoice(input: QPayCreateInvoiceInput): Promise<QPaySimpleInvoiceResponse>;
getInvoice(invoiceId: string): Promise<QPayInvoiceGetResponse>;
cancelInvoice(invoiceId: string): Promise<any>;
getPayment(invoiceId: string): Promise<any>;
checkPayment(invoiceId: string, pageLimit: number, pageNumber: number): Promise<QPayPaymentCheckResponse>;
cancelPayment(invoiceId: string, paymentUUID: string): Promise<QPayPaymentCheckResponse>;
refundPayment(invoiceId: string, paymentUUID: string): Promise<any>;
}
declare const QPayAuthToken: {
readonly url: "/auth/token";
readonly method: "POST";
};
declare const QPayAuthRefresh: {
readonly url: "/auth/refresh";
readonly method: "POST";
};
declare const QPayPaymentGet: {
readonly url: "/payment/get/";
readonly method: "GET";
};
declare const QPayPaymentCheck: {
readonly url: "/payment/check";
readonly method: "POST";
};
declare const QPayPaymentCancel: {
readonly url: "/payment/cancel";
readonly method: "DELETE";
};
declare const QPayPaymentRefund: {
readonly url: "/payment/refund/";
readonly method: "DELETE";
};
declare const QPayPaymentList: {
readonly url: "/payment/url";
readonly method: "POST";
};
declare const QPayInvoiceCreate: {
readonly url: "/invoice";
readonly method: "POST";
};
declare const QPayInvoiceGet: {
readonly url: "/invoice/";
readonly method: "GET";
};
declare const QPayInvoiceCancel: {
readonly url: "/invoice/";
readonly method: "DELETE";
};
declare class QPay {
private endpoint;
private password;
private username;
private callback;
private invoiceCode;
private merchantId;
private loginObject;
constructor(username: string, password: string, endpoint: string, callback: string, invoiceCode: string, merchantId: string);
createInvoice(input: QPayCreateInvoiceInput): Promise<QPaySimpleInvoiceResponse>;
getInvoice(invoiceId: string): Promise<QPayInvoiceGetResponse>;
cancelInvoice(invoiceId: string): Promise<{}>;
getPayment(invoiceId: string): Promise<{}>;
checkPayment(invoiceId: string, pageLimit: number, pageNumber: number): Promise<QPayPaymentCheckResponse>;
cancelPayment(invoiceId: string, paymentUUID: string): Promise<QPayPaymentCheckResponse>;
refundPayment(invoiceId: string, paymentUUID: string): Promise<{}>;
private authQPayV2;
private httpRequestQPay;
private refreshToken;
}
type Lang = 'MN' | 'EN';
type PaymentMethod = 'payment' | 'socialpay';
type ReturnType = 'POST' | 'GET' | 'MOBILE';
interface GolomtConfig {
endpoint: string;
secret: string;
bearerToken: string;
}
interface CreateInvoiceInput {
amount: number;
transactionId: string;
returnType: ReturnType;
callback: string;
getToken: boolean;
socialDeeplink: boolean;
}
interface CreateInvoiceResponse {
invoice: string;
checksum: string;
transactionId: string;
timestamp: string;
status: number;
error: string;
message: string;
path: string;
socialDeeplink: string;
}
interface CreateInvoiceRequest {
amount: string;
checksum: string;
transactionId: string;
returnType: string;
callback: string;
genToken: string;
socialDeeplink: string;
}
interface InquiryResponse {
amount: string;
bank: string;
status: string;
errorDesc: string;
errorCode: string;
cardHolder: string;
cardNumber: string;
transactionId: string;
token: string;
}
interface InquiryRequest {
checksum: string;
transactionId: string;
}
interface ByTokenRequest {
amount: string;
invoice: string;
checksum: string;
transactionId: string;
token: string;
lang: string;
}
interface ByTokenResponse {
amount: string;
errorDesc: string;
errorCode: string;
transactionId: string;
checksum: string;
cardNumber: string;
}
interface GolomtError {
timestamp: string;
status: number;
error: string;
message: string;
path: string;
}
declare class GolomtClient {
private endpoint;
private secret;
private bearerToken;
constructor(config: GolomtConfig);
private boolToString;
private generateHMAC;
private appendAsString;
getUrlByInvoiceId(invoice: string, lang: Lang, paymentMethod: PaymentMethod): string;
payByToken(amount: number, token: string, transactionId: string, lang: string): Promise<ByTokenResponse>;
createInvoice(input: CreateInvoiceInput): Promise<CreateInvoiceResponse>;
inquiry(transactionId: string): Promise<InquiryResponse>;
private httpRequestGolomtEcommerce;
}
declare enum EbarimtBillType {
Organization = "3",
Personal = "1"
}
interface CreateEbarimtRequest {
amount: string;
vat: string;
cashAmount: string;
nonCashAmount: string;
cityTax: string;
customerNo: string;
billType: string;
billIdSuffix: string;
branchNo: string;
districtCode: string;
stocks: Stock[];
}
interface CreateEbarimtInput {
customerNo: string;
branchNo: string;
billIdSuffix: string;
billType: EbarimtBillType;
districtCode: string;
stocks: StockInput[];
}
interface Stock {
code: string;
name: string;
measureUnit: string;
qty: string;
unitPrice: string;
totalAmount: string;
cityTax: string;
vat: string;
barCode: string;
}
interface StockInput {
code: string;
name: string;
measureUnit: string;
qty: number;
unitPrice: number;
cityTax: number;
vat: number;
barCode: string;
}
interface CreateEbarimtResponse {
amount: string;
vat: string;
cashAmount: string;
nonCashAmount: string;
cityTax: string;
customerNo: string;
billType: string;
branchNo: string;
districtCode: string;
stocks: Stock[];
taxType: string;
registerNo: string;
billId: string;
macAddress: string;
date: string;
lottery: string;
internalCode: string;
qrData: string;
merchantId: string;
success: boolean;
message: string;
errorCode: number;
warningMsg: string;
lotteryWarningMsg: string;
}
interface CheckAPIItem {
message?: string;
success: boolean;
}
interface CheckResponse {
config: CheckAPIItem;
database: CheckAPIItem;
network: CheckAPIItem;
success: boolean;
}
interface ReturnBillResponse {
success: boolean;
}
interface EbarimtConfig {
endpoint: string;
}
declare class EbarimtClient {
private endpoint;
constructor(config: EbarimtConfig);
private float64ToString;
private stockInputToStock;
private createInputToRequestBody;
getNewEbarimt(input: CreateEbarimtInput): Promise<CreateEbarimtResponse>;
sendData(): Promise<void>;
returnBill(billId: string, date: string): Promise<boolean>;
checkApi(): Promise<CheckResponse>;
}
interface HipayConfig {
endpoint: string;
token: string;
entityId: string;
}
interface CheckoutItem {
itemNo: string;
names: string;
price: number;
quantity: number;
brand: string;
measure: string;
vat: number;
citytax: number;
}
interface HipayCheckoutRequest {
entityId: string;
amount: number;
currency: string;
qrData: boolean;
signal: boolean;
ipaddress?: string;
items?: CheckoutItem[];
}
interface Signal {
subscribeKey: string;
channel: string;
uuid: string;
}
interface Details {
field: string;
issue: string;
}
interface HipayCheckoutResponse {
code: number;
description: string;
requestId: string;
checkoutId: string;
expires: string;
signal?: Signal;
qrData: string;
details?: Details[];
}
interface HipayCheckoutGetResponse {
code: number;
description: string;
amount?: number;
currency?: string;
discount_amount?: number;
status?: string;
status_date?: string;
paymentId?: string;
details?: Details[];
}
interface HipayPaymentGetResponse {
code: number;
description: string;
id?: string;
amount?: string;
currency?: string;
entityId?: string;
checkoutId?: string;
paymentId?: string;
paymentType?: string;
paymentBrand?: string;
paymentDate?: string;
paymentDesc?: string;
result_desc?: string;
result_code?: string;
details?: Details[];
}
interface HipayPaymentCorrectionRequest {
entityId: string;
paymentId: string;
}
interface HipayPaymentCorrectionResponse {
code: number;
description: string;
paymentId?: string;
correction_paymentId?: string;
details?: Details[];
}
interface HipayStatementRequest {
entityId: string;
date: string;
}
interface List {
paymentDate: string;
checkoutId: string;
paymentId: string;
amount: number;
currency: string;
feeAmount: number;
feePrc: number;
paymentDesc: string;
returnAmount: number;
}
interface Data {
list: List[];
entityId: string;
date: string;
page: number;
perPage: number;
totalCount: number;
totalPage: number;
}
interface HipayStatementResponse {
code: number;
description: string;
details?: Details[];
data?: Data;
}
declare class HipayClient {
private endpoint;
private token;
private entityId;
constructor(config: HipayConfig);
private sleep;
private makeRequest;
private httpRequest;
checkout(amount: number): Promise<HipayCheckoutResponse>;
checkoutGet(checkoutId: string): Promise<HipayCheckoutGetResponse>;
paymentGet(paymentId: string): Promise<HipayPaymentGetResponse>;
paymentCorrection(paymentId: string): Promise<HipayPaymentCorrectionResponse>;
statement(date: string): Promise<HipayStatementResponse>;
}
interface MongolchatConfig {
endpoint: string;
apiKey: string;
workerKey: string;
appSecret: string;
branchNo: string;
}
interface MchatProduct {
productName: string;
quantity: string;
price: number;
tag: string;
}
interface MchatQrGenerateInput {
amount: number;
paymentUUID: string;
products: MchatProduct[];
}
interface MchatWebookInput {
type: string;
data: any;
}
interface MchatWebookScanQR {
referenceNumber: string;
whoPaid: string;
userRefId: string;
transactionId: string;
generatedQRcode: string;
amount: number;
date: string;
products: MchatProduct[];
}
interface MchatWebookQuickpay {
referenceNumber: string;
whoPaid: string;
userRefId: string;
transactionId: string;
amount: number;
date: string;
products: MchatProduct[];
}
interface MchatWebookOrder {
referenceNumber: string;
whoPaid: string;
userRefId: string;
transactionId: string;
orderId: string;
amount: number;
date: string;
products: MchatProduct[];
}
interface MchatOnlineQrGenerateRequest {
amount: number;
branchId?: string;
products: MchatProduct[];
title: string;
subTitle: string;
noat: string;
nhat: string;
ttd: string;
referenceNumber: string;
expireTime: string;
}
interface MchatOnlineQrGenerateResponse {
qr: string;
code: number;
message: string;
}
interface MchatOnlineQrCheckResponse {
status: string;
code: number;
message: string;
id?: string;
whoPaid?: string;
userRefId?: string;
}
declare class MongolchatClient {
private endpoint;
private apiKey;
private workerKey;
private appSecret;
private branchNo;
constructor(config: MongolchatConfig);
private sleep;
private makeRequest;
private httpRequest;
generateQR(input: MchatOnlineQrGenerateRequest): Promise<MchatOnlineQrGenerateResponse>;
checkQR(qr: string): Promise<MchatOnlineQrCheckResponse>;
}
declare const MchatAuth: {
readonly url: "/application/auth";
readonly method: "GET";
};
declare const MchatOnlineQrGenerate: {
readonly url: "/worker/onlineqr/generate";
readonly method: "POST";
};
declare const MchatOnlineQrcheck: {
readonly url: "/worker/onlineqr/status";
readonly method: "POST";
};
declare const MchatTransactionSettlement: {
readonly url: "/worker/settle/upload";
readonly method: "POST";
};
interface PassConfig {
endpoint: string;
ecommerceToken: string;
callback: string;
}
interface BaseError {
code: string;
level: string;
body: string;
}
interface CreateOrderInput {
ecommerceToken: string;
amount: number;
callbackUrl: string;
}
interface RetCreateOrder {
shop: string;
amount: string;
orderId: string;
orderTtl: number;
dbRefNo: string;
}
interface CreateOrderResponse {
statusCode: string;
ret?: RetCreateOrder;
msg?: BaseError;
}
interface OrderInqueryInput {
ecommerceToken: string;
orderId: string;
}
interface CustomerData {
userId: string;
uniqueId: string;
}
interface LoyaltyData {
kbStatus: string;
kbTxnId: string;
kbCardId: string;
kbUsableLp: string;
kbLoyaltyPk: string;
hasKbLoyalty: string;
kbDescription: string;
kbLimitValue: string;
kbLoyaltyType: string;
kbDatesOfWeek: string;
kbNoTxnAmount: string;
kbYesTxnAmount: string;
kbLoyaltyProviderName: string;
}
interface ExtraData {
id: string;
pan: string;
rrn: string;
amount: string;
posId: string;
orderId: string;
respMsg: string;
traceNo: string;
dateTime: string;
respCode: string;
terminalId: string;
approvedCode: string;
currencyCode: string;
paymentRequestId: string;
}
interface RetInqueryOrder {
respCode: string;
respMsg: string;
status: string;
amount: string;
customerData?: CustomerData;
loyaltyData?: LoyaltyData;
dbRefNo: string;
extraData?: ExtraData;
statusText: string;
}
interface OrderInqueryResponse {
statusCode: string;
ret?: RetInqueryOrder;
msg?: BaseError;
}
interface OrderNotifyInput {
ecommerceToken: string;
orderId: string;
phone: string;
}
interface Datum {
success: boolean;
messageId: string;
}
interface RetNotifyOrder {
respCode: string;
respMsg: string;
success: number;
data: Datum[];
}
interface OrderNotifyResponse {
statusCode: string;
ret?: RetNotifyOrder;
msg?: BaseError;
}
interface OrderCancelInput {
ecommerceToken: string;
orderId: string;
}
interface RetOrderCancel {
respCode: string;
respMsg: string;
status: string;
amount: string;
loyaltyData: any;
dbRefNo: string;
}
interface OrderCancelResponse {
statusCode: string;
ret?: RetOrderCancel;
msg?: BaseError;
}
interface OrderVoidInput {
ecommerceToken: string;
orderId: string;
}
interface RetOrderVoid {
respCode: string;
respMsg: string;
status: string;
amount: string;
loyaltyData: any;
dbRefNo: string;
serviceName: string;
dateTime: string;
traceNo: string;
rrn: string;
terminalId: string;
merchantId: string;
}
interface OrderVoidResponse {
statusCode: string;
ret?: RetOrderVoid;
msg?: BaseError;
}
interface WebhookCallbackResponse {
orderId: string;
paymentRequestId: string;
posId: string;
operation: string;
isSuccess: boolean;
amount: string;
createdTime: string;
customerData?: CustomerData;
extraData?: Record<string, string>;
dbRefNo: string;
}
declare class PassClient {
private endpoint;
private ecommerceToken;
private callback;
constructor(config: PassConfig);
private sleep;
private makeRequest;
private httpRequestPass;
createOrder(amount: number, callbackParams: Record<string, string>): Promise<CreateOrderResponse>;
inqueryOrder(orderId: string): Promise<OrderInqueryResponse>;
notifyOrder(orderId: string, phone: string): Promise<OrderNotifyResponse>;
cancelOrder(orderId: string): Promise<OrderCancelResponse>;
voidOrder(orderId: string): Promise<OrderVoidResponse>;
}
interface SocialPayConfig {
endpoint: string;
}
interface UPointCheckUserInfoInput {
card_number: string;
mobile: string;
pin_code: string;
}
interface UpointProcessTransactionInput {
mobile: string;
card_number: string;
}
interface SocialPayInvoicePhoneRequest {
phone: string;
amount: string;
invoice: string;
terminal: string;
checksum: string;
}
interface SocialPayInvoiceSimpleRequest {
amount: string;
invoice: string;
terminal: string;
checksum: string;
}
interface SocialPaySettlementRequest {
settlementId: string;
checksum: string;
terminal: string;
}
interface SocialPaySimpleResponse {
desc: string;
status: string;
}
interface SocialPayTransactionResponse {
approval_code: string;
amount: number;
card_number: string;
resp_desc: string;
resp_code: string;
terminal: string;
invoice: string;
checksum: string;
}
interface SocialPayPaymentSettlementResponse {
amount: number;
count: number;
status: string;
}
interface SocialPayErrorResponse {
errorDesc: string;
errorType: string;
}
interface Header {
status: string;
code: number;
}
interface Body {
response: Record<string, any>;
error: Record<string, any>;
}
interface Response {
header: Header;
body: Body;
}
declare class SocialPayClient {
private endpoint;
constructor(config: SocialPayConfig);
private httpRequest;
createInvoicePhone(request: SocialPayInvoicePhoneRequest): Promise<SocialPayTransactionResponse>;
createInvoiceQr(request: SocialPayInvoiceSimpleRequest): Promise<SocialPayTransactionResponse>;
cancelInvoice(request: SocialPayInvoiceSimpleRequest): Promise<SocialPaySimpleResponse>;
checkInvoice(request: SocialPayInvoiceSimpleRequest): Promise<SocialPayTransactionResponse>;
cancelPayment(request: SocialPayInvoiceSimpleRequest): Promise<SocialPaySimpleResponse>;
settlement(request: SocialPaySettlementRequest): Promise<SocialPayPaymentSettlementResponse>;
}
declare const SocialPayInvoicePhone: {
readonly url: "/pos/invoice/phone";
readonly method: "POST";
};
declare const SocialPayInvoiceQr: {
readonly url: "/pos/invoice/qr";
readonly method: "POST";
};
declare const SocialPayInvoiceCancel: {
readonly url: "/pos/invoice/cancel";
readonly method: "POST";
};
declare const SocialPayInvoiceCheck: {
readonly url: "/pos/invoice/check";
readonly method: "POST";
};
declare const SocialPayPaymentCancel: {
readonly url: "/pos/payment/cancel";
readonly method: "POST";
};
declare const SocialPayPaymentSettlement: {
readonly url: "/pos/settlement";
readonly method: "POST";
};
interface StorepayConfig {
appUsername: string;
appPassword: string;
username: string;
password: string;
authUrl: string;
baseUrl: string;
storeId: string;
callbackUrl: string;
}
interface StorepayLoginResponse {
token_type: string;
refresh_token: string;
access_token: string;
expires_in: number;
scope: string;
current_store_id: number;
user_id: number;
role_id: RoleStruct;
jti: string;
}
interface RoleStruct {
id: number;
code: string;
description: string;
authority: string;
}
interface StorepayLoanInput {
description: string;
mobileNumber: string;
amount: number;
}
interface StorepayLoanRequest {
storeId: string;
mobileNumber: string;
description: string;
amount: string;
callbackUrl: string;
}
interface MsgStruct {
code: string;
text: string;
params: string;
}
interface StorepayLoanResponse {
value: number;
msgList: MsgStruct[];
attrs: any;
status: string;
}
interface StorepayCheckResponse {
value: boolean;
msgList: MsgStruct[];
attrs: any;
status: string;
}
interface StorepayUserCheckRequest {
mobileNumber: string;
}
interface StorepayUserCheckResponse {
value: number;
msgList: MsgStruct[];
attrs: any;
status: string;
}
declare class StorepayClient {
private appUsername;
private appPassword;
private username;
private password;
private authUrl;
private baseUrl;
private storeId;
private callbackUrl;
private expireIn;
private loginObject;
constructor(config: StorepayConfig);
private sleep;
private makeRequest;
private httpRequest;
private authStorepay;
loan(input: StorepayLoanInput): Promise<number>;
loanCheck(id: string): Promise<boolean>;
userPossibleAmount(mobileNumber: string): Promise<number>;
close(): void;
}
declare const StorepayAuth: {
readonly url: "/oauth/token";
readonly method: "POST";
};
declare const StorepayLoan: {
readonly url: "/merchant/loan";
readonly method: "POST";
};
declare const StorepayLoanCheck: {
readonly url: "/merchant/loan/check/";
readonly method: "GET";
};
declare const StorepayUserPossibleAmount: {
readonly url: "/user/possibleAmount";
readonly method: "POST";
};
interface TokipayConfig {
endpoint: string;
apiKey: string;
imApiKey: string;
authorization: string;
merchantId: string;
successUrl: string;
failureUrl: string;
appSchemaIos: string;
}
interface TokipayPaymentInput {
orderId: string;
amount: number;
notes: string;
phoneNo?: string;
countryCode?: string;
requestId?: string;
successUrl?: string;
}
interface TokipayPaymentQrRequest {
successUrl: string;
failureUrl: string;
orderId: string;
merchantId: string;
amount: number;
notes: string;
authorization: string;
}
interface TokipayPaymentRequestResponse {
requestId: string;
}
interface TokipayPaymentResponse {
statusCode: number;
error: string;
message: string;
data: TokipayPaymentRequestResponse;
type: string;
}
interface TokipayPaymentStatusDataResponse {
status: string;
}
interface TokipayPaymentStatusResponse {
statusCode: number;
error: string;
message: string;
data: TokipayPaymentStatusDataResponse;
type: string;
}
interface TokipayPaymentResponseExt {
statusCode: number;
error: string;
message: string;
responseType: string;
}
interface TokipayPaymentSentUserRequest {
successUrl: string;
failureUrl: string;
orderId: string;
merchantId: string;
amount: number;
notes: string;
authorization: string;
phoneNo: string;
countryCode: string;
}
interface TokipayPaymentScanUserRequest {
successUrl: string;
failureUrl: string;
orderId: string;
merchantId: string;
amount: number;
notes: string;
authorization: string;
requestId: string;
}
interface TokipayRefundRequest {
requestId: string;
refundAmount: number;
merchantId: string;
}
interface TokipayRefundInput {
requestId: string;
refundAmount: number;
}
interface TokipayDeeplinkRequest {
successUrl: string;
failureUrl: string;
orderId: string;
merchantId: string;
amount: number;
notes: string;
appSchemaIos: string;
authorization: string;
tokiWebSuccessUrl: string;
tokiWebFailureUrl: string;
}
interface TokipayDeeplinkDataResponse {
deeplink: string;
}
interface TokipayDeeplinkResponse {
statusCode: number;
error: string;
message: string;
data: TokipayDeeplinkDataResponse;
type: string;
}
interface TokipayThirdPartyPhoneRequest {
successUrl: string;
failureUrl: string;
orderId: string;
merchantId: string;
amount: number;
notes: string;
phoneNo: string;
countryCode: string;
authorization: string;
tokiWebSuccessUrl: string;
tokiWebFailureUrl: string;
}
interface TokipayThirdPartyPhoneResponse {
statusCode: number;
error: string;
message: string;
data: any;
type: string;
}
declare class TokipayClient {
private endpoint;
private apiKey;
private imApiKey;
private authorization;
private merchantId;
private successUrl;
private failureUrl;
private appSchemaIos;
constructor(config: TokipayConfig);
private sleep;
private makeRequest;
private httpRequestPos;
private httpRequestThirdParty;
paymentQr(input: TokipayPaymentInput): Promise<TokipayPaymentResponse>;
paymentSentUser(input: TokipayPaymentInput): Promise<TokipayPaymentResponse>;
paymentScanUser(input: TokipayPaymentInput): Promise<TokipayPaymentResponse>;
paymentStatus(requestId: string): Promise<TokipayPaymentStatusResponse>;
paymentCancel(requestId: string): Promise<TokipayPaymentStatusResponse>;
paymentRefund(input: TokipayRefundInput): Promise<TokipayPaymentResponseExt>;
paymentThirdPartyDeeplink(input: TokipayPaymentInput): Promise<TokipayDeeplinkResponse>;
paymentThirdPartyPhoneRequest(input: TokipayPaymentInput): Promise<TokipayThirdPartyPhoneResponse>;
paymentThirdPartyStatus(requestId: string): Promise<TokipayPaymentStatusResponse>;
}
declare const TokipayPaymentQr: {
readonly url: "/jump/v4/spose/payment/request";
readonly method: "POST";
};
declare const TokipayPaymentSentUser: {
readonly url: "/jump/v4/spose/payment/user-request";
readonly method: "POST";
};
declare const TokipayPaymentScanUser: {
readonly url: "/jump/v4/spose/payment/scan/user-request";
readonly method: "POST";
};
declare const TokipayPaymentStatus: {
readonly url: "/jump/v4/spose/payment/status";
readonly method: "GET";
};
declare const TokipayPaymentCancel: {
readonly url: "/jump/v4/spose/payment/request";
readonly method: "DELETE";
};
declare const TokipayRefund: {
readonly url: "/jump/v4/spose/payment/refund";
readonly method: "PUT";
};
declare const TokipayDeeplink: {
readonly url: "/jump/v1/third-party/payment/deeplink";
readonly method: "POST";
};
declare const TokipayPhoneRequest: {
readonly url: "/jump/v1/third-party/payment/request";
readonly method: "POST";
};
declare const TokipayTransactionStatus: {
readonly url: "/jump/v1/third-party/payment/status";
readonly method: "GET";
};
interface MonpayConfig {
endpoint: string;
username: string;
accountId: string;
callbackUrl: string;
clientId: string;
clientSecret: string;
}
interface MonpayQrInput {
amount: number;
branchId: string;
products: Array<{
name: string;
quantity: number;
price: number;
}>;
title: string;
subTitle?: string;
noat?: string;
nhat?: string;
ttd?: string;
referenceNumber?: string;
expireTime?: number;
}
interface MonpayQrRequest {
amount: number;
branchId: string;
products: Array<{
name: string;
quantity: number;
price: number;
}>;
title: string;
subTitle?: string;
noat?: string;
nhat?: string;
ttd?: string;
referenceNumber?: string;
expireTime?: number;
}
interface MonpayResultQr {
qrcode: string;
uuid: string;
}
interface MonpayQrResponse {
code: number;
info: string;
result: MonpayResultQr;
}
interface MonpayResultCheck {
uuid: string;
usedAt: number;
usedById: number;
transactionId: string;
amount: number;
createdAt: number;
userPhone: string;
userAccountNo: string;
userVatId: string;
usedAtUI: string;
createdAtUI: string;
amountUI: string;
}
interface MonpayCheckResponse {
code: number;
info: string;
result: MonpayResultCheck;
}
interface MonpayCallback {
amount: number;
uuid: string;
status: string;
tnxId: string;
}
interface MonpayAccessToken {
accessToken: string;
tokenType: string;
expiresIn: number;
scope: string;
}
declare enum InvoiceType {
P2P = "P2P",// User to User
P2B = "P2B",// User to Merchant
B2B = "B2B",// Person to MF & MF to organization
PURCHASE = "PURCHASE"
}
declare enum Bank {
KHAN = "KHAN",
GOLOMT = "GOLOMT",
STATE = "STATE",
ULAANBAATAR = "ULAANBAATAR",
XAC = "XAC",
CAPITRON = "CAPITRON",
ARIG = "ARIG",
CHINGGIS = "CHINGGIS",
BOGD = "BOGD",
CREDIT = "CREDIT",
HUGJIL = "HUGJIL",
TURIIN_SAN = "TURIIN_SAN",
KHANBANK = "KHANBANK"
}
interface DeeplinkConfig {
endpoint: string;
clientId: string;
clientSecret: string;
grantType: string;
}
interface DeeplinkCreateRequest {
redirectUri: string;
amount: number;
clientServiceUrl: string;
receiver: string;
invoiceType: InvoiceType;
description: string;
}
interface DeeplinkCreateResult {
id: number;
receiver: string;
amount: number;
userId: number;
miniAppId: number;
createDate: Date;
updateDate: Date;
status: string;
description: string;
redirectUri: string;
invoiceType: InvoiceType;
}
interface DeeplinkCreateResponse {
code: string;
intCode: number;
info: string;
result: DeeplinkCreateResult;
}
interface DeeplinkCheckResult extends DeeplinkCreateResult {
statusInfo: string;
bankName?: Bank;
bankAccount?: string;
bankAccountName?: string;
}
interface DeeplinkCheckResponse {
code: string;
intCode: number;
info: string;
result: DeeplinkCheckResult;
}
interface DeeplinkCallback {
amount: number;
invoiceId: string;
status: string;
tnxId: string;
info: string;
}
declare class MonpayClient {
private endpoint;
private username;
private accountId;
constructor(config: MonpayConfig);
private httpRequest;
generateQr(input: MonpayQrInput): Promise<MonpayQrResponse>;
checkQr(uuid: string): Promise<MonpayResultCheck>;
}
declare class MonpayDeeplinkClient {
private endpoint;
private clientId;
private clientSecret;
private grantType;
private accessToken;
constructor(config: MonpayConfig);
private getAccessToken;
private httpRequest;
createInvoice(amount: number, description: string, type?: InvoiceType, bank?: Bank): Promise<DeeplinkCreateResponse>;
checkInvoice(invoiceId: string): Promise<DeeplinkCheckResponse>;
}
declare const MonpayGenerateQr: {
readonly url: "/rest/branch/qrpurchase/generate";
readonly method: "POST";
};
declare const MonpayCheckQr: {
readonly url: "/rest/branch/qrpurchase/check";
readonly method: "GET";
};
declare const MonpayDeeplinkCreate: {
readonly url: "/api/oauth/invoice";
readonly method: "POST";
};
declare const MonpayDeeplinkCheck: {
readonly url: "/api/oauth/invoice/";
readonly method: "GET";
};
declare const MonpayDeeplinkAuth: {
readonly url: "/oauth/token";
readonly method: "POST";
};
interface TdbCgConfig {
endpoint: string;
loginId: string;
clientSecret: string;
password: string;
certPass: string;
certPathPfx: string;
certPathCer: string;
anyBic: string;
roleId: string;
}
interface TdbCgAuthTokenRequest {
grantType: string;
clientId: string;
clientSecret: string;
}
interface TdbCgAuthTokenResponse {
accessToken: string;
tokenType: string;
expiresIn: number;
refreshToken: string;
scope: string;
}
interface TdbCgAuthRefreshRequest {
refreshToken: string;
}
interface TdbCgPaymentGetRequest {
paymentId: string;
}
interface TdbCgPaymentGetResponse {
paymentId: string;
status: string;
amount: number;
currency: string;
description: string;
createdAt: string;
updatedAt: string;
}
interface TdbCgPaymentCheckRequest {
paymentId: string;
}
interface TdbCgPaymentCheckResponse {
paymentId: string;
status: string;
amount: number;
currency: string;
description: string;
createdAt: string;
updatedAt: string;
}
interface TdbCgInvoiceCreateRequest {
amount: number;
currency: string;
description: string;
callbackUrl: string;
successUrl: string;
failureUrl: string;
}
interface TdbCgInvoiceCreateResponse {
invoiceId: string;
qrData: string;
urls: {
callback: string;
success: string;
failure: string;
};
amount: number;
currency: string;
description: string;
status: string;
createdAt: string;
}
interface TdbCgInvoiceGetRequest {
invoiceId: string;
}
interface TdbCgInvoiceGetResponse {
invoiceId: string;
qrData: string;
urls: {
callback: string;
success: string;
failure: string;
};
amount: number;
currency: string;
description: string;
status: string;
createdAt: string;
updatedAt: string;
}
declare class TdbCgClient {
private endpoint;
private loginId;
private clientSecret;
private password;
private certPass;
private certPathPfx;
private certPathCer;
private anyBic;
private roleId;
constructor(config: TdbCgConfig);
private sleep;
private httpRequest;
getAuthToken(request: TdbCgAuthTokenRequest): Promise<TdbCgAuthTokenResponse>;
refreshAuthToken(request: TdbCgAuthRefreshRequest): Promise<TdbCgAuthTokenResponse>;
getPayment(request: TdbCgPaymentGetRequest): Promise<TdbCgPaymentGetResponse>;
checkPayment(request: TdbCgPaymentCheckRequest): Promise<TdbCgPaymentCheckResponse>;
createInvoice(request: TdbCgInvoiceCreateRequest): Promise<TdbCgInvoiceCreateResponse>;
getInvoice(request: TdbCgInvoiceGetRequest): Promise<TdbCgInvoiceGetResponse>;
}
export { Bank, type BaseError, type Body, type ByTokenRequest, type ByTokenResponse, type CheckAPIItem, type CheckResponse, type CheckoutItem, type CreateEbarimtInput, type CreateEbarimtRequest, type CreateEbarimtResponse, type CreateInvoiceInput, type CreateInvoiceRequest, type CreateInvoiceResponse, type CreateOrderInput, type CreateOrderResponse, type CustomerData, type Data, type Datum, type Deeplink, type DeeplinkCallback, type DeeplinkCheckResponse, type DeeplinkCheckResult, type DeeplinkConfig, type DeeplinkCreateRequest, type DeeplinkCreateResponse, type DeeplinkCreateResult, type Details, EbarimtClient, type EbarimtConfig, type ExtraData, GolomtClient, type GolomtConfig, type GolomtError, type Header, type HipayCheckoutGetResponse, type HipayCheckoutRequest, type HipayCheckoutResponse, HipayClient, type HipayConfig, type HipayPaymentCorrectionRequest, type HipayPaymentCorrectionResponse, type HipayPaymentGetResponse, type HipayStatementRequest, type HipayStatementResponse, type InquiryRequest, type InquiryResponse, InvoiceType, type Lang, type List, type LoyaltyData, MchatAuth, type MchatOnlineQrCheckResponse, MchatOnlineQrGenerate, type MchatOnlineQrGenerateRequest, type MchatOnlineQrGenerateResponse, MchatOnlineQrcheck, type MchatProduct, type MchatQrGenerateInput, MchatTransactionSettlement, type MchatWebookInput, type MchatWebookOrder, type MchatWebookQuickpay, type MchatWebookScanQR, MongolchatClient, type MongolchatConfig, type MonpayAccessToken, type MonpayCallback, MonpayCheckQr, type MonpayCheckResponse, MonpayClient, type MonpayConfig, MonpayDeeplinkAuth, MonpayDeeplinkCheck, MonpayDeeplinkClient, MonpayDeeplinkCreate, MonpayGenerateQr, type MonpayQrInput, type MonpayQrRequest, type MonpayQrResponse, type MonpayResultCheck, type MonpayResultQr, type MsgStruct, type OrderCancelInput, type OrderCancelResponse, type OrderInqueryInput, type OrderInqueryResponse, type OrderNotifyInput, type OrderNotifyResponse, type OrderVoidInput, type OrderVoidResponse, PassClient, type PassConfig, type PaymentMethod, QPay, QPayAuthRefresh, QPayAuthToken, type QPayConfig, type QPayCreateInvoiceInput, type QPayInput, QPayInvoiceCancel, QPayInvoiceCreate, QPayInvoiceGet, type QPayInvoiceGetResponse, type QPayLine, type QPayLoginResponse, QPayPaymentCancel, type QPayPaymentCancelRequest, QPayPaymentCheck, type QPayPaymentCheckRequest, type QPayPaymentCheckResponse, QPayPaymentGet, QPayPaymentList, type QPayPaymentListRequest, QPayPaymentRefund, type QPaySimpleInvoiceRequest, type QPaySimpleInvoiceResponse, type QPayTransaction, QpayClient, type Response, type RetCreateOrder, type RetInqueryOrder, type RetNotifyOrder, type RetOrderCancel, type RetOrderVoid, type ReturnBillResponse, type ReturnType, type RoleStruct, type Signal, SocialPayClient, type SocialPayConfig, type SocialPayErrorResponse, SocialPayInvoiceCancel, SocialPayInvoiceCheck, SocialPayInvoicePhone, type SocialPayInvoicePhoneRequest, SocialPayInvoiceQr, type SocialPayInvoiceSimpleRequest, SocialPayPaymentCancel, SocialPayPaymentSettlement, type SocialPayPaymentSettlementResponse, type SocialPaySettlementRequest, type SocialPaySimpleResponse, type SocialPayTransactionResponse, type Stock, type StockInput, StorepayAuth, type StorepayCheckResponse, StorepayClient, type StorepayConfig, StorepayLoan, StorepayLoanCheck, type StorepayLoanInput, type StorepayLoanRequest, type StorepayLoanResponse, type StorepayLoginResponse, type StorepayUserCheckRequest, type StorepayUserCheckResponse, StorepayUserPossibleAmount, type TdbCgAuthRefreshRequest, type TdbCgAuthTokenRequest, type TdbCgAuthTokenResponse, TdbCgClient, type TdbCgConfig, type TdbCgInvoiceCreateRequest, type TdbCgInvoiceCreateResponse, type TdbCgInvoiceGetRequest, type TdbCgInvoiceGetResponse, type TdbCgPaymentCheckRequest, type TdbCgPaymentCheckResponse, type TdbCgPaymentGetRequest, type TdbCgPaymentGetResponse, TokipayClient, type TokipayConfig, TokipayDeeplink, type TokipayDeeplinkDataResponse, type TokipayDeeplinkRequest, type TokipayDeeplinkResponse, TokipayPaymentCancel, type TokipayPaymentInput, TokipayPaymentQr, type TokipayPaymentQrRequest, type TokipayPaymentRequestResponse, type TokipayPaymentResponse, type TokipayPaymentResponseExt, TokipayPaymentScanUser, type TokipayPaymentScanUserRequest, TokipayPaymentSentUser, type TokipayPaymentSentUserRequest, TokipayPaymentStatus, type TokipayPaymentStatusDataResponse, type TokipayPaymentStatusResponse, TokipayPhoneRequest, TokipayRefund, type TokipayRefundInput, type TokipayRefundRequest, type TokipayThirdPartyPhoneRequest, type TokipayThirdPartyPhoneResponse, TokipayTransactionStatus, type UPointCheckUserInfoInput, type UpointProcessTransactionInput, type WebhookCallbackResponse };