diff --git a/functions-test.php b/functions-test.php index edc27b8..88f6604 100644 --- a/functions-test.php +++ b/functions-test.php @@ -207,7 +207,7 @@ function get_kyc_info($IDkyc) return $response; } -function reject_kyc($IDkyc, $IDuser) +function reject_kyc($IDkyc, $IDuser, $reason) { // First cURL request to reject KYC $curl = curl_init(); @@ -254,11 +254,39 @@ function reject_kyc($IDkyc, $IDuser) $response2 = curl_exec($curl2); curl_close($curl2); + $curl3 = curl_init(); + $postfields = '{ + "from_id":"6458dd6066139b3fee29a9cf", + "to_id":"' . $IDuser . '", + "title":"KYC Denied!!", + "message":"Your KYC got Rejected because ' . $reason . '.", + "status":"new" + }'; + + curl_setopt($curl3, CURLOPT_POSTFIELDS, $postfields); + curl_setopt_array($curl3, array( + CURLOPT_URL => 'https://testapi.obpay.online/api/notifications/create', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0MjE1NmU0ZTVhMTUwNjk2MTI3NGYyMCIsImlhdCI6MTY3OTkwNjU2OH0.1hDJwO760_p83FsQQwCduz0PIBBNFnMKYK3RvDqE9dA' + ), + )); + + $response3 = curl_exec($curl3); + curl_close($curl3); + // Return an array containing both responses - return array($response1, $response2); + return array($response1, $response2, $response3); } -function accept_kyc($IDkyc, $IDuser) +function accept_kyc($IDkyc, $IDuser, $reason) { $curl = curl_init(); $url = "https://testapi.obpay.online/api/kycs/update/$IDkyc"; @@ -301,7 +329,35 @@ function accept_kyc($IDkyc, $IDuser) $response2 = curl_exec($curl2); curl_close($curl2); - return array($response1, $response2); + $curl3 = curl_init(); + $postfields = '{ + "from_id":"6458dd6066139b3fee29a9cf", + "to_id":"' . $IDuser . '", + "title":"KYC Accepted!!", + "message":"Greetings!! ' . $reason . '.", + "status":"new" + }'; + + curl_setopt($curl3, CURLOPT_POSTFIELDS, $postfields); + curl_setopt_array($curl3, array( + CURLOPT_URL => 'https://testapi.obpay.online/api/notifications/create', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0MjE1NmU0ZTVhMTUwNjk2MTI3NGYyMCIsImlhdCI6MTY3OTkwNjU2OH0.1hDJwO760_p83FsQQwCduz0PIBBNFnMKYK3RvDqE9dA' + ), + )); + + $response3 = curl_exec($curl3); + curl_close($curl3); + + return array($response1, $response2, $response3); } diff --git a/users/edit-kyc.php b/users/edit-kyc.php index 1f3e359..e94e3d1 100644 --- a/users/edit-kyc.php +++ b/users/edit-kyc.php @@ -49,8 +49,8 @@