添加返回支付地址
This commit is contained in:
1 parent
361bfd6421
commit
3161365ec8
4 files changed
+23
-2
No files matched your search
@@ -16,14 +16,17 @@ public class PaymentOrderCreateResult {
|
||||
private BigDecimal paymentAmount;
|
||||
@JsonProperty("expiration_time")
|
||||
private Date expirationTime;
|
||||
/** 商户可引导用户访问的公共收银台地址。 */
|
||||
private String url;
|
||||
|
||||
public PaymentOrderCreateResult(String orderId, String tradeId, String paymentAddress,
|
||||
BigDecimal paymentAmount, Date expirationTime) {
|
||||
BigDecimal paymentAmount, Date expirationTime, String url) {
|
||||
this.orderId = orderId;
|
||||
this.tradeId = tradeId;
|
||||
this.paymentAddress = paymentAddress;
|
||||
this.paymentAmount = paymentAmount;
|
||||
this.expirationTime = expirationTime;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getOrderId() { return orderId; }
|
||||
@@ -31,4 +34,5 @@ public class PaymentOrderCreateResult {
|
||||
public String getPaymentAddress() { return paymentAddress; }
|
||||
public BigDecimal getPaymentAmount() { return paymentAmount; }
|
||||
public Date getExpirationTime() { return expirationTime; }
|
||||
public String getUrl() { return url; }
|
||||
}
|
||||
@@ -55,6 +55,9 @@ public class PaymentOrderOpenApiService {
|
||||
/** 1 USDT 对应的业务货币金额,例如 7.20 表示 1 USDT = 7.20 业务货币。 */
|
||||
@Value("${payment.usdt-exchange-rate:1}")
|
||||
private BigDecimal usdtExchangeRate;
|
||||
/** 对外创建订单成功后返回的公共收银台入口。 */
|
||||
@Value("${payment.checkout-url:http://192.168.3.103/public/usdtCheckout}")
|
||||
private String checkoutUrl;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PaymentOrderCreateResult createOrder(DecryptResult request) {
|
||||
@@ -220,7 +223,8 @@ public class PaymentOrderOpenApiService {
|
||||
|
||||
private PaymentOrderCreateResult result(UsdtOrdersPlus order) {
|
||||
return new PaymentOrderCreateResult(order.getOrderId(), order.getTradeId(), order.getToken(),
|
||||
order.getActualAmount(), new Date(order.getCreatedAt().getTime() + ORDER_TTL_MILLIS));
|
||||
order.getActualAmount(), new Date(order.getCreatedAt().getTime() + ORDER_TTL_MILLIS),
|
||||
checkoutUrl);
|
||||
}
|
||||
|
||||
private Map<String, String> parseParameters(String plainData) {
|
||||
|
||||
Reference in new issue
Block a user