Skip to content

Commit

Permalink
feat: 支付(3)
Browse files Browse the repository at this point in the history
  • Loading branch information
phy19870227 committed May 10, 2021
1 parent b4e31b1 commit 4bda30e
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.snake19870227.stiger.pay.channel.wxpay;

import io.swagger.annotations.ApiModelProperty;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.snake19870227.stiger.pay.channel.ChannelClientParam;

/**
* @author BuHuaYang
* 2021/4/13
*/
public class WxpayAppClientParam implements ChannelClientParam {

@ApiModelProperty("签名")
private String sign;
@ApiModelProperty("prepayId")
private String prepayId;
@ApiModelProperty("partnerId")
private String partnerId;
@ApiModelProperty("appId")
private String appId;
@ApiModelProperty("格式:Sign=WXPay")
@JsonProperty("package")
private String packageValue;
@ApiModelProperty("时间戳")
private String timeStamp;
@ApiModelProperty("随机字符串")
private String nonceStr;

public String getSign() {
return sign;
}

public void setSign(String sign) {
this.sign = sign;
}

public String getPrepayId() {
return prepayId;
}

public void setPrepayId(String prepayId) {
this.prepayId = prepayId;
}

public String getPartnerId() {
return partnerId;
}

public void setPartnerId(String partnerId) {
this.partnerId = partnerId;
}

public String getAppId() {
return appId;
}

public void setAppId(String appId) {
this.appId = appId;
}

public String getPackageValue() {
return packageValue;
}

public void setPackageValue(String packageValue) {
this.packageValue = packageValue;
}

public String getTimeStamp() {
return timeStamp;
}

public void setTimeStamp(String timeStamp) {
this.timeStamp = timeStamp;
}

public String getNonceStr() {
return nonceStr;
}

public void setNonceStr(String nonceStr) {
this.nonceStr = nonceStr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,17 @@ public TradeInfo<?> create(String bizType, String bizFlow, PaymentMethodEnum pay
String createDateTime = LocalDateTimeUtil.format(now, "yyyyMMddHHmmss");
String expireDateTime = LocalDateTimeUtil.format(now.plusMinutes(15), "yyyyMMddHHmmss");

WxPayUnifiedOrderRequest request = WxPayUnifiedOrderRequest.newBuilder().body(bizType)
WxPayUnifiedOrderRequest.WxPayUnifiedOrderRequestBuilder requestBuilder = WxPayUnifiedOrderRequest.newBuilder().body(bizType)
.outTradeNo(outTradeNo)
.openid(openid)
.totalFee(BaseWxPayRequest.yuanToFen(tradePrice.toString()))
.tradeType(paymentMethodEnum.getId())
.timeStart(createDateTime).timeExpire(expireDateTime)
.spbillCreateIp(wxpayProperties.getSpbillCreateIp())
.build();
.spbillCreateIp(wxpayProperties.getSpbillCreateIp());
if (StrUtil.isNotBlank(openid)) {
requestBuilder.openid(openid);
}
WxPayUnifiedOrderRequest request = requestBuilder.build();
ChannelClientParam clientParam = handleResponse(wxPayService, request);

PayTrade payTrade = new PayTrade();
Expand Down

0 comments on commit 4bda30e

Please sign in to comment.