wechatpay-partner-v3
Version:
微信支付v3版本的SDK,基于wechatpay-node-v3 v2.2.1的修改,增加对合作伙伴模式的支持
296 lines (295 loc) • 6.84 kB
TypeScript
/// <reference types="node" />
interface Iamount {
total: number;
currency?: string;
}
interface Idetail {
cost_price?: number;
invoice_id?: string;
goods_detail?: IgoodsDetail[];
}
interface IgoodsDetail {
merchant_goods_id: string;
wechatpay_goods_id?: string;
goods_name?: string;
quantity: number;
unit_price: number;
}
interface Ipayer {
openid: string;
}
interface IsceneInfoH5 {
payer_client_ip: string;
device_id?: string;
store_info?: IstoreInfo;
h5_info: Ih5Info;
}
interface IsceneInfoNative {
payer_client_ip: string;
device_id?: string;
store_info?: IstoreInfo;
}
interface IstoreInfo {
id: string;
name?: string;
area_code?: string;
address?: string;
}
interface Ih5Info {
type: string;
app_name: string;
app_url?: string;
bundle_id?: string;
package_name?: string;
}
export interface Ioptions {
userAgent?: string;
authType?: string;
key?: string;
serial_no?: string;
}
export interface Ipay {
appid: string;
mchid: string;
serial_no?: string;
publicKey: Buffer;
privateKey: Buffer;
authType?: string;
userAgent?: string;
key?: string;
}
export interface Ih5 {
appid?: string;
mchid?: string;
description: string;
out_trade_no: string;
time_expire?: string;
attach?: string;
notify_url: string;
goods_tag?: string;
amount: Iamount;
detail?: Idetail;
scene_info: IsceneInfoH5;
}
export interface Inative {
appid?: string;
mchid?: string;
description: string;
out_trade_no: string;
time_expire?: string;
attach?: string;
notify_url: string;
goods_tag?: string;
support_fapiao?: boolean;
amount: Iamount;
detail?: Idetail;
scene_info?: IsceneInfoNative;
settle_info?: {
profit_sharing?: boolean;
};
}
export interface Ijsapi {
appid?: string;
mchid?: string;
description: string;
out_trade_no: string;
time_expire?: string;
attach?: string;
notify_url: string;
goods_tag?: string;
amount: Iamount;
payer: Ipayer;
detail?: Idetail;
scene_info?: IsceneInfoNative;
}
export interface IjsapiPartner {
sub_mchid: string;
description: string;
out_trade_no: string;
notify_url: string;
amount: Iamount;
payer: IpayerPartner;
}
export interface ISettle {
sub_mchid: string;
transaction_id: string;
out_order_no: string;
receivers: IReceiver[];
unfreeze_unsplit: boolean;
}
export interface ISettleUnfreeze {
sub_mchid: string;
transaction_id: string;
out_order_no: string;
description: string;
}
export interface IAddReceiver {
sub_mchid: string;
type: string;
account: string;
name: string;
relation_type: string;
unfreeze_unsplit: boolean;
}
interface IpayerPartner {
sp_openid: string;
}
export interface IReceiver {
type: string;
account: string;
amount: number;
description: string;
}
export interface Iapp {
appid?: string;
mchid?: string;
description: string;
out_trade_no: string;
time_expire?: string;
attach?: string;
notify_url: string;
goods_tag?: string;
amount: Iamount;
detail?: Idetail;
scene_info?: IsceneInfoNative;
}
export interface Iquery1 {
transaction_id: string;
out_trade_no?: string;
}
export interface Iquery2 {
transaction_id?: string;
out_trade_no: string;
}
export interface Iquery3 {
out_trade_no: string;
sub_mchid: string;
}
export interface Itradebill {
bill_date: string;
sub_mchid?: string;
bill_type: string;
tar_type?: string;
}
export interface Ifundflowbill {
bill_date: string;
account_type: string;
tar_type?: string;
}
export interface Irefunds {
out_refund_no: string;
reason?: string;
notify_url?: string;
funds_account?: string;
amount: IRamount;
goods_detail?: IRgoodsDetail[];
}
export interface Irefunds1 extends Irefunds {
transaction_id: string;
out_trade_no?: string;
}
export interface Irefunds2 extends Irefunds {
transaction_id?: string;
out_trade_no: string;
}
export interface IPartnerRefunds {
sub_mchid: string;
transaction_id?: string;
out_trade_no?: string;
out_refund_no: string;
reason?: string;
amount: IRefundamount;
notify_url?: string;
}
export interface IPartnerApply {
out_request_no: string;
organization_type: string;
business_license_info: IBusinessLicenseInfo;
id_doc_type: string;
id_card_info: IIdCardInfo;
owner: boolean;
account_info: IAccountInfo;
contact_info: IContactInfo;
sales_scene_info: ISalesSceneInfo;
merchant_shortname: string;
}
export interface IUpload {
filePath: string;
meta: IMete;
}
interface IMete {
filename: string;
sha256: string;
}
interface IBusinessLicenseInfo {
business_license_copy: string;
business_license_number: string;
merchant_name: string;
legal_person: string;
}
interface IIdCardInfo {
id_card_copy: string;
id_card_national: string;
id_card_name: string;
id_card_number: string;
id_card_address: string;
id_card_valid_time_begin: string;
id_card_valid_time: string;
}
interface IAccountInfo {
bank_account_type: number;
account_bank: string;
account_name: string;
bank_address_code: string;
bank_branch_id: string;
bank_name: string;
account_number: string;
}
interface IContactInfo {
contact_type: string;
contact_name: string;
contact_email: string;
contact_id_card_number: string;
contact_id_doc_copy: string;
contact_id_doc_copy_back: string;
contact_id_doc_period_begin: string;
contact_id_doc_period_end: string;
mobile_phone: string;
}
interface ISalesSceneInfo {
store_name: string;
}
interface IRefundamount {
refund: number;
total: number;
currency: string;
}
interface IRamount {
total: number;
currency: string;
refund: number;
}
interface IRgoodsDetail {
merchant_goods_id: string;
wechatpay_goods_id?: string;
goods_name?: string;
refund_quantity: number;
unit_price: number;
refund_amount: number;
}
/**
* 证书信息
*/
export interface ICertificates {
effective_time: string;
expire_time: string;
serial_no: string;
publicKey?: string;
encrypt_certificate: {
algorithm: string;
associated_data: string;
ciphertext: string;
nonce: string;
};
}
export {};