public static String InsertTransferReportProtocal(
      RequestPublicModel publicModel,
      String accountCode,
      double amount,
      String puroseCurrency,
      String transferType,
      String purposeDescription,
      String executionDate,
      DestaccountModel destAccount,
      String otpValue,
      String otpKeySession,
      String otpChannel,
      String currency,
      CheckTransferResponseModel checkTransfer) {
    String result = null;
    try {
      JSONObject jsonObj = new JSONObject();
      JSONObject insertTransferObj = new JSONObject();
      JSONObject destAccountObj = new JSONObject();
      insertTransferObj.put("serviceType", ServiceType.insertTransfer);
      insertTransferObj.put("bankName", publicModel.getBankName());
      insertTransferObj.put("enterpriseId", publicModel.getEnterpriseId());
      insertTransferObj.put("token", publicModel.getToken());
      insertTransferObj.put("customerCode", publicModel.getCustomerCode());
      insertTransferObj.put("channel", publicModel.getChannel());
      insertTransferObj.put("userAgent", publicModel.getUserAgent());
      insertTransferObj.put("sessionId", publicModel.getSessionId());
      insertTransferObj.put("currency", currency);
      if (Contants.isNewPaymentsUpdate) {
        insertTransferObj.put("transferCheck", true);
        insertTransferObj.put("transferId", checkTransfer.getTransferId());
      }

      insertTransferObj.put("accountCode", accountCode);
      insertTransferObj.put("transferType", transferType);
      insertTransferObj.put("amount", amount);
      insertTransferObj.put("executionDate", executionDate);
      insertTransferObj.put("purposeCurrency", puroseCurrency);
      insertTransferObj.put("purposeDescription", purposeDescription);
      insertTransferObj.put("otpValue", otpValue);
      insertTransferObj.put("otpKeySession", otpKeySession);
      insertTransferObj.put("otpChannel", otpChannel);

      destAccountObj.put("title", destAccount.getTitle());
      destAccountObj.put("state", destAccount.getState());
      destAccountObj.put("iban", destAccount.getIban());
      destAccountObj.put("bic", destAccount.getBic());

      insertTransferObj.put("destAccount", destAccountObj);
      jsonObj.put("InsertTransferRequest", insertTransferObj);
      result = jsonObj.toString();
    } catch (Exception e) {
      LogManager.e("InsertTransferReportProtocal is error " + e.getLocalizedMessage());
    }
    return result;
  }
 @Override
 protected void onRecover(String text) {
   resetResult();
   LogManager.d("onrecover" + text);
   if (text != null) {
     if (currentTypeCode.equals(ServiceCode.BANK_TRANSFER_PAYMENT)) {
     } else if (currentTypeCode.equals(ServiceCode.TRANSFER_ENTRY_PAYMENT)) {
     } else if (currentTypeCode.equals(ServiceCode.SIM_TOP_UP)) {
     } else if (currentTypeCode.equals(ServiceCode.CARD_RECHARGE_PAYMENT)) {
       cardNumberEditText.setText(text);
     }
   }
 }
Example #3
0
  /**
   * @param publicModel
   * @return
   */
  public static String HelpItemReportProtocal(RequestPublicModel publicModel) {
    String result = null;
    try {
      JSONObject jsonObj = new JSONObject();
      JSONObject helpItemObj = new JSONObject();
      helpItemObj.put("serviceType", ServiceType.getHelpItems);
      helpItemObj.put("bankName", publicModel.getBankName());
      helpItemObj.put("enterpriseId", publicModel.getEnterpriseId());
      helpItemObj.put("customerCode", publicModel.getCustomerCode());
      helpItemObj.put("channel", publicModel.getChannel());
      helpItemObj.put("userAgent", publicModel.getUserAgent());

      jsonObj.put("GetHelpItemsRequest", helpItemObj);
      result = jsonObj.toString();
    } catch (Exception e) {
      LogManager.e("HelpItemReportProtocal is error" + e.getLocalizedMessage());
    }
    return result;
  }
Example #4
0
  public static GetHelpItemResponseModel ParseHelpItemResponse(String json) {

    GetHelpItemResponseModel getHelpItemResponse = new GetHelpItemResponseModel();
    List<HelpItemListModel> helpItems = new ArrayList<HelpItemListModel>();

    if (json == null) {
      return null;
    }

    try {
      JSONObject jsonObj = new JSONObject(json);
      JSONObject helpItemResponse = jsonObj.getJSONObject("GetHelpItemsResponse");

      getHelpItemResponse.responsePublicModel.setResultCode(helpItemResponse.optInt("resultCode"));
      getHelpItemResponse.responsePublicModel.setResultDescription(
          helpItemResponse.optString("resultDescription"));
      if (getHelpItemResponse.responsePublicModel.getResultCode() != 0) {
        JSONObject eventManagementObj = helpItemResponse.getJSONObject("eventManagement");
        getHelpItemResponse.responsePublicModel.eventManagement.setErrorCode(
            eventManagementObj.optString("errorCode"));
        getHelpItemResponse.responsePublicModel.eventManagement.setErrorDescription(
            eventManagementObj.optString("errorDescription"));
        return getHelpItemResponse;
      }

      getHelpItemResponse.responsePublicModel.setTransactionId(
          helpItemResponse.optString("transactionId"));

      JSONArray helpItemArray = helpItemResponse.getJSONArray("helpItemsList");
      for (int i = 0; i < helpItemArray.length(); i++) {
        HelpItemListModel helpItem = new HelpItemListModel("");
        helpItem.setHelpItemId(helpItemArray.getJSONObject(i).optInt("helpItemId"));
        helpItem.setText(helpItemArray.getJSONObject(i).optString("text"));
        helpItem.setTitle(helpItemArray.getJSONObject(i).optString("title"));
        helpItems.add(helpItem);
      }
      getHelpItemResponse.setHelpItemList(helpItems);
    } catch (Exception e) {
      LogManager.e("ParseHelpItemResponse is error" + e.getLocalizedMessage());
    }
    return getHelpItemResponse;
  }
  public static ResponsePublicModel ParseInsertTransferResponse(String json) {
    ResponsePublicModel responsePublicModel = new ResponsePublicModel();
    EntryModel entryModel = new EntryModel();
    List<Object> fieldMap = new ArrayList<Object>();
    if (json == null) {
      return null;
    }

    try {
      JSONObject jsonObj = new JSONObject(json);
      JSONObject insertTransferObj = jsonObj.getJSONObject("InsertTransferResponse");

      responsePublicModel.setResultCode(insertTransferObj.getInt("resultCode"));
      responsePublicModel.setResultDescription(insertTransferObj.optString("resultDescription"));
      if (responsePublicModel.getResultCode() != 0) {
        JSONObject eventManagementObj = insertTransferObj.getJSONObject("eventManagement");
        responsePublicModel.eventManagement.setErrorCode(eventManagementObj.optString("errorCode"));
        responsePublicModel.eventManagement.setErrorDescription(
            eventManagementObj.optString("errorDescription"));
        return responsePublicModel;
      }

      responsePublicModel.setTransactionId(insertTransferObj.optString("transactionId"));

      JSONObject fieldMapObj = insertTransferObj.getJSONObject("fieldMap");
      JSONArray entryArray = fieldMapObj.getJSONArray("entry");
      for (int i = 0; i < entryArray.length(); i++) {
        entryModel.setKey(entryArray.getJSONObject(i).optString("key"));
        entryModel.setValue(entryArray.getJSONObject(i).optString("value"));
        fieldMap.add(entryModel);
      }
      responsePublicModel.setFieldMap(fieldMap);
    } catch (JSONException e) {
      LogManager.e("ParseLoginResponse is error " + e.getLocalizedMessage());
    }
    return responsePublicModel;
  }
  /**
   * 此方法别删除,现在搞不大清楚transfer entry里的account是从哪来的
   *
   * @param accountsForServiceModels
   * @param selectedAccountsModel
   */
  public void createAccountsUI(
      final List<AccountsForServiceModel> accountsForServiceModels,
      final AccountsModel selectedAccountsModel) {

    this.selectedAccountsModel = selectedAccountsModel;
    boolean accountbyservicemode = false;

    if (BaseActivity.isOffline) {
      return;
    }
    if (this.accountsForServiceModels == accountsForServiceModels) {

    } else {
      this.accountsForServiceModels = accountsForServiceModels;
    }

    for (int index = 0; index < tranGroup.getChildCount(); index++) {
      RadioButton child = (RadioButton) tranGroup.getChildAt(index);
      child.setOnCheckedChangeListener(null);
    }
    tranGroup.removeAllViews();
    if (accountbyservicemode) {
      for (int i = 0; i < accountsForServiceModels.size(); i++) {
        AccountsForServiceModel accountsForServiceModel = accountsForServiceModels.get(i);
        LogManager.d(accountsForServiceModel.getServiceCode());

        for (AccountsModel accountsModel : accountsForServiceModel.getAccounts()) {

          // LogManager.d(accountsModel.getAccountAlias());
          LayoutInflater layoutInflater = LayoutInflater.from(getContext());
          RadioButton radioButton =
              (RadioButton) layoutInflater.inflate(R.layout.bank_radio_button_item, null);
          radioButton.setText(accountsModel.getAccountAlias());
          if (accountsModel == selectedAccountsModel) {
            radioButton.setEnabled(false);
          }
          radioButton.setTag(accountsModel);
          radioButton.setOnCheckedChangeListener(PayeeExpandedLayout.this);
          tranGroup.addView(radioButton);
        }
      }

    } else {
      LogManager.d("owner is get");
      PaymentConfirmLayout paymentConfirmLayout =
          (PaymentConfirmLayout) expandBarResultListener.getOwener();
      List<Account> bankRecipients =
          paymentConfirmLayout.getRecipientListModel.getBankRecipientList();

      if (bankRecipients != null) {
        for (AccountsForServiceModel bankRecipient : accountsForServiceModels) {

          List<AccountsModel> accounts = bankRecipient.getAccounts();
          for (AccountsModel account : accounts) {

            LayoutInflater layoutInflater = LayoutInflater.from(getContext());
            RadioButton radioButton =
                (RadioButton) layoutInflater.inflate(R.layout.bank_radio_button_item, null);
            radioButton.setText(account.getAccountAlias());
            if (selectedAccountsModel.getAccountAlias() == account.getAccountAlias()) {
              radioButton.setEnabled(false);
            }

            radioButton.setTag(account);
            radioButton.setOnCheckedChangeListener(PayeeExpandedLayout.this);
            tranGroup.addView(radioButton);
          }
        }
      }
    }
    if (currentTypeCode.equals(ServiceCode.TRANSFER_ENTRY_PAYMENT)) {
      expandFocusResultChange("");
    }
  }