diff --git a/src/Payline/PaylineSDK.php b/src/Payline/PaylineSDK.php index 659663b..c1c699c 100644 --- a/src/Payline/PaylineSDK.php +++ b/src/Payline/PaylineSDK.php @@ -870,6 +870,7 @@ private function formatRequest(&$array) $array['buyer']['billingAddress'] = $array['billingAddress']; } + //Backward Compatibility, take account of misspelling. "shippingAdress" versus "shippingAddress" if (!isset($array['buyer']['shippingAdress']) && isset($array['buyer']['shippingAddress'])) { $array['buyer']['shippingAdress'] = $array['buyer']['shippingAddress']; } diff --git a/src/Payline/SoapVarFactory.php b/src/Payline/SoapVarFactory.php index eb76e82..11d5ecb 100644 --- a/src/Payline/SoapVarFactory.php +++ b/src/Payline/SoapVarFactory.php @@ -4,6 +4,9 @@ class SoapVarFactory { + /** + * Basename namespace for WSDLs objects + */ const ROOT_CLASSNAME = "Payline\\Objects\\"; /** @@ -72,6 +75,15 @@ public function createObject($elementKey, $data=null, $baseClassname=null) { return $newObject; } + /** + * Get SOAP var type + * Should be same type as base classname + * Manage exceptions: Buyer/BillingAddress, Buyer/ShippingAdress and Wallet/ShippingAddress + * + * @param $elementKey + * @param $baseClassname + * @return mixed|string + */ protected function getSoapVarType($elementKey, $baseClassname) { $soapVarType = $elementKey; if($className = $this->getPaylineClassname($elementKey, $baseClassname) ) {