update 汇付

This commit is contained in:
2023-04-27 09:53:25 +08:00
parent 72a856ee7b
commit 36561d6169
5 changed files with 402 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.Payment;
import com.jsowell.JsowellApplication;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
@@ -154,6 +157,30 @@ public class SpringBootTestController {
@Autowired
private IPileAuthCardService pileAuthCardService;
/**
* 创建交易对象
*/
@Test
public void test() {
// 请求参数
Map<String, Object> paymentParams = Maps.newHashMap();
paymentParams.put("order_no", "fasdftawefawefawsdcaseg");
paymentParams.put("pay_amt", "0.05");
paymentParams.put("app_id", "api_test_a6ac1931-11d6-4d76-8e73-086f8219c9e7");
paymentParams.put("pay_channel", "wx_lite");
paymentParams.put("goods_title", "Your goods_title");
paymentParams.put("goods_desc", "Your goods_desc");
paymentParams.put("description", "payment Discription");
// paymentParams.put("div_members", [{"amount":"0.05", "fee_flag":"Y", "member_id":"member_id_test"}]);
// 调用创建方法,获取 Payment对象_
try {
Map<String, Object> response = Payment.create(paymentParams);
System.out.println(response);
} catch (BaseAdaPayException e) {
e.printStackTrace();
}
}
@Test
public void testupdateElecAmount() {
orderBasicInfoService.updateElecAmount();
@@ -755,7 +782,7 @@ public class SpringBootTestController {
}
@Test
public void testGetMemberToken(){
public void testGetMemberToken() {
String memberId = JWTUtils.getMemberId("eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NzY1MTY5MzgsImV4cCI6MTY3OTEwODkzOH0.4MwhZIOpnCfQloR7zEm2hwPOh2yyI2qxbBbTcv_SnZ4");
System.out.println(memberId);
}