本文整理了Java中com.egzosn.pay.common.util.Util.conversionCentAmount()
方法的一些代码示例,展示了Util.conversionCentAmount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.conversionCentAmount()
方法的具体详情如下:
包路径:com.egzosn.pay.common.util.Util
类名称:Util
方法名:conversionCentAmount
[英]元转分
[中]元转分
代码示例来源:origin: egzosn/pay-java-parent
/**
* 申请退款接口
*
* @param refundOrder 退款订单信息
* @return 退款返回结果集
*/
@Override
public Map<String, Object> refund(RefundOrder refundOrder) {
Map<String, Object> params = new HashMap<>();
//商户代码
params.put("mchnt_cd", payConfigStorage.getPid());
//原交易日期
params.put("origin_order_date", refundOrder.getOrderDate());
//原订单号
params.put("origin_order_id", refundOrder.getTradeNo());
//退款金额
params.put("refund_amt", Util.conversionCentAmount(refundOrder.getRefundAmount()));
//备注
params.put("rem", "");
params.put("md5", createSign(SignUtils.parameters2MD5Str(params, "|"), payConfigStorage.getInputCharset()));
JSONObject resultJson = getHttpRequestTemplate().postForObject(getReqUrl() + URL_FuiouSmpRefundGate, params, JSONObject.class);
return resultJson;
}
代码示例来源:origin: egzosn/pay-java-parent
parameters.put("order_amt", Util.conversionCentAmount(order.getPrice()));
代码示例来源:origin: egzosn/pay-java-parent
case WEB:
case B2B:
params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));
params.put("orderDesc", order.getSubject());
break;
case CONSUME:
params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));
params.put(SDKConstants.param_qrNo, order.getAuthCode());
break;
case APPLY_QR_CODE:
if (null != order.getPrice()){
params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));
代码示例来源:origin: egzosn/pay-java-parent
/**
* 申请退款接口
*
* @param refundOrder 退款订单信息
* @return 返回支付方申请退款后的结果
*/
@Override
public Map<String, Object> refund(RefundOrder refundOrder) {
//获取公共参数
Map<String, Object> parameters = getPublicParameters();
setParameters(parameters, "transaction_id", refundOrder.getTradeNo());
setParameters(parameters, "out_trade_no", refundOrder.getOutTradeNo());
setParameters(parameters, "out_refund_no", refundOrder.getRefundNo());
parameters.put("total_fee", Util.conversionCentAmount(refundOrder.getTotalAmount()));
parameters.put("refund_fee", Util.conversionCentAmount(refundOrder.getRefundAmount()));
parameters.put("op_user_id", payConfigStorage.getPid());
//设置签名
setSign(parameters);
return requestTemplate.postForObject(getUrl(WxTransactionType.REFUND), XML.getMap2Xml(parameters), JSONObject.class);
}
代码示例来源:origin: egzosn/pay-java-parent
/**
* 消费撤销/退货接口
*
* @param refundOrder 退款订单信息
* @param type UnionTransactionType.REFUND 或者UnionTransactionType.CONSUME_UNDO
* @return 返回支付方申请退款后的结果
*/
public Map<String, Object> unionRefundOrConsumeUndo(RefundOrder refundOrder, UnionTransactionType type) {
Map<String, Object> params = this.getCommonParam();
type.convertMap(params);
params.put(SDKConstants.param_orderId, refundOrder.getRefundNo());
params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(refundOrder.getRefundAmount()));
params.put(SDKConstants.param_origQryId, refundOrder.getTradeNo());
this.setSign(params);
String responseStr = getHttpRequestTemplate().postForObject(this.getBackTransUrl(), params, String.class);
JSONObject response = UriVariables.getParametersToMap(responseStr);
if (this.verify(response)) {
if (SDKConstants.OK_RESP_CODE.equals(response.getString(SDKConstants.param_respCode))) {
// String origRespCode = response.getString(SDKConstants.param_origRespCode);
//交易成功,更新商户订单状态
//TODO
return response;
}
throw new PayErrorException(new PayException(response.getString(SDKConstants.param_respCode), response.getString(SDKConstants.param_respMsg), response.toJSONString()));
}
throw new PayErrorException(new PayException("failure", "验证签名失败", response.toJSONString()));
}
代码示例来源:origin: egzosn/pay-java-parent
parameters.put("spbill_create_ip", StringUtils.isEmpty(order.getSpbillCreateIp()) ? "192.168.1.150" : order.getSpbillCreateIp() );
parameters.put("total_fee", Util.conversionCentAmount( order.getPrice()));
if (StringUtils.isNotEmpty(order.getAddition())){
parameters.put("attach", order.getAddition());
代码示例来源:origin: egzosn/pay-java-parent
parameters.put("amount", Util.conversionCentAmount(order.getAmount()));
if (!StringUtils.isEmpty(order.getRemark())){
parameters.put("desc", order.getRemark());
内容来源于网络,如有侵权,请联系作者删除!