PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 All 50 releases
← All changes | app/Modules/PaymentMethods/StripeGateway/StripeHelper.php +18 -0 1.6.4 → 1.7.0 View file →
@@ -147,8 +147,26 @@
147 147
148 148 return $amount;
149 149 }
150 150
151 + /**
152 + * Convert a Stripe object's `livemode` flag to a getStripeObject()/getApiKey()
153 + * `$mode` argument. The store's global mode toggle ('current') is not a reliable
154 + * proxy for which key an already-fetched object needs — use its own livemode
155 + * whenever one is available instead of guessing from the store setting.
156 + *
157 + * @param bool|null $livemode Null when no prior object/event is available yet.
158 + * @return string 'live', 'test', or 'current'
159 + */
160 + public static function modeFromLivemode($livemode)
161 + {
162 + if (is_null($livemode)) {
163 + return 'current';
164 + }
165 +
166 + return $livemode ? 'live' : 'test';
167 + }
168 +
151 169 public static function processRemoteRefund($transaction, $amount, $args)
152 170 {
153 171 $intentId = $transaction->vendor_charge_id;
154 172 if (!$intentId) {