mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-31 12:59:35 +08:00
临时提交
This commit is contained in:
@@ -13,6 +13,7 @@ import com.egzosn.pay.demo.entity.PayType;
|
||||
import com.egzosn.pay.demo.request.QueryOrder;
|
||||
import com.egzosn.pay.demo.service.ApyAccountService;
|
||||
import com.egzosn.pay.demo.service.PayResponse;
|
||||
import com.egzosn.pay.payoneer.api.PayoneerPayService;
|
||||
import com.egzosn.pay.wx.bean.WxTransactionType;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -26,6 +27,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -50,6 +52,38 @@ public class PayController {
|
||||
return new ModelAndView("/index.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取授权页面
|
||||
* @param payId
|
||||
* @param payeeId
|
||||
* @param authPageType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("getAuthorizationPage.json")
|
||||
public Map<String ,Object> getAuthorizationPage(Integer payId,String payeeId,AuthPageType authPageType ){
|
||||
PayResponse payResponse = service.getPayResponse(payId);
|
||||
PayoneerPayService payoneerPayService = (PayoneerPayService) payResponse.getService();
|
||||
Map<String, Object> data = new LinkedHashMap<>();
|
||||
data.put("code", 0);
|
||||
data.put("url", payoneerPayService.getAuthorizationPage(payeeId,authPageType));
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起收款申请
|
||||
* @param payId 账户id
|
||||
* @param payeeId 授权id(收款id)
|
||||
* @param payOrder 订单信息
|
||||
* @return 收款请求结果
|
||||
*/
|
||||
@RequestMapping("charge")
|
||||
public Map<String ,Object> charge(Integer payId,String payeeId,PayOrder payOrder){
|
||||
PayResponse payResponse = service.getPayResponse(payId);
|
||||
PayoneerPayService service = (PayoneerPayService) payResponse.getService();
|
||||
return service.charge(payeeId,payOrder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 这里模拟账户信息增加
|
||||
*
|
||||
|
||||
@@ -99,6 +99,15 @@ public class ApyAccountRepository {
|
||||
apyAccount4.setTest(true);
|
||||
apyAccounts.put(apyAccount4.getPayId(), apyAccount4);
|
||||
|
||||
ApyAccount apyAccount5 = new ApyAccount();
|
||||
apyAccount5.setPayId(5);
|
||||
apyAccount5.setPartner("100086190");//Program ID
|
||||
apyAccount5.setSeller("Huodull6190");//Username
|
||||
apyAccount5.setStorePassword("12BkDT8152Zj");//API password
|
||||
apyAccount5.setInputCharset("UTF-8");
|
||||
apyAccount5.setPayType(PayType.payoneer);
|
||||
apyAccount5.setMsgType(MsgType.json);
|
||||
apyAccounts.put(apyAccount5.getPayId(), apyAccount5);
|
||||
}
|
||||
//_____________________________________________________________
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.egzosn.pay.ali.bean.AliTransactionType;
|
||||
import com.egzosn.pay.common.api.PayService;
|
||||
import com.egzosn.pay.common.bean.BasePayType;
|
||||
import com.egzosn.pay.common.bean.TransactionType;
|
||||
import com.egzosn.pay.common.http.HttpConfigStorage;
|
||||
import com.egzosn.pay.fuiou.api.FuiouPayConfigStorage;
|
||||
import com.egzosn.pay.fuiou.api.FuiouPayService;
|
||||
import com.egzosn.pay.fuiou.bean.FuiouTransactionType;
|
||||
@@ -178,8 +179,6 @@ public enum PayType implements BasePayType {
|
||||
public PayService getPayService(ApyAccount apyAccount) {
|
||||
PayoneerConfigStorage payoneerConfigStorage = new PayoneerConfigStorage();
|
||||
payoneerConfigStorage.setProgramId(apyAccount.getPartner());
|
||||
payoneerConfigStorage.setApiUserName(apyAccount.getSeller());
|
||||
payoneerConfigStorage.setApiPassword(apyAccount.getStorePassword());
|
||||
payoneerConfigStorage.setKeyPublic(apyAccount.getPublicKey());
|
||||
payoneerConfigStorage.setKeyPrivate(apyAccount.getPrivateKey());
|
||||
payoneerConfigStorage.setNotifyUrl(apyAccount.getNotifyUrl());
|
||||
@@ -189,7 +188,12 @@ public enum PayType implements BasePayType {
|
||||
payoneerConfigStorage.setMsgType(apyAccount.getMsgType());
|
||||
payoneerConfigStorage.setInputCharset(apyAccount.getInputCharset());
|
||||
payoneerConfigStorage.setTest(apyAccount.isTest());
|
||||
return new PayoneerPayService(payoneerConfigStorage);
|
||||
|
||||
//Basic Auth
|
||||
HttpConfigStorage httpConfigStorage = new HttpConfigStorage();
|
||||
httpConfigStorage.setHttpProxyUsername(apyAccount.getSeller());
|
||||
httpConfigStorage.setHttpProxyPassword(apyAccount.getStorePassword());
|
||||
return new PayoneerPayService(payoneerConfigStorage,httpConfigStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user