diff --git a/index.php b/index.php new file mode 100644 index 0000000..3cf66bc --- /dev/null +++ b/index.php @@ -0,0 +1,130 @@ + +user; + $request['password'] = $this->pass; + + $ch = curl_init($this->url); + $opts[CURLOPT_POST] = true; + $opts[CURLOPT_POSTFIELDS] = http_build_query($request); + $opts[CURLOPT_RETURNTRANSFER] = true; + curl_setopt_array($ch,$opts); + $jsonResponse = curl_exec($ch); + $arrResponse = json_decode($jsonResponse, 1); + + if($arrResponse['status']===true) + { + $this->loginId = $arrResponse['data']['loginid']; + return true; + } + else + return false; + } + + /** + * Fucntion that check if user is exist or not + * @param array $recipient + * @return json + */ + public function checkUser($recipient) + { + $request['act'] = 'usercheck'; + $request['loginid'] = $this->loginId; + $request['email'] = $recipient['email']; + $request['mobile'] = $recipient['mobile']; + $request['country'] = $recipient['country']; + + $ch = curl_init($this->url); + $opts[CURLOPT_POST] = true; + $opts[CURLOPT_POSTFIELDS] = http_build_query($request); + $opts[CURLOPT_RETURNTRANSFER] = true; + curl_setopt_array($ch,$opts); + $jsonResponse = curl_exec($ch); + $arrResponse = json_decode($jsonResponse, 1); + + return $arrResponse; + } + +} + + +//requires parames for recipient +$recipient = array( + 'email' => 'test@ipayoptions.com', + 'mobile' => '1221212121112', + 'country' => 'AU' +); + +$obj = new txtFunds(); +$userStatus = $obj->login(); +if($userStatus===true) +{ + $recipientInfo = $obj->checkUser($recipient); + if($recipientInfo['status']===true) + { + $data = $recipientInfo['data']; + $user = ' + + + + + + + + + + + +
User IdE-mailStatus
'.$data['userid'].''.$recipient['email'].''.$data['status'].'
'; + + $accountids = ''; + if(is_array($data['accountid']) && count($data['accountid'])>0) + { + $accountids .= ' +
+ + + + '; + + foreach ($data['accountid'] as $key => $value) + { + $accountids .= ' + + + '; + } + + $accountids .= '
Account Id
'.$value.'
'; + } + } +} +?> + + + + + + + + + + +