Skip to main content
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
52%
Published
2 months ago (1.0.2)
class Pay
extends Base

Constructors

new
Pay(
appid: string,
mchid: string,
publicKey: Buffer,
privateKey: Buffer,
optipns?: Ioptions,
)

构造器

new
Pay(obj: Ipay)

构造器

new
Pay(
arg1: Ipay | string,
mchid?: string,
publicKey?: Buffer,
privateKey?: Buffer,
optipns?: Ioptions,
)

Properties

protected
appid: string
protected
authType: string
protected
httpService: IPayRequest
protected
abstract
key: string
protected
mchid: string
protected
abstract
privateKey: Buffer
abstract
protected
publicKey: Buffer
protected
serial_no: string

Methods

batches_transfer(params: BatchesTransfer.Input): Promise<BatchesTransfer.IOutput>

发起商家转账零钱

close(out_trade_no: string): Promise<Output>

关闭订单

combine_close(
combine_out_trade_no: string,
sub_orders: IcloseSubOrders[],
): Promise<Output>

合单关闭订单

combine_query(combine_out_trade_no: string): Promise<Output>

合单查询订单

combine_transactions_app(params: IcombineApp): Promise<Output>

合单app支付

combine_transactions_h5(params: IcombineH5): Promise<Output>

合单h5支付

combine_transactions_jsapi(params: IcombineJsapi): Promise<Output>

合单JSAPI支付 或者 小程序支付

combine_transactions_native(params: IcombineNative): Promise<Output>

合单native支付

createHttp(service: IPayRequest): void

自定义创建http 请求

create_profitsharing_orders(params: ProfitSharing.CreateProfitSharingOrders.Input): Promise<ProfitSharing.CreateProfitSharingOrders.IOutput>

请求分账API

decipher_gcm<T extends any>(
ciphertext: string,
associated_data: string,
nonce: string,
key?: string,
): T

回调解密

downloadBill(download_url: string): Promise<Output>

下载账单

private
fetchCertificates(apiSecret?: string): Promise<void>

拉取平台证书到 Pay.certificates 中

find_refunds(out_refund_no: string): Promise<FindRefunds.IOutput>

查询单笔退款

fundflowbill(params: Ifundflowbill): Promise<Output>

申请资金账单

getAuthorization(
nonce_str: string,
timestamp: string,
signature: string,
): string

获取授权认证信息

getSN(fileData?: string | Buffer): string
getSignature(
method: string,
nonce_str: string,
timestamp: string,
url: string,
body?: string | Record<string, any>,
): string

构建请求签名参数

get_certificates(apiSecret: string): Promise<ICertificates[]>

获取微信平台key

protected
init(
method: string,
url: string,
params?: Record<string, any>,
): string

参数初始化

privateDecrypt(
str: string,
padding?,
): string

敏感信息解密

profitsharing_bills(
bill_date: string,
tar_type?: string,
): Promise<ProfitSharing.ProfitSharingBills.IOutput>

申请分账账单API

profitsharing_orders_unfreeze(params: ProfitSharing.ProfitsharingOrdersUnfreeze.Input): Promise<ProfitSharing.ProfitsharingOrdersUnfreeze.IOutput>

解冻剩余资金API

profitsharing_receivers_add(params: ProfitSharing.ProfitSharingReceiversAdd.Input): Promise<ProfitSharing.ProfitSharingReceiversAdd.IOutput>

添加分账接收方API

profitsharing_receivers_delete(params: ProfitSharing.ProfitSharingReceiversDelete.Input): Promise<ProfitSharing.ProfitSharingReceiversDelete.IOutput>

删除分账接收方API

profitsharing_return_orders(params: ProfitSharing.ProfitSharingReturnOrders.Input): Promise<ProfitSharing.ProfitSharingReturnOrders.IOutput>

请求分账回退API

publicEncrypt(
str: string,
wxPublicKey: Buffer,
padding?,
): string

敏感信息加密

query(params: Iquery1 | Iquery2): Promise<Output>

查询订单

query_batches_transfer_detail(params: BatchesTransfer.QueryBatchesTransferDetail.Input): Promise<BatchesTransfer.QueryBatchesTransferDetail.IOutput>

商家明细单号查询明细单API

query_batches_transfer_detail_wx(params: BatchesTransfer.QueryBatchesTransferDetailByWx.Input): Promise<BatchesTransfer.QueryBatchesTransferDetailByWx.IOutput>

微信明细单号查询明细单API

query_batches_transfer_list(params: BatchesTransfer.QueryBatchesTransferList.Input): Promise<BatchesTransfer.QueryBatchesTransferList.IOutput>

商家批次单号查询批次单API

query_batches_transfer_list_wx(params: BatchesTransfer.QueryBatchesTransferByWx.Input): Promise<BatchesTransfer.QueryBatchesTransferByWx.IOutput>

微信批次单号查询批次单API

query_profitsharing_amounts(transaction_id: string): Promise<ProfitSharing.QueryProfitSharingAmounts.IOutput>

查询剩余待分金额API

query_profitsharing_orders(
transaction_id: string,
out_order_no: string,
): Promise<ProfitSharing.CreateProfitSharingOrders.IOutput>

查询分账结果API

query_profitsharing_return_orders(
out_return_no: string,
out_order_no: string,
): Promise<ProfitSharing.ProfitSharingReturnOrders.IOutput>

查询分账回退结果API

refunds(params: Irefunds1 | Irefunds2): Promise<Refunds.IOutput>

申请退款

SHA256withRSA

protected
sign(str: string): string
tradebill(params: Itradebill): Promise<Output>

申请交易账单

transactions_app(params: Iapp): Promise<Output>

app支付

transactions_h5(params: Ih5): Promise<Output>

h5支付

transactions_jsapi(params: Ijsapi): Promise<Output>

JSAPI支付 或者 小程序支付

transactions_native(params: Inative): Promise<Output>

native支付

verifySign(params: { timestamp: string | number; nonce: string; body: Record<string, any> | string; serial: string; signature: string; apiSecret?: string; }): Promise<boolean>

验证签名,提醒:node 取头部信息时需要用小写,例如:req.headers['wechatpay-timestamp']

Static Properties

protected
certificates: [key in string]: string

Add Package

deno add jsr:@ximagine/wechatpay-node-v3-axios

Import symbol

import { Pay } from "@ximagine/wechatpay-node-v3-axios";

---- OR ----

Import directly with a jsr specifier

import { Pay } from "jsr:@ximagine/wechatpay-node-v3-axios";

Add Package

npx jsr add @ximagine/wechatpay-node-v3-axios

Import symbol

import { Pay } from "@ximagine/wechatpay-node-v3-axios";

Add Package

yarn dlx jsr add @ximagine/wechatpay-node-v3-axios

Import symbol

import { Pay } from "@ximagine/wechatpay-node-v3-axios";

Add Package

pnpm dlx jsr add @ximagine/wechatpay-node-v3-axios

Import symbol

import { Pay } from "@ximagine/wechatpay-node-v3-axios";

Add Package

bunx jsr add @ximagine/wechatpay-node-v3-axios

Import symbol

import { Pay } from "@ximagine/wechatpay-node-v3-axios";