36 lines
		
	
	
		
			919 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			919 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
| <?php
 | |
| 
 | |
| namespace IpSupply\SyncOrder;
 | |
| 
 | |
| final class Helper {
 | |
|     public const API_KEY = 'IpSupply@123';
 | |
|     public const PREFIX = 'IpSupply_SyncOrder';
 | |
| 
 | |
|     static function responseOk(array $data)
 | |
|     {
 | |
|         header('HTTP/1.1 200 Ok');
 | |
|         header('Accept: application/json');
 | |
|         header('Content-Type: application/json');
 | |
|         die(json_encode($data));
 | |
|     }
 | |
| 
 | |
|     static function responseFail(array $data)
 | |
|     {
 | |
|         header('HTTP/1.1 400 Bad request');
 | |
|         header('Accept: application/json');
 | |
|         header('Content-Type: application/json');
 | |
|         die(json_encode($data));
 | |
|     }
 | |
| 
 | |
|     static function responseMethodFail()
 | |
|     {
 | |
|         header('HTTP/1.1 400 bad request');
 | |
|         header('Accept: application/json');
 | |
|         header('Content-Type: application/json');
 | |
|         die(json_encode([
 | |
|             'status' => false,
 | |
|             'message' => 'Param ?method=... not exist!'
 | |
|         ]));
 | |
|     }
 | |
| }
 |