mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
update
This commit is contained in:
@@ -1,37 +1,8 @@
|
|||||||
package com.jsowell.adapay.service;
|
package com.jsowell.adapay.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
|
||||||
import com.huifu.adapay.model.Payment;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AdapayService {
|
public class AdapayService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建交易对象
|
|
||||||
* createTransactionObject
|
|
||||||
*/
|
|
||||||
public void createTransactionObject() {
|
|
||||||
// 请求参数
|
|
||||||
Map<String, Object> paymentParams = Maps.newHashMap();
|
|
||||||
paymentParams.put("app_id", "app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa");
|
|
||||||
paymentParams.put("order_no", "2023050911410199622174123");
|
|
||||||
paymentParams.put("pay_channel", "wx_lite");
|
|
||||||
paymentParams.put("pay_amt", "0.01");
|
|
||||||
paymentParams.put("currency", "cny");
|
|
||||||
paymentParams.put("goods_title", "测试商品");
|
|
||||||
paymentParams.put("goods_desc", "用于支付流程测试的商品");
|
|
||||||
// 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:" + JSON.toJSONString(response));
|
|
||||||
} catch (BaseAdaPayException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user