Index: branches/5.1.x/units/gateways/gw_classes/google_checkout.php =================================================================== diff -u -r13100 -r13465 --- branches/5.1.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 13100) +++ branches/5.1.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 13465) @@ -1,6 +1,6 @@ $address_info['POSTAL-CODE'], ); - $shipping_address['ShippingCountry'] = $this->getCountryISO($address_info['COUNTRY-CODE']); + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + $shipping_address['ShippingCountry'] = $cs_helper->getCountryIso($address_info['COUNTRY-CODE'], true); + $order->SetDBFieldsFromHash($shipping_address); $order->Update(); @@ -514,6 +517,10 @@ 'REGION' => 'State', 'POSTAL-CODE' => 'Zip', ); + + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + foreach ($user_address as $field_prefix => $address_details) { foreach ($address_mapping as $src_field => $dst_field) { $order->SetDBField($field_prefix.$dst_field, $address_details[$src_field]); @@ -523,7 +530,7 @@ $order->SetDBField($field_prefix.'Phone', '-'); // required field } - $order->SetDBField($field_prefix.'Country', $this->getCountryISO($address_details['COUNTRY-CODE'])); + $order->SetDBField( $field_prefix.'Country', $cs_helper->getCountryIso($address_details['COUNTRY-CODE'], true) ); } $order->SetDBField('OnHold', 1); @@ -808,20 +815,6 @@ } /** - * Returns 3 symbols ISO code from 2 symbols ISO code - * - * @param string $country_code - * @return string - */ - function getCountryISO($country_code) - { - $sql = 'SELECT DestAbbr - FROM '.TABLE_PREFIX.'StdDestinations - WHERE DestAbbr2 = '.$this->Conn->qstr($country_code); - return $this->Conn->GetOne($sql); - } - - /** * Retrieves shipping types available for given order * * @param OrdersItem $order