PluginProbe
PayPlug for WooCommerce (Official) / trunk
PayPlug for WooCommerce (Official) vtrunk
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
payplug / src / Helper / Lock.php

Lock.php in PayPlug for WooCommerce (Official) trunk, at src/Helper/Lock.php

30 lines 755 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Payplug\PayplugWoocommerce\Helper;
4
5 class Lock
6 {
7 public static function handle_insert($save, $payment_id)
8 {
9 if ($save) {
10 $lock_id = \Payplug\PayplugWoocommerce\Model\Lock::insert_lock($payment_id);
11
12 //there's a payment being processed this moment
13 if (\Payplug\PayplugWoocommerce\Model\Lock::locked($payment_id, $lock_id)) {
14 return false;
15 }
16
17 return $lock_id;
18 } else {
19 //saved request to be processed
20 $lock = \Payplug\PayplugWoocommerce\Model\Lock::get_lock_by_payment_id($payment_id);
21
22 if (empty($lock->id)) {
23 return false;
24 }
25
26 return $lock->id;
27 }
28 }
29 }
30