File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace WCPay \Migrations ;
9
9
10
+ use Exception ;
10
11
use WC_Payment_Gateway_WCPay ;
11
12
12
13
defined ( 'ABSPATH ' ) || exit;
@@ -63,20 +64,14 @@ public function maybe_sync() {
63
64
64
65
/**
65
66
* Syncs gateway setting objects.
67
+ *
68
+ * @throws Exception
66
69
*/
67
70
private function sync () {
68
71
$ enabled_payment_methods = $ this ->main_gateway ->get_option ( 'upe_enabled_payment_method_ids ' , [] );
69
72
70
73
foreach ( $ this ->all_registered_gateways as $ gateway ) {
71
- // Skip the main gateway as it's settings are already in sync.
72
- if ( 'card ' !== $ gateway ->get_stripe_id () ) {
73
- if ( in_array ( $ gateway ->get_stripe_id (), $ enabled_payment_methods , true ) ) {
74
- $ gateway ->enable ();
75
- $ gateway ->update_option ( 'upe_enabled_payment_method_ids ' , $ enabled_payment_methods );
76
- } else {
77
- $ gateway ->update_option ( 'upe_enabled_payment_method_ids ' , $ enabled_payment_methods );
78
- }
79
- }
74
+ throw new Exception ( 'Migration unsuccessful. ' );
80
75
}
81
76
}
82
77
}
You can’t perform that action at this time.
0 commit comments