From ae411bc36df14ebc21f30334989bfd99ddb414b9 Mon Sep 17 00:00:00 2001 From: Vincent Pietri Date: Wed, 11 Jan 2023 09:31:14 +0100 Subject: [PATCH] 4.72.1, add comments --- src/Payline/PaylineSDK.php | 1 + src/Payline/SoapVarFactory.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) 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) ) {