Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function currency_exchange(){
- $valid_coins = array("usd", "pen", "ars", "bob", "brl", "cop", "eur", "clp", "bsf");
- $from = $this->input->post('from');
- $to = $this->input->post('to');
- $amount = (int) $this->input->post('amount');
- $validate_from = in_array($from, $valid_coins);
- $validate_to = in_array($to, $valid_coins);
- if($validate_from and $validate_to){
- $response = $this->inkapay_model->getCalcSendMoney($from ,$to , $amount);
- echo json_encode($response);
- }else{
- $response = array("error"=>"invalid coin");
- echo json_encode($response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement