File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,12 @@ public function getClass(string $class, string $property){
8989 }
9090 // return $this->classes[$classname]['properties'][$property]['type'];
9191 }
92+
93+ public function getXmlName (string $ class ){
94+ if (isset ($ this ->classes [$ class ]['xml_root_name ' ])){
95+ return $ this ->classes [$ class ]['xml_root_name ' ];
96+ }
97+ }
9298}
9399//echo $classes['net\authorize\api\contract\v1\ANetApiRequestType']['properties']['merchantAuthentication']['type']."\n";
94100
Original file line number Diff line number Diff line change @@ -111,12 +111,15 @@ public function execute($endPoint = \net\authorize\api\constants\ANetEnvironment
111111
112112 $ this ->apiRequest ->setClientId ("sdk-php- " . \net \authorize \api \constants \ANetEnvironment::VERSION );
113113
114- $ this ->logger ->info ("Request Serialization Begin " );
114+ $ this ->logger ->info ("Request Creation Begin " );
115115 $ this ->logger ->debug ($ this ->apiRequest );
116116 // $xmlRequest = $this->serializer->serialize($this->apiRequest, 'xml');
117- $ requestArray = [lcfirst ((new \ReflectionClass ($ this ->apiRequest ))->getShortName ()) => $ this ->apiRequest ];
117+ //$requestArray = [lcfirst((new \ReflectionClass($this->apiRequest))->getShortName()) => $this->apiRequest];
118+
119+ $ requestRoot = (new \net \authorize \api \contract \v1 \Mapper )->getXmlName ((new \ReflectionClass ($ this ->apiRequest ))->getName ());
120+ $ requestArray = [$ requestRoot => $ this ->apiRequest ];
118121
119- $ this ->logger ->info ("Request Serialization End " );
122+ $ this ->logger ->info ("Request Creation End " );
120123 /*
121124 //$xmlRequest = '<?xml version="1.0" encoding="UTF-8"?> <ARBGetSubscriptionListRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>4YJmeW7V77us</name> <transactionKey>4qHK9u63F753be4Z</transactionKey> </merchantAuthentication> <refId><![CDATA[ref1416999093]]></refId> <searchType><![CDATA[subscriptionActive]]></searchType> <sorting> <orderBy><![CDATA[firstName]]></orderBy> <orderDescending>false</orderDescending> </sorting> <paging> <limit>10</limit> <offset>1</offset> </paging> </ARBGetSubscriptionListRequest> ';
122125 */
You can’t perform that action at this time.
0 commit comments