PluginProbe
PayPlug for WooCommerce (Official) / 2.9.0
PayPlug for WooCommerce (Official) v2.9.0
3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 All 101 releases
← All changes | src/Gateway/PayplugAddressData.php +22 -8 1.2.12.9.0 View file →
@@ -158,20 +158,26 @@
158 158 $billing_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_address_2 : $order->get_billing_address_2();
159 159 $billing_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_postcode : $order->get_billing_postcode();
160 160 $billing_city = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_city : $order->get_billing_city();
161 161 $billing_country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country();
162 + $billing_company = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_company : $order->get_billing_company();
163 + if (empty($billing_company)) {
164 + $billing_company = $billing_first_name .' '. $billing_last_name;
165 + }
166 +
162 167 if ( ! PayplugWoocommerceHelper::is_country_supported( $billing_country ) ) {
163 168 $billing_country = PayplugWoocommerceHelper::get_default_country();
164 169 }
165 170
166 171 $this->billing = [
167 - 'first_name' => $this->limit_length( $billing_first_name ),
168 - 'last_name' => $this->limit_length( $billing_last_name ),
169 - 'email' => $this->limit_length( $billing_email, 255 ),
170 - 'address1' => $this->limit_length( $billing_address1, 255 ),
171 - 'postcode' => $this->limit_length( $billing_postcode, 16 ),
172 - 'city' => $this->limit_length( $billing_city ),
173 - 'country' => $this->limit_length( $billing_country, 2 ),
172 + 'first_name' => $this->limit_length( $billing_first_name ),
173 + 'last_name' => $this->limit_length( $billing_last_name ),
174 + 'email' => $this->limit_length( $billing_email, 255 ),
175 + 'address1' => $this->limit_length( $billing_address1, 255 ),
176 + 'postcode' => $this->limit_length( $billing_postcode, 16 ),
177 + 'city' => $this->limit_length( $billing_city ),
178 + 'country' => $this->limit_length( $billing_country, 2 ),
179 + 'company_name' => $this->limit_length( $billing_company )
174 180 ];
175 181
176 182 if ( ! empty( $billing_address2 ) ) {
177 183 $this->billing['address2'] = $this->limit_length( $billing_address2, 255 );
@@ -193,8 +199,14 @@
193 199 $shipping_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_address_2 : $order->get_shipping_address_2();
194 200 $shipping_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_postcode : $order->get_shipping_postcode();
195 201 $shipping_city = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_city : $order->get_shipping_city();
196 202 $shipping_country = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_country : $order->get_shipping_country();
203 + $shipping_company = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_company : $order->get_shipping_company();
204 +
205 + if (empty($shipping_company)) {
206 + $shipping_company = $shipping_first_name .' '. $shipping_last_name;
207 + }
208 +
197 209 if ( ! PayplugWoocommerceHelper::is_country_supported( $shipping_country ) ) {
198 210 $shipping_country = PayplugWoocommerceHelper::get_default_country();
199 211 }
200 212
@@ -204,9 +216,10 @@
204 216 'email' => $this->limit_length( $shipping_email, 255 ),
205 217 'address1' => $this->limit_length( $shipping_address1, 255 ),
206 218 'postcode' => $this->limit_length( $shipping_postcode, 16 ),
207 219 'city' => $this->limit_length( $shipping_city ),
208 - 'country' => $this->limit_length( $shipping_country, 2 ),
220 + 'country' => $this->limit_length( $shipping_country, 2 ),
221 + 'company_name' => $this->limit_length( $shipping_company )
209 222 ];
210 223
211 224 if ( ! empty( $shipping_address2 ) ) {
212 225 $this->shipping['address2'] = $this->limit_length( $shipping_address2, 255 );
@@ -261,8 +274,9 @@
261 274 }
262 275
263 276 if ( PhoneNumberType::MOBILE === $phone_number_util->getNumberType( $phone_number ) ) {
264 277 $this->billing['mobile_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 );
278 + $this->shipping['mobile_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 );
265 279 } else {
266 280 $this->billing['landline_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 );
267 281 }
268 282 } catch ( \Exception $e ) {