Search in sources :

Example 6 with RechargeResponse

use of com.whoiszxl.entity.response.RechargeResponse in project shopzz by whoiszxl.

the class PayInfoDcBuilder method buildAddress.

/**
 * 构建地址信息
 * @return
 */
public PayInfoDcBuilder buildAddress(Order order) {
    CreateAddressFeignClient createAddressFeignClient = createDcAddressFactory.get(dcName);
    ResponseResult<RechargeResponse> rechargeResponseResult = createAddressFeignClient.giveAddress(order.getId().toString(), order.getTotalAmount().toPlainString());
    if (!rechargeResponseResult.isOk()) {
        ExceptionCatcher.catchValidateEx(ResponseResult.buildError("支付创建失败"));
    }
    RechargeResponse rechargeResponse = rechargeResponseResult.getData();
    this.dcPayInfo.setCurrencyName(dcName);
    this.dcPayInfo.setCurrencyId(rechargeResponse.getCurrencyId());
    this.dcPayInfo.setToAddress(rechargeResponse.getAddress());
    this.dcPayInfo.setQrcodeData(rechargeResponse.getQrCodeData());
    return this;
}
Also used : CreateAddressFeignClient(com.whoiszxl.feign.CreateAddressFeignClient) RechargeResponse(com.whoiszxl.entity.response.RechargeResponse)

Aggregations

RechargeResponse (com.whoiszxl.entity.response.RechargeResponse)6 Currency (com.whoiszxl.entity.Currency)4 Transactional (org.springframework.transaction.annotation.Transactional)4 EthereumAddress (com.whoiszxl.common.EthereumAddress)3 CurrencyAccount (com.whoiszxl.entity.CurrencyAccount)3 CreateAddressFeignClient (com.whoiszxl.feign.CreateAddressFeignClient)2 PostMapping (org.springframework.web.bind.annotation.PostMapping)2