xmlToArray() public static method

Convert xml string to an intermediate nested array representation that can be iterated
public static xmlToArray ( string $xmlInput )
$xmlInput string XML string to convert
 /**
  * Service Call: ExternalRememberMeOptOut
  * @param ExternalRememberMeOptOutReq $externalRememberMeOptOutReq
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return PayPalAPI\ExternalRememberMeOptOutResponseType
  * @throws APIException
  */
 public function ExternalRememberMeOptOut($externalRememberMeOptOutReq, $apiCredential = NULL)
 {
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPMerchantServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $this->setStandardParams($externalRememberMeOptOutReq->ExternalRememberMeOptOutRequest);
     $ret = new ExternalRememberMeOptOutResponseType();
     $resp = $this->call('PayPalAPIAA', 'ExternalRememberMeOptOut', $externalRememberMeOptOutReq, $apiContext, $handlers);
     $ret->init(PPUtils::xmlToArray($resp));
     return $ret;
 }
 /**
  * Service Call: UpdateAuthorization
  * @param UpdateAuthorizationReq $updateAuthorizationReq
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return PayPalAPI\UpdateAuthorizationResponseType
  * @throws APIException
  */
 public function UpdateAuthorization($updateAuthorizationReq, $apiCredential = NULL)
 {
     $this->setStandardParams($updateAuthorizationReq->UpdateAuthorizationRequest);
     $ret = new UpdateAuthorizationResponseType();
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPMerchantServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $resp = $this->call('PayPalAPIAA', 'UpdateAuthorization', $updateAuthorizationReq, $apiContext, $handlers);
     $ret->init(PPUtils::xmlToArray($resp));
     return $ret;
 }
Esempio n. 3
0
 /**
  * @test
  */
 function testSoapFaultXml()
 {
     $xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body> <soapenv:Fault xmlns:axis2ns237961="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>axis2ns237961:Server</faultcode><faultstring>Authentication failed. API credentials are incorrect.</faultstring><detail><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-09-03T04:36:14.931-07:00</timestamp><ack>Failure</ack><correlationId>ebeb480862a99</correlationId><build>6941298</build></responseEnvelope><error><errorId>520003</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>Authentication failed. API credentials are incorrect.</message></error></ns3:FaultMessage></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>';
     $ret = PPUtils::xmlToArray($xml);
     $this->assertEquals("soapenv:Fault", $ret[0]['name']);
 }
 /**
  * Service Call: ExternalRememberMeOptOut
  * @param ExternalRememberMeOptOutReq $externalRememberMeOptOutReq
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically 		
  * @return PayPalAPI\ExternalRememberMeOptOutResponseType
  * @throws APIException
  */
 public function ExternalRememberMeOptOut($externalRememberMeOptOutReq, $apiCredential = NULL)
 {
     $this->setStandardParams($externalRememberMeOptOutReq->ExternalRememberMeOptOutRequest);
     $ret = new ExternalRememberMeOptOutResponseType();
     $resp = $this->call('PayPalAPIAA', 'ExternalRememberMeOptOut', $externalRememberMeOptOutReq, $apiCredential);
     $ret->init(PPUtils::xmlToArray($resp));
     return $ret;
 }