Comprehensive Java SDK for integrating with WeChat Pay services including unified orders, refunds, enterprise payments, red packets, profit sharing, and marketing services
—
Specialized services including e-commerce platform support, marketing coupons, transfer services, Pay Score, complaint management, and bill downloads.
Manage marketing coupons and promotional campaigns.
/**
* Get marketing favor service for coupon management
* @return Marketing favor service instance
*/
MarketingFavorService getMarketingFavorService();
/**
* Get marketing business favor service
* @return Business favor service instance
*/
MarketingBusiFavorService getMarketingBusiFavorService();Usage Example:
// Create coupon stock
MarketingFavorService favorService = wxPayService.getMarketingFavorService();
CreateStockRequest request = new CreateStockRequest();
// Configure coupon details...
CreateStockResult result = favorService.createStock(request);Support for multi-merchant e-commerce platforms.
/**
* Get e-commerce service for platform operations
* @return E-commerce service instance
*/
EcommerceService getEcommerceService();Various transfer and payout services.
/**
* Get general transfer service
* @return Transfer service instance
*/
TransferService getTransferService();
/**
* Get merchant transfer service
* @return Merchant transfer service instance
*/
MerchantTransferService getMerchantTransferService();
/**
* Get brand merchant transfer service
* @return Brand merchant transfer service instance
*/
BrandMerchantTransferService getBrandMerchantTransferService();
/**
* Get partner transfer service (for service providers)
* @return Partner transfer service instance
*/
PartnerTransferService getPartnerTransferService();Credit-based payment and scoring services.
/**
* Get Pay Score service
* @return Pay Score service instance
*/
PayScoreService getPayScoreService();
/**
* Get partner Pay Score service
* @return Partner Pay Score service instance
*/
PartnerPayScoreService getPartnerPayScoreService();
/**
* Get partner Pay Score sign plan service
* @return Partner Pay Score sign plan service instance
*/
PartnerPayScoreSignPlanService getPartnerPayScoreSignPlanService();Download transaction and settlement reports with support for both v2 and v3 APIs.
/**
* Download bill data using parameters
* @param billDate Bill date (YYYYMMDD format)
* @param billType Bill type (ALL, SUCCESS, REFUND)
* @param tarType Archive type (GZIP or null)
* @param deviceInfo Device info (optional)
* @return Bill data result
* @throws WxPayException if download fails
*/
WxPayBillResult downloadBill(String billDate, String billType, String tarType, String deviceInfo) throws WxPayException;
/**
* Download bill data using request object
* @param request Bill download request
* @return Bill data result
* @throws WxPayException if download fails
*/
WxPayBillResult downloadBill(WxPayDownloadBillRequest request) throws WxPayException;
/**
* Download raw bill data as string
* @param request Bill download request
* @return Raw bill data
* @throws WxPayException if download fails
*/
String downloadRawBill(WxPayDownloadBillRequest request) throws WxPayException;
/**
* Download fund flow data
* @param billDate Bill date (YYYYMMDD format)
* @param accountType Account type (Basic, Operation, Fees)
* @param tarType Archive type (GZIP or null)
* @return Fund flow result
* @throws WxPayException if download fails
*/
WxPayFundFlowResult downloadFundFlow(String billDate, String accountType, String tarType) throws WxPayException;
/**
* Download fund flow data using request object
* @param request Fund flow request
* @return Fund flow result
* @throws WxPayException if download fails
*/
WxPayFundFlowResult downloadFundFlow(WxPayDownloadFundFlowRequest request) throws WxPayException;
/**
* Apply for trade bill download (API v3)
* @param request Trade bill request
* @return Bill application result with download URL
* @throws WxPayException if request fails
*/
WxPayApplyBillV3Result applyTradeBill(WxPayApplyTradeBillV3Request request) throws WxPayException;
/**
* Apply for fund flow bill download (API v3)
* @param request Fund flow bill request
* @return Bill application result with download URL
* @throws WxPayException if request fails
*/
WxPayApplyBillV3Result applyFundFlowBill(WxPayApplyFundFlowBillV3Request request) throws WxPayException;
/**
* Download bill from URL (API v3)
* @param url Download URL from bill application
* @return Bill data stream
* @throws WxPayException if download fails
*/
InputStream downloadBill(String url) throws WxPayException;Usage Example:
// Download daily transaction bill
WxPayBillRequest billRequest = WxPayBillRequest.newBuilder()
.billDate("20230101")
.billType(WxPayConstants.BillType.ALL)
.build();
WxPayBillResult billResult = wxPayService.downloadBill(billRequest);
String billData = billResult.getBillInfo();Handle customer complaints and disputes.
/**
* Get complaints service
* @return Complaint service instance
*/
ComplaintService getComplaintsService();Upload images and other media for marketing and documentation.
/**
* Get merchant media service
* @return Media upload service instance
*/
MerchantMediaService getMerchantMediaService();
/**
* Get marketing media service
* @return Marketing media service instance
*/
MarketingMediaService getMarketingMediaService();Bank-related operations and queries.
/**
* Get bank service
* @return Bank service instance
*/
BankService getBankService();Merchant application and onboarding services.
/**
* Get sub-merchant application service
* @return Application service instance
*/
Applyment4SubService getApplyment4SubService();
/**
* Get subject confirmation service
* @return Subject confirmation service instance
*/
Apply4SubjectConfirmService getApply4SubjectConfirmService();Employee payroll and wage payment services.
/**
* Get payroll service for employee payments
* @return Payroll service instance
*/
PayrollService getPayrollService();Smart business circle and location-based services.
/**
* Get business circle service
* @return Business circle service instance
*/
BusinessCircleService getBusinessCircleService();Support for facial recognition payments.
/**
* Get face authentication info for face payment setup
* @param request Face auth info request
* @return Face authentication result
* @throws WxPayException if authentication fails
*/
WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException;
/**
* Process face payment
* @param request Face payment request
* @return Face payment result
* @throws WxPayException if payment fails
*/
WxPayFacepayResult facepay(WxPayFacepayRequest request) throws WxPayException;WeChat Pay coupon distribution and management.
/**
* Send coupon to user
* @param request Coupon send request
* @return Coupon send result
* @throws WxPayException if sending fails
*/
WxPayCouponSendResult sendCoupon(WxPayCouponSendRequest request) throws WxPayException;
/**
* Query coupon stock information
* @param request Coupon stock query request
* @return Coupon stock information
* @throws WxPayException if query fails
*/
WxPayCouponStockQueryResult queryCouponStock(WxPayCouponStockQueryRequest request) throws WxPayException;
/**
* Query specific coupon information
* @param request Coupon info query request
* @return Coupon detailed information
* @throws WxPayException if query fails
*/
WxPayCouponInfoQueryResult queryCouponInfo(WxPayCouponInfoQueryRequest request) throws WxPayException;/**
* Query customer comments (for service improvement)
* @param beginDate Start date for comment query
* @param endDate End date for comment query
* @param offset Query offset
* @param limit Query limit
* @return Comment data as JSON string
* @throws WxPayException if query fails
*/
String queryComment(Date beginDate, Date endDate, Integer offset, Integer limit) throws WxPayException;
/**
* Query comment using request object
* @param request Comment query request
* @return Comment data as JSON string
* @throws WxPayException if query fails
*/
String queryComment(WxPayQueryCommentRequest request) throws WxPayException;
/**
* Query exchange rate for foreign currency
* @param feeType Currency type
* @param date Query date
* @return Exchange rate result
* @throws WxPayException if query fails
*/
WxPayQueryExchangeRateResult queryExchangeRate(String feeType, String date) throws WxPayException;
/**
* Get sandbox sign key for testing
* @return Sandbox signature key
* @throws WxPayException if retrieval fails
*/
String getSandboxSignKey() throws WxPayException;
/**
* Report API call statistics (for monitoring)
* @param request Report request with call statistics
* @throws WxPayException if reporting fails
*/
void report(WxPayReportRequest request) throws WxPayException;// Get specialized service
MarketingFavorService favorService = wxPayService.getMarketingFavorService();
// Use service methods
CreateStockRequest request = new CreateStockRequest();
CreateStockResult result = favorService.createStock(request);// Combine multiple services
EcommerceService ecommerce = wxPayService.getEcommerceService();
TransferService transfer = wxPayService.getTransferService();
ComplaintService complaint = wxPayService.getComplaintService();
// Orchestrate complex business flows
// 1. Process e-commerce transaction
// 2. Handle transfers
// 3. Manage any complaintsclass BillType {
String ALL = "ALL"; // All transactions
String SUCCESS = "SUCCESS"; // Successful transactions only
String REFUND = "REFUND"; // Refund transactions only
String RECHARGE_REFUND = "RECHARGE_REFUND"; // Recharge refunds
}Install with Tessl CLI
npx tessl i tessl/maven-com-github-binarywang--weixin-java-pay