nvpToMap() public static method

Convert a Name Value Pair (NVP) formatted string into an associative array taking care to urldecode array values
public static nvpToMap ( string $nvpString ) : array
$nvpString string
return array
Exemplo n.º 1
0
 /**
  * @test
  */
 public function testNvpToMap()
 {
     $arr = $this->object->nvpToMap('requestEnvelope.detailLevel=ReturnAll&requestEnvelope.errorLanguage=en_US&invoice.merchantEmail=jb-us-seller1@paypal.com&invoice.payerEmail=jbui-us-personal1@paypal.com&invoice.items[0].name=product1&invoice.items[0].quantity=10.0&invoice.items[0].unitPrice=1.2&invoice.currencyCode=USD&invoice.paymentTerms=DueOnReceipt');
     $this->assertArrayHasKey('requestEnvelope.detailLevel', $arr);
     $this->assertArrayHasKey('requestEnvelope.errorLanguage', $arr);
     $this->assertEquals(is_array($arr), true);
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function deserializeAndSerialize()
 {
     $nvpString = "list2(0).field1=somevalue1&list2(0).field2=somevalue2&list2(1).field1=another+value1&list2(1).field2=anothervalue2&list3(0).attrib1=somevalue1&list3(0).attrib2=somevalue2&list3(0)=value+field&list3(1).attrib1=another+value1&list3(2)=anothervalue2";
     $newC = new SimpleContainerTestClass();
     $newC->init(PPUtils::nvpToMap($nvpString));
     //TODO: Mock nvpToMap
     $this->assertEquals($nvpString, $newC->toNVPString());
 }
Exemplo n.º 3
0
 /**
  * Service Call: DeleteInvoice
  * @param DeleteInvoiceRequest $deleteInvoiceRequest
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return Types\PT\DeleteInvoiceResponse
  * @throws APIException
  */
 public function DeleteInvoice($deleteInvoiceRequest, $apiCredential = NULL)
 {
     $ret = new DeleteInvoiceResponse();
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $resp = $this->call('Invoice', 'DeleteInvoice', $deleteInvoiceRequest, $apiContext, $handlers);
     $ret->init(PPUtils::nvpToMap($resp));
     return $ret;
 }
 /**
  * Service Call: GetAdvancedPersonalData
  * @param GetAdvancedPersonalDataRequest $getAdvancedPersonalDataRequest
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically 		
  * @return Types\Perm\GetAdvancedPersonalDataResponse
  * @throws APIException
  */
 public function GetAdvancedPersonalData($getAdvancedPersonalDataRequest, $apiCredential = NULL)
 {
     $ret = new GetAdvancedPersonalDataResponse();
     $resp = $this->call('Permissions', 'GetAdvancedPersonalData', $getAdvancedPersonalDataRequest, $apiCredential);
     $ret->init(PPUtils::nvpToMap($resp));
     return $ret;
 }
 /**
  * Service Call: GetPrePaymentDisclosure
  * @param GetPrePaymentDisclosureRequest $getPrePaymentDisclosureRequest
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return Types\AP\GetPrePaymentDisclosureResponse
  * @throws APIException
  */
 public function GetPrePaymentDisclosure($getPrePaymentDisclosureRequest, $apiCredential = NULL)
 {
     $ret = new GetPrePaymentDisclosureResponse();
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $resp = $this->call('AdaptivePayments', 'GetPrePaymentDisclosure', $getPrePaymentDisclosureRequest, $apiContext, $handlers);
     $ret->init(PPUtils::nvpToMap($resp));
     return $ret;
 }
 /**
  * Service Call: GetAdvancedPersonalData
  * @param GetAdvancedPersonalDataRequest $getAdvancedPersonalDataRequest
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return Types\Perm\GetAdvancedPersonalDataResponse
  * @throws APIException
  */
 public function GetAdvancedPersonalData($getAdvancedPersonalDataRequest, $apiCredential = NULL)
 {
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $ret = new GetAdvancedPersonalDataResponse();
     $resp = $this->call('Permissions', 'GetAdvancedPersonalData', $getAdvancedPersonalDataRequest, $apiContext, $handlers);
     $ret->init(PPUtils::nvpToMap($resp));
     return $ret;
 }
Exemplo n.º 7
0
 /**
  * Service Call: CheckComplianceStatus
  * @param CheckComplianceStatusRequest $checkComplianceStatusRequest
  * @param mixed $apiCredential - Optional API credential - can either be
  * 		a username configured in sdk_config.ini or a ICredential object
  *      created dynamically
  * @return Types\AA\CheckComplianceStatusResponse
  * @throws APIException
  */
 public function CheckComplianceStatus($checkComplianceStatusRequest, $apiCredential = NULL)
 {
     $ret = new CheckComplianceStatusResponse();
     $apiContext = new PPApiContext($this->config);
     $handlers = array(new PPPlatformServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
     $resp = $this->call('AdaptiveAccounts', 'CheckComplianceStatus', $checkComplianceStatusRequest, $apiContext, $handlers);
     $ret->init(PPUtils::nvpToMap($resp));
     return $ret;
 }