public void createBookingForPassenger(String passengerId) {
   IGCreateBookingForPaymentRequestBean requestBean =
       new IGCreateBookingForPaymentRequestBean(
           IngogoApp.getSharedApplication().getUserId(),
           IngogoApp.getSharedApplication().getPassword(),
           passengerId,
           String.valueOf(IGLocationListener.getCurrentLatitude()),
           String.valueOf(IGLocationListener.getCurrentLongitude()));
   IGBaseWebserviceThreadPool.getSharedInstance()
       .addWerbserviceTask(
           buildURL(),
           IGCreateBookingForPaymentResponseBean.class,
           requestBean.toJsonString(),
           this);
 }
Exemplo n.º 2
0
 @Override
 public void onInternalServerErrorResponse(Map<String, Object> errorResponse) {
   Toast.makeText(
           IngogoApp.getSharedApplication().getApplicationContext(),
           (CharSequence) errorResponse.get(IGApiConstants.kApiFailedMsgKey),
           Toast.LENGTH_SHORT)
       .show();
 }
Exemplo n.º 3
0
 @Override
 public void mapInfoFailed(String errorMessage) {
   Toast.makeText(
           IngogoApp.getSharedApplication().getApplicationContext(),
           errorMessage,
           Toast.LENGTH_SHORT)
       .show();
 }
Exemplo n.º 4
0
  public void noShow() { // GET req.

    String apiUrl = null;
    apiUrl = IGApiConstants.kIngogoBaseURL + IGApiConstants.kNoShowApiURL;

    IGBaseWebService webservice =
        new IGBaseWebService(
            buildJSONRequest(),
            new Handler(),
            new IGCallbackWrapper(_responseListener),
            apiUrl,
            IGApiConstants.kNoShowWebServiceId);

    webservice.setAuthorizationHeader(
        IngogoApp.getSharedApplication().getUserId()
            + ":"
            + IngogoApp.getSharedApplication().getAccessToken());

    webservice.start();
  }
Exemplo n.º 5
0
  private String buildJSONRequest() {
    JSONObject jObject = new JSONObject();
    try {
      jObject.put(IGApiConstants.kJSONBookingIdKey, _jobID);
      if ((IngogoApp.LATTITUDE == null) || (IngogoApp.LONGITUDE == null)) {
        jObject.put(IGApiConstants.kJSONLatitudeKey, 0.0);
        jObject.put(IGApiConstants.kJSONLongitudeKey, 0.0);
      } else {
        jObject.put(IGApiConstants.kJSONLatitudeKey, IngogoApp.LATTITUDE);
        jObject.put(IGApiConstants.kJSONLongitudeKey, IngogoApp.LONGITUDE);
      }
      jObject.put(IGApiConstants.kJSONUsernameKey, IngogoApp.getSharedApplication().getUserId());
      jObject.put(IGApiConstants.kJSONPasswordKey, IngogoApp.getSharedApplication().getPassword());
    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    Log.d("JSONREQ - NOSHOW", jObject.toString());
    return jObject.toString();
  }