Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.37 KB | None | 0 0
  1. public function handle_payment() {
  2.  
  3.  
  4. $membership_type = ($this->input->post('membership_type'))?$this->input->post('membership_type'):NULL;
  5. // $method = ($this->input->post('method'))?$this->input->post('method'):NULL;
  6. $patient_full_name = ($this->input->post('patient_full_name'))?$this->input->post('patient_full_name'):NULL;
  7. $patient_email = ($this->input->post('patient_email'))?$this->input->post('patient_email'):NULL;
  8. $patient_mobile_no = ($this->input->post('patient_mobile_no'))?$this->input->post('patient_mobile_no'):NULL;
  9. $patient_alternate_mobile_no = ($this->input->post('patient_alternate_mobile_no'))?$this->input->post('patient_alternate_mobile_no'):NULL;
  10. $patient_age = ($this->input->post('patient_age'))?$this->input->post('patient_age'):NULL;
  11. $patient_nid = ($this->input->post('patient_nid'))?$this->input->post('patient_nid'):NULL;
  12. $patient_gender = ($this->input->post('patient_gender'))?$this->input->post('patient_gender'):NULL;
  13. $patient_dob = ($this->input->post('patient_dob'))?$this->input->post('patient_dob'):NULL;
  14. $patient_city = ($this->input->post('patient_city'))?$this->input->post('patient_city'):NULL;
  15. $patient_address = ($this->input->post('patient_address'))?$this->input->post('patient_address'):NULL;
  16.  
  17. // var_dump($membership_type);exit;
  18.  
  19. /* $nominee_full_name = ($this->input->post('nominee_full_name'))?$this->input->post('nominee_full_name'):NULL;
  20. $nominee_relation = ($this->input->post('nominee_relation'))?$this->input->post('nominee_relation'):NULL;
  21. $nominee_mobile_no = ($this->input->post('nominee_mobile_no'))?$this->input->post('nominee_mobile_no'):NULL;
  22. $nominee_nid = ($this->input->post('nominee_nid'))?$this->input->post('nominee_nid'):NULL;
  23. $nominee_gender = ($this->input->post('nominee_gender'))?$this->input->post('nominee_gender'):NULL;
  24. $nominee_dob = ($this->input->post('nominee_dob'))?$this->input->post('nominee_dob'):NULL;
  25. $nominee_city = ($this->input->post('nominee_city'))?$this->input->post('nominee_city'):NULL;
  26. $nominee_address = ($this->input->post('nominee_address'))?$this->input->post('nominee_address'):NULL;
  27.  
  28. $cashback_bank_name = ($this->input->post('cashback_bank_name'))?$this->input->post('cashback_bank_name'):NULL;
  29. $cashback_bank_branch_name = ($this->input->post('cashback_bank_branch_name'))?$this->input->post('cashback_bank_branch_name'):NULL;
  30. $cashback_bank_number = ($this->input->post('cashback_bank_number'))?$this->input->post('cashback_bank_number'):NULL;
  31. $cashback_bkash_number = ($this->input->post('cashback_bkash_number'))?$this->input->post('cashback_bkash_number'):NULL;
  32. $cashback_rocket_number = ($this->input->post('cashback_rocket_number'))?$this->input->post('cashback_rocket_number'):NULL;*/
  33.  
  34.  
  35. if($membership_type == 200){
  36. $membership_type_id = 1;
  37. $amount = 200;
  38. $msg = "Apnar e-Sastho Basic membership confirm korte 01790777666 bKash number e 200Tk PAYMENT korar por 16484 e call kore ref code janiye din.";
  39.  
  40. }elseif ($membership_type == 300){
  41. $membership_type_id = 3;
  42. $amount = 300;
  43. $msg = "Apnar e-Sastho Basic membership confirm korte 01790777666 bKash number e 200Tk PAYMENT korar por 16484 e call kore ref code janiye din.";
  44.  
  45. }elseif ($membership_type == 600) {
  46. $membership_type_id = 4;
  47. $amount = 600;
  48. $msg = "Apnar e-Sastho Basic membership confirm korte 01790777666 bKash number e 200Tk PAYMENT korar por 16484 e call kore ref code janiye din.";
  49.  
  50. }
  51.  
  52. // if($method == 'bkash' || $method == 'rocket'){
  53.  
  54. $username = $this->config->item('username');
  55. $password = $this->config->item('password');
  56.  
  57. $url = $this->config->item('rest_url').'index.php/e_sastho_api/member_register/format/json/';
  58.  
  59. $curl_handle = curl_init($url);
  60. curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
  61. curl_setopt($curl_handle, CURLOPT_POST, true);
  62. curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array(
  63. 'membership_type_id' => $membership_type_id,
  64. // 'method' => $method,
  65. 'patient_full_name' => $patient_full_name,
  66. 'patient_email' => $patient_email,
  67. 'patient_mobile_no' => $patient_mobile_no,
  68. 'patient_alternate_mobile_no' => $patient_alternate_mobile_no,
  69. 'patient_age' => $patient_age,
  70. 'patient_nid' => $patient_nid,
  71. 'patient_gender' => $patient_gender,
  72. 'patient_dob' => $patient_dob,
  73. 'patient_city' => $patient_city,
  74. 'patient_address' => $patient_address,
  75.  
  76. /* 'nominee_full_name' => $nominee_full_name,
  77. 'nominee_relation' => $nominee_relation,
  78. 'nominee_mobile_no' => $nominee_mobile_no,
  79. 'nominee_nid' => $nominee_nid,
  80. 'nominee_gender' => $nominee_gender,
  81. 'nominee_dob' => $nominee_dob,
  82. 'nominee_city' => $nominee_city,
  83. 'nominee_address' => $nominee_address,
  84.  
  85. 'cashback_bank_name' => $cashback_bank_name,
  86. 'cashback_bank_branch_name' => $cashback_bank_branch_name,
  87. 'cashback_bank_number' => $cashback_bank_number,
  88. 'cashback_bkash_number' => $cashback_bkash_number,
  89. 'cashback_rocket_number' => $cashback_rocket_number,*/
  90.  
  91. 'username' => $username,
  92. 'password' => $password
  93. ));
  94.  
  95. $buffer = curl_exec($curl_handle);
  96. curl_close($curl_handle);
  97. // echo $buffer;
  98. // $result = json_decode($buffer);
  99. // var_dump($result);exit;
  100.  
  101.  
  102.  
  103. if($buffer == '"success"'){
  104. $cell = $patient_mobile_no;
  105. $msgs = $msg;
  106. $response = $this->do_push_sms($cell, $msgs);
  107. }
  108.  
  109. exit(json_encode(array(
  110. 'result' => $buffer,
  111. )));
  112.  
  113.  
  114. // echo json_encode($response);
  115. // }
  116.  
  117.  
  118.  
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement