Example #1
0
  /** p2p付款 */
  public String p2pPay(
      String toPayAmount,
      String toPayReason,
      String toPayAccount,
      String smsMobileNo,
      String isAddContact,
      String toPayMemo,
      RootActivity activity) {
    BaseServiceBean createP2pOrder =
        serviceFactory.getBean(ServiceBeanConfig.BEAN_NAME_CREATEP2PORDER);

    // 业务联网参数设置
    createP2pOrder.initParams(
        toPayAmount, toPayReason, toPayAccount, smsMobileNo, isAddContact, toPayMemo);
    String responseStr = createP2pOrder.doX();

    if (CommonRespHandler.filter(createP2pOrder)) {
      JSONObject p2pResponse;
      try {
        p2pResponse = new JSONObject(responseStr);
        String tradeNo = p2pResponse.optString(Constant.RQF_TRADE_NO);

        return BaseHelper.payBizDeal(
            activity, null, tradeNo, activity.getExtToken(), null, "trade", "");
      } catch (JSONException e) {
        e.printStackTrace();
      }
      return null;
    } else {
      return responseStr;
    }
  }
Example #2
0
  public String p2phonePay(
      String receiverPhone,
      String receiverName,
      String transferAmount,
      String bankShortName,
      String transferSpeedName,
      String reason,
      String toPayMemo,
      RootActivity activity) {
    BaseServiceBean createP2PhoneOrder =
        serviceFactory.getBean(ServiceBeanConfig.BEAN_NAME_CREATEP2PHONEORDER);

    // 业务联网参数设置
    createP2PhoneOrder.initParams(
        receiverPhone,
        receiverName,
        transferAmount,
        bankShortName,
        transferSpeedName,
        reason,
        toPayMemo);
    String responseStr = createP2PhoneOrder.doX();

    if (CommonRespHandler.filter(createP2PhoneOrder)) {
      JSONObject p2pResponse;
      try {
        p2pResponse = new JSONObject(responseStr);
        String billNo = p2pResponse.optString(Constant.RPF_BILLNO);

        return BaseHelper.payBizDeal(
            activity, null, billNo, activity.getExtToken(), null, "cell_num_transfer", "");
      } catch (JSONException e) {
        e.printStackTrace();
      }
      return null;
    } else {
      return responseStr;
    }
  }