Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

零售小店SDK #190

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
| merchantexclusivecoupon | 商家券 |✔️|✔️|
| giftactivity | 支付有礼 |✔️|✔️|
| cashcoupons | 代金券 |✔️|✔️|
| retailstore | 零售小店 |✔️|✔️|
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.wechat.pay.java.service.retailstore;

import com.wechat.pay.java.core.RSAConfig;
import com.wechat.pay.java.service.retailstore.model.AddRepresentativeRequest;
import com.wechat.pay.java.service.retailstore.model.ApplyActivityRequest;
import com.wechat.pay.java.service.retailstore.model.ApplyActivityResponse;
import com.wechat.pay.java.service.retailstore.model.CreateMaterialsRequest;
import com.wechat.pay.java.service.retailstore.model.DeleteRepresentativeRequest;
import com.wechat.pay.java.service.retailstore.model.DeleteRepresentativeResponse;
import com.wechat.pay.java.service.retailstore.model.ListActsByAreaRequest;
import com.wechat.pay.java.service.retailstore.model.ListActsByAreaResponse;
import com.wechat.pay.java.service.retailstore.model.ListRepresentativeRequest;
import com.wechat.pay.java.service.retailstore.model.ListRepresentativeResponse;
import com.wechat.pay.java.service.retailstore.model.LockQualificationRequest;
import com.wechat.pay.java.service.retailstore.model.LockQualificationResponse;
import com.wechat.pay.java.service.retailstore.model.Materials;
import com.wechat.pay.java.service.retailstore.model.Representatives;
import com.wechat.pay.java.service.retailstore.model.UnlockQualificationRequest;
import com.wechat.pay.java.service.retailstore.model.UnlockQualificationResponse;

/** RetailStoreService使用示例 */
public class RetailStoreServiceExample {

public static String merchantId = "";
public static String privateKeyPath = "";
public static String merchantSerialNumber = "";
public static String wechatPayCertificatePath = "";
public static RetailStoreService service;

public static void main(String[] args) {
// 初始化商户配置
RSAConfig config =
new RSAConfig.Builder()
.merchantId(merchantId)
// 使用 com.wechat.pay.java.core.util 中的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名
.privateKeyFromPath(privateKeyPath)
.merchantSerialNumber(merchantSerialNumber)
.wechatPayCertificatesFromPath(wechatPayCertificatePath)
.build();

// 初始化服务
service = new RetailStoreService.Builder().config(config).build();
// ... 调用接口
}
/** 门店报名品牌加价购活动 */
public static ApplyActivityResponse applyActivity() {

ApplyActivityRequest request = new ApplyActivityRequest();
return service.applyActivity(request);
}
/** 按区域查询品牌加价购活动 */
public static ListActsByAreaResponse listActsByArea() {

ListActsByAreaRequest request = new ListActsByAreaRequest();
return service.listActsByArea(request);
}
/** 锁定品牌加价购活动资格 */
public static LockQualificationResponse lockQualification() {
LockQualificationRequest request = new LockQualificationRequest();
return service.lockQualification(request);
}
/** 解锁品牌加价购活动资格 */
public static UnlockQualificationResponse unlockQualification() {
UnlockQualificationRequest request = new UnlockQualificationRequest();
return service.unlockQualification(request);
}
/** 添加零售小店活动业务代理 */
public static Representatives addRepresentative() {

AddRepresentativeRequest request = new AddRepresentativeRequest();
return service.addRepresentative(request);
}
/** 生成小店活动物料码 */
public static Materials createMaterials() {

CreateMaterialsRequest request = new CreateMaterialsRequest();
return service.createMaterials(request);
}
/** 删除零售小店活动业务代理 */
public static DeleteRepresentativeResponse deleteRepresentative() {

DeleteRepresentativeRequest request = new DeleteRepresentativeRequest();
return service.deleteRepresentative(request);
}
/** 查询零售小店活动业务代理 */
public static ListRepresentativeResponse listRepresentative() {

ListRepresentativeRequest request = new ListRepresentativeRequest();
return service.listRepresentative(request);
}
}
Loading