public GetAllowedFundingSources ( GetAllowedFundingSourcesRequest $getAllowedFundingSourcesRequest, mixed $apiCredential = NULL ) : Types\AP\GetAllowedFundingSourcesResponse | ||
$getAllowedFundingSourcesRequest | GetAllowedFundingSourcesRequest | |
$apiCredential | mixed | - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically |
Результат | Types\AP\GetAllowedFundingSourcesResponse |
public function GetAllowedFundingSources($getAllowedFundingSourcesRequest, $apiCredential = NULL)
{
$ret = new GetAllowedFundingSourcesResponse();
$apiContext = new PPApiContext($this->config);
$handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
$resp = $this->call('AdaptivePayments', 'GetAllowedFundingSources', $getAllowedFundingSourcesRequest, $apiContext, $handlers);
$ret->init(PPUtils::nvpToMap($resp));
return $ret;
}
<?php use PayPal\Service\AdaptivePaymentsService; use PayPal\Types\AP\GetAllowedFundingSourcesRequest; use PayPal\Types\Common\RequestEnvelope; require_once 'PPBootStrap.php'; // create request $requestEnvelope = new RequestEnvelope("en_US"); $getAllowedFundingSourcesReq = new GetAllowedFundingSourcesRequest($requestEnvelope, $_POST['key']); /* Configuration::getAcctAndConfig() returns array that contains credential and config parameters */ $service = new AdaptivePaymentsService(Configuration::getAcctAndConfig()); try { $response = $service->GetAllowedFundingSources($getAllowedFundingSourcesReq); } catch (Exception $ex) { require_once 'Common/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 Allowed Funding Sources</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"> <img src="https://devtools-paypal.com/image/bdg_payments_by_pp_2line.png"/>