|
@@ -26,6 +26,10 @@ namespace WingPaymentService.Service
|
|
|
{
|
|
|
private string _alipayShortBaseUrl => EnvironmentConfigManager.GetParammeter<StringParameter>("Alipay", "PayShortBaseUrl").Value;
|
|
|
private string _wechatShortBaseUrl => EnvironmentConfigManager.GetParammeter<StringParameter>("WeChat", "PayShortBaseUrl").Value;
|
|
|
+ private string _alipayPayReturnUrl => EnvironmentConfigManager.GetParammeter<StringParameter>("Alipay", "PayReturnUrl").Value;
|
|
|
+ private string _wechatPayReturnUrl => EnvironmentConfigManager.GetParammeter<StringParameter>("WeChat", "PayReturnUrl").Value;
|
|
|
+ private bool _alipayPayEnable => EnvironmentConfigManager.GetParammeter<BoolParameter>("Alipay", "Enable").Value;
|
|
|
+ private bool _wechatPayEnable => EnvironmentConfigManager.GetParammeter<BoolParameter>("WeChat", "Enable").Value;
|
|
|
private IEducationService _educationService;
|
|
|
private IAuthenticationService _authenticationService;
|
|
|
private IPaymentDBService _paymentDBService;
|
|
@@ -113,7 +117,7 @@ namespace WingPaymentService.Service
|
|
|
{
|
|
|
case PayTypeEnum.Alipay_PAGE:
|
|
|
_recordRelation.AddOrUpdate(recordCode, request.OrderCode, (a,b)=> { return request.OrderCode; });
|
|
|
- payContent = _alipayCommon.AlipayPagePay(orderInfo.OrderTitle, orderInfo.OrderAmount, recordCode);
|
|
|
+ payContent = _alipayCommon.AlipayPagePay(orderInfo.OrderTitle, orderInfo.OrderAmount, recordCode, _alipayPayReturnUrl);
|
|
|
payUrlRequest.PaymentOrderCode = request.OrderCode;
|
|
|
payUrlRequest.PayLink = payContent.payUrl;
|
|
|
payUrlRequest.PayShortLink = string.Format(_alipayShortBaseUrl, payUrlRequest.PaymentOrderCode);
|
|
@@ -125,7 +129,7 @@ namespace WingPaymentService.Service
|
|
|
break;
|
|
|
case PayTypeEnum.Alipay_WAP:
|
|
|
_recordRelation.AddOrUpdate(recordCode, request.OrderCode, (a,b)=> { return request.OrderCode; });
|
|
|
- payContent = _alipayCommon.AlipayWapPay(orderInfo.OrderTitle, orderInfo.OrderAmount, recordCode);
|
|
|
+ payContent = _alipayCommon.AlipayWapPay(orderInfo.OrderTitle, orderInfo.OrderAmount, recordCode, _alipayPayReturnUrl);
|
|
|
payUrlRequest.PaymentOrderCode = request.OrderCode;
|
|
|
payUrlRequest.PayLink = payContent.payUrl;
|
|
|
payUrlRequest.PayShortLink = string.Format(_alipayShortBaseUrl, payUrlRequest.PaymentOrderCode);
|
|
@@ -205,6 +209,26 @@ namespace WingPaymentService.Service
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取可支付列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public Task<PayableTypeDTO> GetPayableTypes()
|
|
|
+ {
|
|
|
+ var payTypes = new List<string>();
|
|
|
+ if(_alipayPayEnable)
|
|
|
+ {
|
|
|
+ payTypes.Add("alipay");
|
|
|
+ }
|
|
|
+ if(_wechatPayEnable)
|
|
|
+ {
|
|
|
+ payTypes.Add("wechat");
|
|
|
+ }
|
|
|
+ var result = new PayableTypeDTO();
|
|
|
+ result.PayTypes = payTypes;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 支付宝回调
|
|
|
/// </summary>
|