Search in sources :

Example 1 with CreateAddressFeignClient

use of com.whoiszxl.feign.CreateAddressFeignClient in project shopzz by whoiszxl.

the class DcPayInfoBuilder method buildAddress.

/**
 * 构建地址信息
 * @return
 */
public DcPayInfoBuilder 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)

Example 2 with CreateAddressFeignClient

use of com.whoiszxl.feign.CreateAddressFeignClient 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)2 CreateAddressFeignClient (com.whoiszxl.feign.CreateAddressFeignClient)2