Index: branches/5.1.x/units/gateways/gw_classes/paypal_direct.php =================================================================== diff -u -r13100 -r13465 --- branches/5.1.x/units/gateways/gw_classes/paypal_direct.php (.../paypal_direct.php) (revision 13100) +++ branches/5.1.x/units/gateways/gw_classes/paypal_direct.php (.../paypal_direct.php) (revision 13465) @@ -1,6 +1,6 @@ Conn->GetOne( sprintf($sql, $this->Conn->qstr($item_data['BillingCountry']) ) ); + + $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); + /* @var $cs_helper kCountryStatesHelper */ + + $post_fields['COUNTRYCODE'] = $cs_helper->getCountryIso( $item_data['BillingCountry'] ); $post_fields['ZIP'] = $item_data['BillingZip']; $post_fields['INVNUM'] = $item_data['OrderNumber']; $post_fields['CUSTOM'] = $item_data['PortalUserId']; @@ -115,8 +118,7 @@ } $post_fields['x_email'] = $billing_email; $post_fields['x_phone'] = $item_data['BillingPhone']; - $sql = 'SELECT DestAbbr2 FROM '.TABLE_PREFIX.'StdDestinations WHERE DestAbbr = %s'; - $post_fields['x_country'] = $this->Conn->GetOne( sprintf($sql, $this->Conn->qstr($item_data['BillingCountry']) ) ); + $post_fields['x_country'] = $cs_helper->getCountryIso( $item_data['BillingCountry'] ); $post_fields['x_cust_id'] = $item_data['PortalUserId']; $post_fields['x_invoice_num'] = $item_data['OrderNumber'];