com.egzosn.pay.common.util.Util.conversionCentAmount()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(227)

本文整理了Java中com.egzosn.pay.common.util.Util.conversionCentAmount()方法的一些代码示例,展示了Util.conversionCentAmount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.conversionCentAmount()方法的具体详情如下:
包路径:com.egzosn.pay.common.util.Util
类名称:Util
方法名:conversionCentAmount

Util.conversionCentAmount介绍

[英]元转分
[中]元转分

代码示例

代码示例来源:origin: egzosn/pay-java-parent

  1. /**
  2. * 申请退款接口
  3. *
  4. * @param refundOrder 退款订单信息
  5. * @return 退款返回结果集
  6. */
  7. @Override
  8. public Map<String, Object> refund(RefundOrder refundOrder) {
  9. Map<String, Object> params = new HashMap<>();
  10. //商户代码
  11. params.put("mchnt_cd", payConfigStorage.getPid());
  12. //原交易日期
  13. params.put("origin_order_date", refundOrder.getOrderDate());
  14. //原订单号
  15. params.put("origin_order_id", refundOrder.getTradeNo());
  16. //退款金额
  17. params.put("refund_amt", Util.conversionCentAmount(refundOrder.getRefundAmount()));
  18. //备注
  19. params.put("rem", "");
  20. params.put("md5", createSign(SignUtils.parameters2MD5Str(params, "|"), payConfigStorage.getInputCharset()));
  21. JSONObject resultJson = getHttpRequestTemplate().postForObject(getReqUrl() + URL_FuiouSmpRefundGate, params, JSONObject.class);
  22. return resultJson;
  23. }

代码示例来源:origin: egzosn/pay-java-parent

  1. parameters.put("order_amt", Util.conversionCentAmount(order.getPrice()));

代码示例来源:origin: egzosn/pay-java-parent

  1. case WEB:
  2. case B2B:
  3. params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));
  4. params.put("orderDesc", order.getSubject());
  5. break;
  6. case CONSUME:
  7. params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));
  8. params.put(SDKConstants.param_qrNo, order.getAuthCode());
  9. break;
  10. case APPLY_QR_CODE:
  11. if (null != order.getPrice()){
  12. params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(order.getPrice()));

代码示例来源:origin: egzosn/pay-java-parent

  1. /**
  2. * 申请退款接口
  3. *
  4. * @param refundOrder 退款订单信息
  5. * @return 返回支付方申请退款后的结果
  6. */
  7. @Override
  8. public Map<String, Object> refund(RefundOrder refundOrder) {
  9. //获取公共参数
  10. Map<String, Object> parameters = getPublicParameters();
  11. setParameters(parameters, "transaction_id", refundOrder.getTradeNo());
  12. setParameters(parameters, "out_trade_no", refundOrder.getOutTradeNo());
  13. setParameters(parameters, "out_refund_no", refundOrder.getRefundNo());
  14. parameters.put("total_fee", Util.conversionCentAmount(refundOrder.getTotalAmount()));
  15. parameters.put("refund_fee", Util.conversionCentAmount(refundOrder.getRefundAmount()));
  16. parameters.put("op_user_id", payConfigStorage.getPid());
  17. //设置签名
  18. setSign(parameters);
  19. return requestTemplate.postForObject(getUrl(WxTransactionType.REFUND), XML.getMap2Xml(parameters), JSONObject.class);
  20. }

代码示例来源:origin: egzosn/pay-java-parent

  1. /**
  2. * 消费撤销/退货接口
  3. *
  4. * @param refundOrder 退款订单信息
  5. * @param type UnionTransactionType.REFUND 或者UnionTransactionType.CONSUME_UNDO
  6. * @return 返回支付方申请退款后的结果
  7. */
  8. public Map<String, Object> unionRefundOrConsumeUndo(RefundOrder refundOrder, UnionTransactionType type) {
  9. Map<String, Object> params = this.getCommonParam();
  10. type.convertMap(params);
  11. params.put(SDKConstants.param_orderId, refundOrder.getRefundNo());
  12. params.put(SDKConstants.param_txnAmt, Util.conversionCentAmount(refundOrder.getRefundAmount()));
  13. params.put(SDKConstants.param_origQryId, refundOrder.getTradeNo());
  14. this.setSign(params);
  15. String responseStr = getHttpRequestTemplate().postForObject(this.getBackTransUrl(), params, String.class);
  16. JSONObject response = UriVariables.getParametersToMap(responseStr);
  17. if (this.verify(response)) {
  18. if (SDKConstants.OK_RESP_CODE.equals(response.getString(SDKConstants.param_respCode))) {
  19. // String origRespCode = response.getString(SDKConstants.param_origRespCode);
  20. //交易成功,更新商户订单状态
  21. //TODO
  22. return response;
  23. }
  24. throw new PayErrorException(new PayException(response.getString(SDKConstants.param_respCode), response.getString(SDKConstants.param_respMsg), response.toJSONString()));
  25. }
  26. throw new PayErrorException(new PayException("failure", "验证签名失败", response.toJSONString()));
  27. }

代码示例来源:origin: egzosn/pay-java-parent

  1. parameters.put("spbill_create_ip", StringUtils.isEmpty(order.getSpbillCreateIp()) ? "192.168.1.150" : order.getSpbillCreateIp() );
  2. parameters.put("total_fee", Util.conversionCentAmount( order.getPrice()));
  3. if (StringUtils.isNotEmpty(order.getAddition())){
  4. parameters.put("attach", order.getAddition());

代码示例来源:origin: egzosn/pay-java-parent

  1. parameters.put("amount", Util.conversionCentAmount(order.getAmount()));
  2. if (!StringUtils.isEmpty(order.getRemark())){
  3. parameters.put("desc", order.getRemark());

相关文章