PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.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 All 102 releases
← All changes | src/Front/ApplePay.php +9 -9 2.18.0 → 3.1.0 View file →
@@ -27,9 +27,9 @@
27 27 add_action('wc_ajax_applepay_empty_cart', [$this, 'applepay_empty_cart']);
28 28 add_action('wc_ajax_applepay_add_to_cart', [$this, 'applepay_add_to_cart']);
29 29 }
30 30
31 - public function applepay_get_shippings()
31 + public function applepay_get_shippings(): void
32 32 {
33 33 WC()->customer->set_shipping_country('FR');
34 34 WC()->customer->set_shipping_city('Paris');
35 35 WC()->customer->set_shipping_postcode('12345');
@@ -93,9 +93,9 @@
93 93
94 94 return $shipping_zone->get_shipping_methods(true);
95 95 }
96 96
97 - public function place_order_with_dummy_data()
97 + public function place_order_with_dummy_data(): void
98 98 {
99 99 $apple_pay = new ApplePayGateway();
100 100 if (is_admin()) {
101 101 return;
@@ -155,9 +155,9 @@
155 155 wp_send_json_error();
156 156 }
157 157 }
158 158
159 - public function process_cart_payment($order, $gateway)
159 + public function process_cart_payment($order, $gateway): void
160 160 {
161 161 $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id();
162 162 $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
163 163 $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total() - ($order->get_shipping_tax() + $order->get_shipping_total()));
@@ -168,9 +168,9 @@
168 168 'payment_data' => $gateway->process_standard_payment($order, $amount, $customer_id, 'product'),
169 169 ]);
170 170 }
171 171
172 - public function update_applepay_order()
172 + public function update_applepay_order(): void
173 173 {
174 174 $order_id = $_POST['order_id'];
175 175 $order = wc_get_order($order_id);
176 176
@@ -303,9 +303,9 @@
303 303 }
304 304 }
305 305 }
306 306
307 - $order->calculate_totals($use_taxes);
307 + $order->calculate_totals(wc_tax_enabled());
308 308 $order->save();
309 309
310 310 wp_send_json($order);
311 311 }
@@ -316,9 +316,9 @@
316 316 * @throws \Payplug\Exception\ConfigurationNotSetException
317 317 *
318 318 * @return void
319 319 */
320 - public function update_applepay_payment()
320 + public function update_applepay_payment(): void
321 321 {
322 322 $applepay = new ApplePayGateway();
323 323
324 324 $payment_id = $_POST['payment_id'];
@@ -354,9 +354,9 @@
354 354 'update' => $update,
355 355 ]);
356 356 }
357 357
358 - public function applepay_cancel_order()
358 + public function applepay_cancel_order(): void
359 359 {
360 360 $payment_id = !empty($_POST['payment_id']) ? $_POST['payment_id'] : null;
361 361 $order_id = $_POST['order_id'];
362 362
@@ -408,9 +408,9 @@
408 408 ]);
409 409 }
410 410 }
411 411
412 - public function applepay_empty_cart()
412 + public function applepay_empty_cart(): void
413 413 {
414 414 try {
415 415 WC()->cart->empty_cart();
416 416 wp_send_json_success();
@@ -420,9 +420,9 @@
420 420 ]);
421 421 }
422 422 }
423 423
424 - public function applepay_add_to_cart()
424 + public function applepay_add_to_cart(): void
425 425 {
426 426 try {
427 427 if (!empty($_POST['product_id'])) {
428 428 $product_id = $_POST['product_id'];