PayPal\Service\AdaptivePaymentsService::GetShippingAddresses PHP Méthode

GetShippingAddresses() public méthode

Service Call: GetShippingAddresses
public GetShippingAddresses ( GetShippingAddressesRequest $getShippingAddressesRequest, mixed $apiCredential = NULL ) : Types\AP\GetShippingAddressesResponse
$getShippingAddressesRequest GetShippingAddressesRequest
$apiCredential mixed - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically
Résultat Types\AP\GetShippingAddressesResponse
    public function GetShippingAddresses($getShippingAddressesRequest, $apiCredential = NULL)
    {
        $ret = new GetShippingAddressesResponse();
        $apiContext = new PPApiContext($this->config);
        $handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
        $resp = $this->call('AdaptivePayments', 'GetShippingAddresses', $getShippingAddressesRequest, $apiContext, $handlers);
        $ret->init(PPUtils::nvpToMap($resp));
        return $ret;
    }

Usage Example

Shipping information can only be retrieved through the payment payKey; not through the preapprovalKey.
*/
/*
 * (Required) Information common to each API operation, such as the language in which an error message is returned.
 */
$getShippingAddressesReq = new GetShippingAddressesRequest(new RequestEnvelope("en_US"), $_POST['key']);
/*
* 	 ## Creating service wrapper object
Creating service wrapper object to make API call and loading
Configuration::getAcctAndConfig() returns array that contains credential and config parameters
*/
$service = new AdaptivePaymentsService(Configuration::getAcctAndConfig());
try {
    /* wrap API method calls on the service object with a try catch */
    $response = $service->GetShippingAddresses($getShippingAddressesReq);
} catch (Exception $ex) {
    require_once 'Comon/Error.php';
    exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>PayPal Adaptive Payments - Get Shipping Addresses</title>
<link href="Common/sdk.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Common/sdk_functions.js"></script>
</head>

<body>
	<div id="wrapper">