支付宝转账收款账户类型定义与实现

This commit is contained in:
egan
2018-09-28 20:57:54 +08:00
parent aff3d0c6a5
commit e0c89ed488
2 changed files with 45 additions and 0 deletions

View File

@@ -480,7 +480,11 @@ public class AliPayService extends BasePayService {
Map<String, Object> bizContent = new TreeMap<String, Object>();
bizContent.put("out_biz_no", order.getOutNo());
//默认 支付宝登录号,支持邮箱和手机号格式。
bizContent.put("payee_type", "ALIPAY_LOGONID");
if (null != order.getTransferType()){
bizContent.put("payee_type", order.getTransferType().getType());
}
bizContent.put("payee_account", order.getPayeeAccount());
bizContent.put("amount", order.getAmount().setScale(2, BigDecimal.ROUND_HALF_UP));
bizContent.put("payer_show_name", order.getPayerName());

View File

@@ -0,0 +1,41 @@
package com.egzosn.pay.ali.bean;
import com.egzosn.pay.common.bean.TransferType;
/**
* 收款方账户类型
* @author egan
* email egzosn@gmail.com
* date 2018/9/28.20:32
*/
public enum AliTransferType implements TransferType {
/**
* 支付宝账号对应的支付宝唯一用户号。以2088开头的16位纯数字组成。
*/
ALIPAY_USERID,
/**
* 支付宝登录号,支持邮箱和手机号格式。
*/
ALIPAY_LOGONID
;
/**
* 获取转账类型
*
* @return 转账类型
*/
@Override
public String getType() {
return name();
}
/**
* 获取接口
*
* @return 接口
*/
@Override
public String getMethod() {
return name();
}
}