//package ir.almahdi.sandogh_bsa_aza.vam_ha_ozv.pardanopay;
//
//import android.util.Log;
//
//import org.apache.http.HttpEntity;
//import org.apache.http.HttpResponse;
//import org.apache.http.NameValuePair;
//import org.apache.http.client.HttpClient;
//import org.apache.http.client.entity.UrlEncodedFormEntity;
//import org.apache.http.client.methods.HttpPost;
//import org.apache.http.impl.client.DefaultHttpClient;
//import org.apache.http.message.BasicNameValuePair;
//import org.apache.http.util.EntityUtils;
//
//import java.io.BufferedReader;
//import java.io.IOException;
//import java.io.InputStream;
//import java.io.InputStreamReader;
//import java.util.ArrayList;
//import java.util.List;
//
//
///**
// * Created by lenovo on 3/8/2018.
// */
//
//public class Pardano {
//    private String api="";
//
//    public Pardano(String bapi) {
//        this.api=bapi;
//    }
//
//    //sendinng post data
//    private String post(String bURL, List<NameValuePair> param){
//        try {
//            HttpClient client = new DefaultHttpClient();
//            HttpPost post = new HttpPost(bURL);
//
//            post.setEntity(new UrlEncodedFormEntity(param));
//            HttpResponse responsepost = client.execute(post);
//            HttpEntity resEntitypost = responsepost.getEntity();
//
//            if (resEntitypost != null) {
//                //do something with the response
//                String value=EntityUtils.toString(resEntitypost);
//                return value;
//            }else{
//                return "null";
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//            Log.e("error",e.getMessage());
//            return "error";
//        }
//    }
//    public static String convertStreamToString(InputStream is) {
//
//        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
//        StringBuilder sb = new StringBuilder();
//
//        String line = null;
//        try {
//            while ((line = reader.readLine()) != null) {
//                sb.append(line + "\n");
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        } finally {
//            try {
//                is.close();
//            } catch (IOException e) {
//                e.printStackTrace();
//            }
//        }
//        return sb.toString();
//    }
//
//
//
//    //get pay http://url{id}
//    public String GetPay(String money){
//        List<NameValuePair> prm=new ArrayList<NameValuePair>();
//        prm.add(new BasicNameValuePair("amount",money));
//        String val=this.post("http://pardano.com/p/mobilepayment/"+this.api,prm);
//        Log.e("pay url","https://pardano.com/p/payment/"+val);
//        return val;
//    }
//    //get verify
//    public String GetVerify(String pcode, String money){
//        String val=this.post("http://pardano.com/p/mobileverify/"+pcode+"?au="+pcode+"&amount="+money,null);
//        return val;
//    }
//}
