프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$CURL_OPTS | Default options for curl. | ||
$testMode | - set whether we are in a test mode or not |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$apiCodes | - different kind of supported api calls by this wrapper | ||
$apiVersion | string | The api type we are about to call. | |
$arrayResponse | array | The response represented as an array. | |
$errorCode | integer | the error code if one exists. | |
$errorMessage | string | the error message if one exists. | |
$headers | array | the headers returned from the call made. | |
$postFields | array | All the post fields we will add to the call. | |
$response | string | the response message. | |
$username | - the usps username provided by the usps website |
메소드 | 설명 | |
---|---|---|
__construct ( string $username = '' ) | Constructor. | |
convertResponseToArray ( ) : array | Return the response represented as string. | |
getArrayResponse ( ) : array | Return the array representation of the last response. | |
getEndpoint ( ) | ||
getErrorCode ( ) : integer | Get the error code number. | |
getErrorMessage ( ) : string | Get the error code message. | |
getHeaders ( ) : array | Get the headers. | |
getPostData ( ) : array | Return the post data fields as an array. | |
getPostFields ( ) | ||
getResponse ( ) : mixed | Get the response data. | |
getResponseApiName ( ) : string | Response api name. | |
isError ( ) : boolean | Did we encounter an error? | |
isSuccess ( ) : boolean | Was the last call successful. | |
setApiVersion ( string $version ) : void | Set the api version we are going to use. | |
setArrayResponse ( array $value ) : void | Set the array response value. | |
setErrorCode ( integer $code ) : self | Set the error code number. | |
setErrorMessage ( string $message = '' ) : self | Set the error message. | |
setHeaders ( array $headers = [] ) : self | Set the headers. | |
setResponse ( mixed $response = '' ) : self | Set the response. | |
setTestMode ( boolean $value ) : void | Set whether we are in a test mode or not. | |
setUsername ( string $username ) | set the usps api username we are going to user. |
메소드 | 설명 | |
---|---|---|
doRequest ( resource $ch = null ) : string | Makes an HTTP request. This method can be overriden by subclasses if developers want to do fancier things or use something other than curl to make the request. | |
getValueByKey ( array $array, string $key ) : mixed | Find a key inside a multi dim. array. | |
getXMLString ( ) : string | Return the xml string built that we are about to send over to the api. |
public __construct ( string $username = '' ) | ||
$username | string | - the usps api username |
public convertResponseToArray ( ) : array | ||
리턴 | array |
public getArrayResponse ( ) : array | ||
리턴 | array |
public getErrorCode ( ) : integer | ||
리턴 | integer | error code number |
public getErrorMessage ( ) : string | ||
리턴 | string | error code message |
public getHeaders ( ) : array | ||
리턴 | array | the headers returned from the call |
public getPostData ( ) : array | ||
리턴 | array |
public getResponse ( ) : mixed | ||
리턴 | mixed | the response data |
protected getXMLString ( ) : string | ||
리턴 | string |
public setApiVersion ( string $version ) : void | ||
$version | string | the new api version |
리턴 | void |
public setArrayResponse ( array $value ) : void | ||
$value | array | |
리턴 | void |
public setErrorCode ( integer $code ) : self | ||
$code | integer | the error code number |
리턴 | self |
public setErrorMessage ( string $message = '' ) : self | ||
$message | string | the error message |
리턴 | self |
public setHeaders ( array $headers = [] ) : self | ||
$headers | array | the headers array |
리턴 | self |
public setResponse ( mixed $response = '' ) : self | ||
$response | mixed | The response returned from the call |
리턴 | self |
public setTestMode ( boolean $value ) : void | ||
$value | boolean | |
리턴 | void |
public setUsername ( string $username ) | ||
$username | string | - the usps api username |
protected array $arrayResponse | ||
리턴 | array |
protected string $errorMessage | ||
리턴 | string |
protected array $postFields | ||
리턴 | array |